Index: third_party/protobuf/src/google/protobuf/util/internal/utility.h |
diff --git a/third_party/protobuf/src/google/protobuf/util/internal/utility.h b/third_party/protobuf/src/google/protobuf/util/internal/utility.h |
index 33df8edad268241102d0f149ea057264a43b5401..667e660c581ebdf3c3b7359e90505ef1cbf236cc 100644 |
--- a/third_party/protobuf/src/google/protobuf/util/internal/utility.h |
+++ b/third_party/protobuf/src/google/protobuf/util/internal/utility.h |
@@ -64,6 +64,10 @@ class EnumValue; |
namespace protobuf { |
namespace util { |
namespace converter { |
+ |
+// Size of "type.googleapis.com" |
+static const int64 kTypeUrlSize = 19; |
+ |
// Finds the tech option identified by option_name. Parses the boolean value and |
// returns it. |
// When the option with the given name is not found, default_value is returned. |
@@ -132,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( |
@@ -142,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); |