And an overload for ValidateObjCClassPrefixes().

This version defaults all the options, so folks don't have to pass it.

Since Options never had a PROTOC_EXPORT, it isn't immediately clear how well the
existing api worked for any shared lib cases, so this should give a simpler api
for the basic usage (if anyone wants to use it).
pull/9565/head
Thomas Van Lenten 3 years ago
parent d9048081b2
commit 76ba220c38
  1. 7
      src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
  2. 6
      src/google/protobuf/compiler/objectivec/objectivec_helpers.h

@ -1454,6 +1454,13 @@ bool ValidateObjCClassPrefix(
} // namespace
bool ValidateObjCClassPrefixes(const std::vector<const FileDescriptor*>& files,
std::string* out_error) {
// Options's ctor load from the environment.
Options options;
return ValidateObjCClassPrefixes(files, options, out_error);
}
bool ValidateObjCClassPrefixes(const std::vector<const FileDescriptor*>& files,
const Options& generation_options,
std::string* out_error) {

@ -253,7 +253,11 @@ IsProtobufLibraryBundledProtoFile(const FileDescriptor* file);
// and the result is false.
bool PROTOC_EXPORT ValidateObjCClassPrefixes(
const std::vector<const FileDescriptor*>& files,
const Options& generation_options, std::string* out_error);
const Options& validation_options, std::string* out_error);
// Same was the other ValidateObjCClassPrefixes() calls, but the options all
// come from the environment variables.
bool PROTOC_EXPORT ValidateObjCClassPrefixes(
const std::vector<const FileDescriptor*>& files, std::string* out_error);
// Generate decode data needed for ObjC's GPBDecodeTextFormatName() to transform
// the input into the expected output.

Loading…
Cancel
Save