Fix up objectivec sources to simplfy import into Google.

pull/8767/head
Dave MacLachlan 4 years ago committed by Thomas Van Lenten
parent cf12bffd9d
commit 3fd4d3fe8e
  1. 8
      src/google/protobuf/compiler/objectivec/objectivec_generator.cc
  2. 3
      src/google/protobuf/compiler/objectivec/objectivec_helpers.cc

@ -150,11 +150,11 @@ bool ObjectiveCGenerator::GenerateAll(
// is just what to do if that isn't set. The available options are:
// "no": Not prefixed (the existing mode).
// "yes": Make a prefix out of the proto package.
std::string lower_value(options[i].second);
LowerString(&lower_value);
if (lower_value == "no") {
std::string upper_value(options[i].second);
UpperString(&upper_value);
if (upper_value == "NO") {
SetUseProtoPackageAsDefaultPrefix(false);
} else if (lower_value == "yes") {
} else if (upper_value == "YES") {
SetUseProtoPackageAsDefaultPrefix(true);
} else {
*error = "error: Unknown use_package_as_prefix: " + options[i].second;

@ -523,8 +523,7 @@ std::string FileClassPrefix(const FileDescriptor* file) {
// camelcase each one and then join them with underscores, and add an
// underscore at the end.
std::string result;
const std::vector<std::string> segments =
Split(file->package(), ".", true /* skip_empty */);
const std::vector<std::string> segments = Split(file->package(), ".", true);
for (const auto& segment : segments) {
const std::string part = UnderscoresToCamelCase(segment, true);
if (part.empty()) {

Loading…
Cancel
Save