@ -1906,25 +1906,56 @@ class PROTOBUF_EXPORT DescriptorPool {
// Reports an error in the FileDescriptorProto. Use this function if the
// problem occurred should interrupt building the FileDescriptorProto.
virtual void AddError (
const std : : string & filename , // File name in which the error occurred.
const std : : string & element_name , // Full name of the erroneous element.
const Message * descriptor , // Descriptor of the erroneous element.
ErrorLocation location , // One of the location constants, above.
const std : : string & message // Human-readable error message.
) = 0 ;
// Provided the following arguments:
// filename - File name in which the error occurred.
// element_name - Full name of the erroneous element.
// descriptor - Descriptor of the erroneous element.
// location - One of the location constants, above.
// message - Human-readable error message.
virtual void RecordError ( absl : : string_view filename ,
absl : : string_view element_name ,
const Message * descriptor , ErrorLocation location ,
absl : : string_view message ) {
PROTOBUF_IGNORE_DEPRECATION_START
AddError ( std : : string ( filename ) , std : : string ( element_name ) , descriptor ,
location , std : : string ( message ) ) ;
PROTOBUF_IGNORE_DEPRECATION_STOP
}
// Reports a warning in the FileDescriptorProto. Use this function if the
// problem occurred should NOT interrupt building the FileDescriptorProto.
virtual void AddWarning (
const std : : string & /*filename*/ , // File name in which the error
// occurred.
const std : : string & /*element_name*/ , // Full name of the erroneous
// element.
const Message * /*descriptor*/ , // Descriptor of the erroneous element.
ErrorLocation /*location*/ , // One of the location constants, above.
const std : : string & /*message*/ // Human-readable error message.
) { }
// Provided the following arguments:
// filename - File name in which the error occurred.
// element_name - Full name of the erroneous element.
// descriptor - Descriptor of the erroneous element.
// location - One of the location constants, above.
// message - Human-readable error message.
virtual void RecordWarning ( absl : : string_view filename ,
absl : : string_view element_name ,
const Message * descriptor ,
ErrorLocation location ,
absl : : string_view message ) {
PROTOBUF_IGNORE_DEPRECATION_START
AddWarning ( std : : string ( filename ) , std : : string ( element_name ) , descriptor ,
location , std : : string ( message ) ) ;
PROTOBUF_IGNORE_DEPRECATION_STOP
}
private :
// These should never be called directly, but if a legacy class overrides
// them they'll get routed to by the Record* methods.
ABSL_DEPRECATED ( " Use RecordError " )
virtual void AddError ( const std : : string & filename ,
const std : : string & element_name ,
const Message * descriptor , ErrorLocation location ,
const std : : string & message ) {
GOOGLE_ABSL_LOG ( FATAL ) < < " AddError or RecordError must be implemented. " ;
}
ABSL_DEPRECATED ( " Use RecordWarning " )
virtual void AddWarning ( const std : : string & filename ,
const std : : string & element_name ,
const Message * descriptor , ErrorLocation location ,
const std : : string & message ) { }
} ;
// Convert the FileDescriptorProto to real descriptors and place them in