Go to the documentation of this file.
46 #include <google/protobuf/port_def.inc>
55 const std::string& option_name,
bool default_value) {
75 const std::string& option_name,
double default_value) {
95 result->ParseFromString(
data);
145 if (opt.name() == option_name) {
154 if (
type !=
nullptr) {
155 for (
int i = 0;
i <
type->fields_size(); ++
i) {
157 if (
field.name() == field_name) {
167 if (
type !=
nullptr) {
168 for (
int i = 0;
i <
type->fields_size(); ++
i) {
170 if (
field.json_name() == json_name) {
180 if (
type !=
nullptr) {
181 for (
int i = 0;
i <
type->fields_size(); ++
i) {
196 if (enum_value.name() == enum_name) {
209 if (enum_value.number() ==
value) {
222 std::string enum_name_without_underscore = enum_value.name();
225 enum_name_without_underscore.erase(
226 std::remove(enum_name_without_underscore.begin(),
227 enum_name_without_underscore.end(),
'_'),
228 enum_name_without_underscore.end());
230 for (std::string::iterator
it = enum_name_without_underscore.begin();
231 it != enum_name_without_underscore.end(); ++
it) {
235 if (enum_name_without_underscore == enum_name) {
245 std::transform(input_string.begin(), input_string.end(), input_string.begin(),
251 bool capitalize_next =
false;
254 bool first_word =
true;
256 result.reserve(
input.size());
258 for (
size_t i = 0;
i <
input.size(); ++
i, was_cap = is_cap) {
261 capitalize_next =
true;
262 if (!result.empty()) first_word =
false;
264 }
else if (first_word) {
269 if (!result.empty() && is_cap &&
272 result.push_back(
input[
i]);
277 }
else if (capitalize_next) {
278 capitalize_next =
false;
283 result.push_back(
input[
i]);
294 bool was_not_underscore =
false;
295 bool was_not_cap =
false;
297 result.reserve(
input.size() << 1);
299 for (
size_t i = 0;
i <
input.size(); ++
i) {
310 if (was_not_underscore &&
315 result.push_back(
'_');
318 was_not_underscore =
true;
321 result.push_back(
input[
i]);
322 was_not_underscore =
input[
i] !=
'_';
332 "google.protobuf.Timestamp",
"google.protobuf.Duration",
333 "google.protobuf.DoubleValue",
"google.protobuf.FloatValue",
334 "google.protobuf.Int64Value",
"google.protobuf.UInt64Value",
335 "google.protobuf.Int32Value",
"google.protobuf.UInt32Value",
336 "google.protobuf.BoolValue",
"google.protobuf.StringValue",
337 "google.protobuf.BytesValue",
"google.protobuf.FieldMask"};
356 return bool_string ==
"true" || bool_string ==
"false" ||
357 bool_string ==
"1" || bool_string ==
"0";
362 return field.cardinality() ==
366 "google.protobuf.MessageOptions.map_entry",
375 "google.protobuf.MessageOptions.message_set_wire_format",
false);
402 if (double_value > std::numeric_limits<float>::max() ||
403 double_value < -std::numeric_limits<float>::max()) {
407 *
value =
static_cast<float>(double_value);
struct BoolValue BoolValue
string SimpleDtoa(double value)
const google::protobuf::Field * FindJsonFieldInTypeOrNull(const google::protobuf::Type *type, StringPiece json_name)
std::string ToCamelCase(const StringPiece input)
bool IsWellKnownType(const std::string &type_name)
bool ContainsKey(const Collection &collection, const Key &key)
const StringPiece GetTypeWithoutUrl(StringPiece type_url)
string StrCat(const AlphaNum &a, const AlphaNum &b)
bool safe_strtod(const char *str, double *value)
void call_once(Args &&... args)
GLsizei const GLchar *const * string
bool SafeStrToFloat(StringPiece str, float *value)
char ascii_tolower(char c)
zend_class_entry * enum_type
std::string ToSnakeCase(StringPiece input)
const char kTypeServiceBaseUrl[]
#define T(upbtypeconst, upbtype, ctype, default_value)
static uint32_t idx(tarjan *t, const upb_refcounted *r)
void OnShutdown(void(*func)())
bool ascii_isupper(char c)
GLboolean GLboolean GLboolean b
bool IsMessageSetWireFormat(const google::protobuf::Type &type)
#define GOOGLE_ARRAYSIZE(a)
const std::string GetFullTypeWithUrl(StringPiece simple_type)
int64 GetInt64OptionOrDefault(const RepeatedPtrField< google::protobuf::Option > &options, const std::string &option_name, int64 default_value)
static const int64 kTypeUrlSize
void InitWellKnownTypes()
double GetDoubleFromAny(const google::protobuf::Any &any)
bool IsMap(const google::protobuf::Field &field, const google::protobuf::Type &type)
const google::protobuf::Option * FindOptionOrNull(const RepeatedPtrField< google::protobuf::Option > &options, const std::string &option_name)
@ Field_Cardinality_CARDINALITY_REPEATED
const google::protobuf::EnumValue * FindEnumValueByNumberOrNull(const google::protobuf::Enum *enum_type, int32 value)
double GetDoubleOptionOrDefault(const RepeatedPtrField< google::protobuf::Option > &options, const std::string &option_name, double default_value)
std::string EnumValueNameToLowerCamelCase(const StringPiece input)
string SimpleFtoa(float value)
std::set< std::string > * well_known_types_
const FieldDescriptor * field
struct StringValue StringValue
std::string GetStringFromAny(const google::protobuf::Any &any)
std::string DoubleAsString(double value)
const google::protobuf::EnumValue * FindEnumValueByNameWithoutUnderscoreOrNull(const google::protobuf::Enum *enum_type, StringPiece enum_name)
const google::protobuf::Field * FindFieldInTypeByNumberOrNull(const google::protobuf::Type *type, int32 number)
int64 GetInt64FromAny(const google::protobuf::Any &any)
std::string GetStringOptionOrDefault(const RepeatedPtrField< google::protobuf::Option > &options, const std::string &option_name, const std::string &default_value)
const google::protobuf::EnumValue * FindEnumValueByNameOrNull(const google::protobuf::Enum *enum_type, StringPiece enum_name)
void ParseFromAny(const std::string &data, T *result)
struct DoubleValue DoubleValue
bool ascii_islower(char c)
bool GetBoolOptionOrDefault(const RepeatedPtrField< google::protobuf::Option > &options, const std::string &option_name, bool default_value)
char ascii_toupper(char c)
PROTOBUF_NAMESPACE_ID::internal::once_flag well_known_types_init_
const google::protobuf::Field * FindFieldInTypeOrNull(const google::protobuf::Type *type, StringPiece field_name)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
const char * well_known_types_name_array_[]
bool GetBoolFromAny(const google::protobuf::Any &any)
std::string FloatAsString(float value)
GLsizei const GLfloat * value
void DeleteWellKnownTypes()
bool IsValidBoolString(const std::string &bool_string)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:01