diff options
author | Bo Yang <teboring@google.com> | 2016-09-19 13:45:07 -0700 |
---|---|---|
committer | Bo Yang <teboring@google.com> | 2016-10-10 11:23:36 -0700 |
commit | cc8ca5b6a5478b40546d4206392eb1471454460d (patch) | |
tree | c0b45abfa16d7d373a6ea8f7fe50f1de00ab938e /src/google/protobuf/util/internal/utility.h | |
parent | 337a028bb65ccca4dda768695950b5aba53ae2c9 (diff) | |
download | protobuf-cc8ca5b6a5478b40546d4206392eb1471454460d.tar.gz protobuf-cc8ca5b6a5478b40546d4206392eb1471454460d.tar.bz2 protobuf-cc8ca5b6a5478b40546d4206392eb1471454460d.zip |
Integrate internal changes
Diffstat (limited to 'src/google/protobuf/util/internal/utility.h')
-rw-r--r-- | src/google/protobuf/util/internal/utility.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/google/protobuf/util/internal/utility.h b/src/google/protobuf/util/internal/utility.h index 26fed444..667e660c 100644 --- a/src/google/protobuf/util/internal/utility.h +++ b/src/google/protobuf/util/internal/utility.h @@ -136,6 +136,10 @@ const google::protobuf::Field* FindFieldInTypeOrNull( const google::protobuf::Field* FindJsonFieldInTypeOrNull( const google::protobuf::Type* type, StringPiece json_name); +// Similar to FindFieldInTypeOrNull, but this looks up fields by number. +const google::protobuf::Field* FindFieldInTypeByNumberOrNull( + const google::protobuf::Type* type, int32 number); + // Finds and returns the EnumValue identified by enum_name in the passed tech // Enum object. Returns NULL if none found. const google::protobuf::EnumValue* FindEnumValueByNameOrNull( @@ -146,6 +150,13 @@ const google::protobuf::EnumValue* FindEnumValueByNameOrNull( const google::protobuf::EnumValue* FindEnumValueByNumberOrNull( const google::protobuf::Enum* enum_type, int32 value); +// Finds and returns the EnumValue identified by enum_name without underscore in +// the passed tech Enum object. Returns NULL if none found. +// For Ex. if enum_name is ACTIONANDADVENTURE it can get accepted if +// EnumValue's name is action_and_adventure or ACTION_AND_ADVENTURE. +const google::protobuf::EnumValue* FindEnumValueByNameWithoutUnderscoreOrNull( + const google::protobuf::Enum* enum_type, StringPiece enum_name); + // Converts input to camel-case and returns it. LIBPROTOBUF_EXPORT string ToCamelCase(const StringPiece input); |