Go to the documentation of this file.
110 int lastindex = proto_file.find_last_of(
".");
111 return proto_file.substr(0, lastindex);
115 if (
descriptor->options().has_csharp_namespace()) {
116 return descriptor->options().csharp_namespace();
125 int lastslash = proto_file.find_last_of(
"/");
144 bool cap_next_letter,
145 bool preserve_period) {
148 for (
int i = 0;
i <
input.size();
i++) {
150 if (cap_next_letter) {
151 result +=
input[
i] + (
'A' -
'a');
155 cap_next_letter =
false;
157 if (
i == 0 && !cap_next_letter) {
160 result +=
input[
i] + (
'a' -
'A');
165 cap_next_letter =
false;
168 cap_next_letter =
true;
170 cap_next_letter =
true;
171 if (
input[
i] ==
'.' && preserve_period) {
201 for (
int i = 0;
i <
input.size();
i++) {
230 for (
size_t i = 0;
i <
prefix.size();
i++) {
237 size_t prefix_index, value_index;
238 for (prefix_index = 0, value_index = 0;
239 prefix_index < prefix_to_match.size() && value_index <
value.size();
242 if (
value[value_index] ==
'_') {
252 if (prefix_index < prefix_to_match.size()) {
257 while (value_index <
value.size() &&
value[value_index] ==
'_') {
262 if (value_index ==
value.size()) {
266 return value.substr(value_index);
280 result =
"_" + result;
287 if (containing_type ==
NULL) {
291 if (
field !=
NULL &&
field->type() == FieldDescriptor::Type::TYPE_GROUP) {
309 classname =
name.substr(file->
package().size() + 1);
312 return "global::" + result;
317 if (!result.empty()) {
321 return "global::" + result;
363 if (property_name ==
descriptor->containing_type()->name()
364 || property_name ==
"Types"
365 || property_name ==
"Descriptor") {
366 property_name +=
"_";
368 return property_name;
373 const bool generate_directories,
376 if (!generate_directories) {
377 return relative_filename;
380 string namespace_suffix = ns;
381 if (!base_namespace.empty()) {
386 string extended_ns = ns +
".";
387 if (extended_ns.find(base_namespace +
".") != 0) {
388 *
error =
"Namespace " + ns +
" is not a prefix namespace of base namespace " + base_namespace;
391 namespace_suffix = ns.substr(base_namespace.length());
392 if (namespace_suffix.find(
".") == 0) {
393 namespace_suffix = namespace_suffix.substr(1);
397 string namespace_dir =
StringReplace(namespace_suffix,
".",
"/",
true);
398 if (!namespace_dir.empty()) {
399 namespace_dir +=
"/";
401 return namespace_dir + relative_filename;
438 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
442 size_t remaining =
input.size();
443 const unsigned char *
src = (
const unsigned char*)
input.c_str();
444 while (remaining > 2) {
475 fdp.SerializeToString(&fdp_bytes);
std::string GetFieldConstantName(const FieldDescriptor *field)
GLuint const GLchar * name
const Descriptor::ReservedRange value
std::string GetOutputFile(const FileDescriptor *descriptor, const std::string file_extension, const bool generate_directories, const std::string base_namespace, string *error)
std::string GetFileNamespace(const FileDescriptor *descriptor)
std::string StringToBase64(const std::string &input)
std::string GetFullExtensionName(const FieldDescriptor *descriptor)
std::string StripDotProto(const std::string &proto_file)
int GetFixedSize(FieldDescriptor::Type type)
CSharpType GetCSharpType(FieldDescriptor::Type type)
GLsizei const GLchar *const * string
char ascii_tolower(char c)
std::string UnderscoresToPascalCase(const std::string &input)
const std::string & package() const
std::string GetFieldName(const FieldDescriptor *descriptor)
static const char prefix[]
std::string GetReflectionClassUnqualifiedName(const FileDescriptor *descriptor)
#define GOOGLE_LOG(LEVEL)
std::string GetFileNameBase(const FileDescriptor *descriptor)
std::string GetPropertyName(const FieldDescriptor *descriptor)
const FieldDescriptor * field
uint GetGroupEndTag(const Descriptor *descriptor)
static const char base64_chars[]
std::string GetClassName(const Descriptor *descriptor)
void StringReplace(const string &s, const string &oldsub, const string &newsub, bool replace_all, string *res)
std::string ShoutyToPascalCase(const std::string &input)
std::string FileDescriptorToBase64(const FileDescriptor *descriptor)
std::string ToCSharpName(const std::string &name, const FileDescriptor *file)
bool IsNullable(const FieldDescriptor *descriptor)
const FieldDescriptor * FindFieldByName(const std::string &name) const
bool ascii_islower(char c)
bool ascii_isdigit(char c)
char ascii_toupper(char c)
bool IsWrapperType(const FieldDescriptor *descriptor)
bool ascii_isalnum(char c)
std::string TryRemovePrefix(const std::string &prefix, const std::string &value)
std::string GetExtensionClassUnqualifiedName(const FileDescriptor *descriptor)
GLsizei const GLfloat * value
std::string UnderscoresToCamelCase(const std::string &input, bool cap_next_letter, bool preserve_period)
std::string GetEnumValueName(const std::string &enum_name, const std::string &enum_value_name)
FieldGeneratorBase * CreateFieldGenerator(const FieldDescriptor *descriptor, int presenceIndex, const Options *options)
std::string GetReflectionClassName(const FileDescriptor *descriptor)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:49