#include <google/protobuf/descriptor.h>
#include <algorithm>
#include <array>
#include <functional>
#include <limits>
#include <map>
#include <memory>
#include <set>
#include <sstream>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/any.h>
#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/tokenizer.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/stubs/casts.h>
#include <google/protobuf/stubs/stringprintf.h>
#include <google/protobuf/stubs/substitute.h>
#include <google/protobuf/descriptor_database.h>
#include <google/protobuf/dynamic_message.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/io/strtod.h>
#include <google/protobuf/port.h>
#include <google/protobuf/text_format.h>
#include <google/protobuf/unknown_field_set.h>
#include <google/protobuf/stubs/map_util.h>
#include <google/protobuf/stubs/stl_util.h>
#include <google/protobuf/stubs/hash.h>
#undef PACKAGE
#include <google/protobuf/port_def.inc>
namespace google {
namespace protobuf {
namespace {
const int kPackageLimit = …;
char ToUpper(char ch) { … }
char ToLower(char ch) { … }
std::string ToCamelCase(const std::string& input, bool lower_first) { … }
std::string ToJsonName(const std::string& input) { … }
struct ExpressionEater { … };
void Fold(std::initializer_list<ExpressionEater>) { … }
template <int R>
constexpr size_t RoundUpTo(size_t n) { … }
constexpr size_t Max(size_t a, size_t b) { … }
template <typename T, typename... Ts>
constexpr size_t Max(T a, Ts... b) { … }
template <typename T>
constexpr size_t EffectiveAlignof() { … }
AppendIfAlign;
template <typename In, typename T16, typename T8, typename T4, typename T2,
typename T1>
struct TypeListSortImpl;
TypeListSortImpl<void (*)(), void (*)(T16...), void (*)(T8...), void (*)(T4...), void (*)(T2...), void (*)(T1...)>;
TypeListSortImpl<void (*)(First, Rest...), void (*)(T16...), void (*)(T8...), void (*)(T4...), void (*)(T2...), void (*)(T1...)>;
SortByAlignment;
template <template <typename...> class C, typename... T>
auto ApplyTypeList(void (*)(T...)) -> C<T...>;
template <typename T>
constexpr int FindTypeIndex() { … }
template <typename T, typename T1, typename... Ts>
constexpr int FindTypeIndex() { … }
template <template <typename> class ValueT, typename... Keys>
class TypeMap { … };
IntT;
PointerT;
template <typename... T>
class FlatAllocation { … };
template <typename... T>
TypeMap<IntT, T...> CalculateEnds(const TypeMap<IntT, T...>& sizes) { … }
template <typename... T>
class FlatAllocatorImpl { … };
}
class Symbol { … };
const FieldDescriptor::CppType
FieldDescriptor::kTypeToCppTypeMap[MAX_TYPE + 1] = …;
const char* const FieldDescriptor::kTypeToName[MAX_TYPE + 1] = …;
const char* const FieldDescriptor::kCppTypeToName[MAX_CPPTYPE + 1] = …;
const char* const FieldDescriptor::kLabelToName[MAX_LABEL + 1] = …;
const char* FileDescriptor::SyntaxName(FileDescriptor::Syntax syntax) { … }
static const char* const kNonLinkedWeakMessageReplacementName = …;
#if !defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)
const int FieldDescriptor::kMaxNumber;
const int FieldDescriptor::kFirstReservedNumber;
const int FieldDescriptor::kLastReservedNumber;
#endif
namespace {
std::string EnumValueToPascalCase(const std::string& input) { … }
class PrefixRemover { … };
PointerStringPair;
DescriptorIntPair;
#define HASH_MAP …
#define HASH_SET …
#define HASH_FXN …
template <typename PairType>
struct PointerIntegerPairHash { … };
struct PointerStringPairHash { … };
struct SymbolByFullNameHash { … };
struct SymbolByFullNameEq { … };
SymbolsByNameSet;
struct SymbolByParentHash { … };
struct SymbolByParentEq { … };
SymbolsByParentSet;
FilesByNameMap;
FieldsByNameMap;
struct FieldsByNumberHash { … };
struct FieldsByNumberEq { … };
FieldsByNumberSet;
EnumValuesByNumberSet;
ExtensionsGroupedByDescriptorMap;
LocationsByPathMap;
std::set<std::string>* NewAllowedProto3Extendee() { … }
bool AllowedExtendeeInProto3(const std::string& name) { … }
}
class FileDescriptorTables { … };
namespace internal {
class FlatAllocator
: public decltype(ApplyTypeList<FlatAllocatorImpl>(
SortByAlignment<char, std::string, SourceCodeInfo,
FileDescriptorTables,
MessageOptions, FieldOptions, EnumOptions,
EnumValueOptions, ExtensionRangeOptions, OneofOptions,
ServiceOptions, MethodOptions, FileOptions>())) { … };
}
class DescriptorPool::Tables { … };
DescriptorPool::Tables::Tables() { … }
DescriptorPool::Tables::~Tables() { … }
FileDescriptorTables::FileDescriptorTables() { … }
FileDescriptorTables::~FileDescriptorTables() { … }
inline const FileDescriptorTables& FileDescriptorTables::GetEmptyInstance() { … }
void DescriptorPool::Tables::AddCheckpoint() { … }
void DescriptorPool::Tables::ClearLastCheckpoint() { … }
void DescriptorPool::Tables::RollbackToLastCheckpoint() { … }
inline Symbol DescriptorPool::Tables::FindSymbol(StringPiece key) const { … }
inline Symbol FileDescriptorTables::FindNestedSymbol(
const void* parent, StringPiece name) const { … }
Symbol DescriptorPool::Tables::FindByNameHelper(const DescriptorPool* pool,
StringPiece name) { … }
inline const FileDescriptor* DescriptorPool::Tables::FindFile(
StringPiece key) const { … }
inline const FieldDescriptor* FileDescriptorTables::FindFieldByNumber(
const Descriptor* parent, int number) const { … }
const void* FileDescriptorTables::FindParentForFieldsByMap(
const FieldDescriptor* field) const { … }
void FileDescriptorTables::FieldsByLowercaseNamesLazyInitStatic(
const FileDescriptorTables* tables) { … }
void FileDescriptorTables::FieldsByLowercaseNamesLazyInitInternal() const { … }
inline const FieldDescriptor* FileDescriptorTables::FindFieldByLowercaseName(
const void* parent, StringPiece lowercase_name) const { … }
void FileDescriptorTables::FieldsByCamelcaseNamesLazyInitStatic(
const FileDescriptorTables* tables) { … }
void FileDescriptorTables::FieldsByCamelcaseNamesLazyInitInternal() const { … }
inline const FieldDescriptor* FileDescriptorTables::FindFieldByCamelcaseName(
const void* parent, StringPiece camelcase_name) const { … }
inline const EnumValueDescriptor* FileDescriptorTables::FindEnumValueByNumber(
const EnumDescriptor* parent, int number) const { … }
inline const EnumValueDescriptor*
FileDescriptorTables::FindEnumValueByNumberCreatingIfUnknown(
const EnumDescriptor* parent, int number) const { … }
inline const FieldDescriptor* DescriptorPool::Tables::FindExtension(
const Descriptor* extendee, int number) const { … }
inline void DescriptorPool::Tables::FindAllExtensions(
const Descriptor* extendee,
std::vector<const FieldDescriptor*>* out) const { … }
bool DescriptorPool::Tables::AddSymbol(const std::string& full_name,
Symbol symbol) { … }
bool FileDescriptorTables::AddAliasUnderParent(const void* parent,
const std::string& name,
Symbol symbol) { … }
bool DescriptorPool::Tables::AddFile(const FileDescriptor* file) { … }
void FileDescriptorTables::FinalizeTables() { … }
bool FileDescriptorTables::AddFieldByNumber(FieldDescriptor* field) { … }
bool FileDescriptorTables::AddEnumValueByNumber(EnumValueDescriptor* value) { … }
bool DescriptorPool::Tables::AddExtension(const FieldDescriptor* field) { … }
template <typename Type>
Type* DescriptorPool::Tables::Allocate() { … }
void* DescriptorPool::Tables::AllocateBytes(int size) { … }
template <typename... T>
internal::FlatAllocator::Allocation* DescriptorPool::Tables::CreateFlatAlloc(
const TypeMap<IntT, T...>& sizes) { … }
void FileDescriptorTables::BuildLocationsByPath(
std::pair<const FileDescriptorTables*, const SourceCodeInfo*>* p) { … }
const SourceCodeInfo_Location* FileDescriptorTables::GetSourceLocation(
const std::vector<int>& path, const SourceCodeInfo* info) const { … }
DescriptorPool::ErrorCollector::~ErrorCollector() { … }
DescriptorPool::DescriptorPool()
: … { … }
DescriptorPool::DescriptorPool(DescriptorDatabase* fallback_database,
ErrorCollector* error_collector)
: … { … }
DescriptorPool::DescriptorPool(const DescriptorPool* underlay)
: … { … }
DescriptorPool::~DescriptorPool() { … }
void DescriptorPool::InternalDontEnforceDependencies() { … }
void DescriptorPool::AddUnusedImportTrackFile(ConstStringParam file_name,
bool is_error) { … }
void DescriptorPool::ClearUnusedImportTrackFiles() { … }
bool DescriptorPool::InternalIsFileLoaded(ConstStringParam filename) const { … }
namespace {
EncodedDescriptorDatabase* GeneratedDatabase() { … }
DescriptorPool* NewGeneratedPool() { … }
}
DescriptorDatabase* DescriptorPool::internal_generated_database() { … }
DescriptorPool* DescriptorPool::internal_generated_pool() { … }
const DescriptorPool* DescriptorPool::generated_pool() { … }
void DescriptorPool::InternalAddGeneratedFile(
const void* encoded_file_descriptor, int size) { … }
const FileDescriptor* DescriptorPool::FindFileByName(
ConstStringParam name) const { … }
const FileDescriptor* DescriptorPool::FindFileContainingSymbol(
ConstStringParam symbol_name) const { … }
const Descriptor* DescriptorPool::FindMessageTypeByName(
ConstStringParam name) const { … }
const FieldDescriptor* DescriptorPool::FindFieldByName(
ConstStringParam name) const { … }
const FieldDescriptor* DescriptorPool::FindExtensionByName(
ConstStringParam name) const { … }
const OneofDescriptor* DescriptorPool::FindOneofByName(
ConstStringParam name) const { … }
const EnumDescriptor* DescriptorPool::FindEnumTypeByName(
ConstStringParam name) const { … }
const EnumValueDescriptor* DescriptorPool::FindEnumValueByName(
ConstStringParam name) const { … }
const ServiceDescriptor* DescriptorPool::FindServiceByName(
ConstStringParam name) const { … }
const MethodDescriptor* DescriptorPool::FindMethodByName(
ConstStringParam name) const { … }
const FieldDescriptor* DescriptorPool::FindExtensionByNumber(
const Descriptor* extendee, int number) const { … }
const FieldDescriptor* DescriptorPool::InternalFindExtensionByNumberNoLock(
const Descriptor* extendee, int number) const { … }
const FieldDescriptor* DescriptorPool::FindExtensionByPrintableName(
const Descriptor* extendee, ConstStringParam printable_name) const { … }
void DescriptorPool::FindAllExtensions(
const Descriptor* extendee,
std::vector<const FieldDescriptor*>* out) const { … }
const FieldDescriptor* Descriptor::FindFieldByNumber(int key) const { … }
const FieldDescriptor* Descriptor::FindFieldByLowercaseName(
ConstStringParam key) const { … }
const FieldDescriptor* Descriptor::FindFieldByCamelcaseName(
ConstStringParam key) const { … }
const FieldDescriptor* Descriptor::FindFieldByName(ConstStringParam key) const { … }
const OneofDescriptor* Descriptor::FindOneofByName(ConstStringParam key) const { … }
const FieldDescriptor* Descriptor::FindExtensionByName(
ConstStringParam key) const { … }
const FieldDescriptor* Descriptor::FindExtensionByLowercaseName(
ConstStringParam key) const { … }
const FieldDescriptor* Descriptor::FindExtensionByCamelcaseName(
ConstStringParam key) const { … }
const Descriptor* Descriptor::FindNestedTypeByName(ConstStringParam key) const { … }
const EnumDescriptor* Descriptor::FindEnumTypeByName(
ConstStringParam key) const { … }
const EnumValueDescriptor* Descriptor::FindEnumValueByName(
ConstStringParam key) const { … }
const FieldDescriptor* Descriptor::map_key() const { … }
const FieldDescriptor* Descriptor::map_value() const { … }
const EnumValueDescriptor* EnumDescriptor::FindValueByName(
ConstStringParam key) const { … }
const EnumValueDescriptor* EnumDescriptor::FindValueByNumber(int key) const { … }
const EnumValueDescriptor* EnumDescriptor::FindValueByNumberCreatingIfUnknown(
int key) const { … }
const MethodDescriptor* ServiceDescriptor::FindMethodByName(
ConstStringParam key) const { … }
const Descriptor* FileDescriptor::FindMessageTypeByName(
ConstStringParam key) const { … }
const EnumDescriptor* FileDescriptor::FindEnumTypeByName(
ConstStringParam key) const { … }
const EnumValueDescriptor* FileDescriptor::FindEnumValueByName(
ConstStringParam key) const { … }
const ServiceDescriptor* FileDescriptor::FindServiceByName(
ConstStringParam key) const { … }
const FieldDescriptor* FileDescriptor::FindExtensionByName(
ConstStringParam key) const { … }
const FieldDescriptor* FileDescriptor::FindExtensionByLowercaseName(
ConstStringParam key) const { … }
const FieldDescriptor* FileDescriptor::FindExtensionByCamelcaseName(
ConstStringParam key) const { … }
void Descriptor::ExtensionRange::CopyTo(
DescriptorProto_ExtensionRange* proto) const { … }
const Descriptor::ExtensionRange*
Descriptor::FindExtensionRangeContainingNumber(int number) const { … }
const Descriptor::ReservedRange* Descriptor::FindReservedRangeContainingNumber(
int number) const { … }
const EnumDescriptor::ReservedRange*
EnumDescriptor::FindReservedRangeContainingNumber(int number) const { … }
bool DescriptorPool::TryFindFileInFallbackDatabase(
StringPiece name) const { … }
bool DescriptorPool::IsSubSymbolOfBuiltType(StringPiece name) const { … }
bool DescriptorPool::TryFindSymbolInFallbackDatabase(
StringPiece name) const { … }
bool DescriptorPool::TryFindExtensionInFallbackDatabase(
const Descriptor* containing_type, int field_number) const { … }
bool FieldDescriptor::is_map_message_type() const { … }
std::string FieldDescriptor::DefaultValueAsString(
bool quote_string_type) const { … }
void FileDescriptor::CopyTo(FileDescriptorProto* proto) const { … }
void FileDescriptor::CopyJsonNameTo(FileDescriptorProto* proto) const { … }
void FileDescriptor::CopySourceCodeInfoTo(FileDescriptorProto* proto) const { … }
void Descriptor::CopyTo(DescriptorProto* proto) const { … }
void Descriptor::CopyJsonNameTo(DescriptorProto* proto) const { … }
void FieldDescriptor::CopyTo(FieldDescriptorProto* proto) const { … }
void FieldDescriptor::CopyJsonNameTo(FieldDescriptorProto* proto) const { … }
void OneofDescriptor::CopyTo(OneofDescriptorProto* proto) const { … }
void EnumDescriptor::CopyTo(EnumDescriptorProto* proto) const { … }
void EnumValueDescriptor::CopyTo(EnumValueDescriptorProto* proto) const { … }
void ServiceDescriptor::CopyTo(ServiceDescriptorProto* proto) const { … }
void MethodDescriptor::CopyTo(MethodDescriptorProto* proto) const { … }
namespace {
bool RetrieveOptionsAssumingRightPool(
int depth, const Message& options,
std::vector<std::string>* option_entries) { … }
bool RetrieveOptions(int depth, const Message& options,
const DescriptorPool* pool,
std::vector<std::string>* option_entries) { … }
bool FormatBracketedOptions(int depth, const Message& options,
const DescriptorPool* pool, std::string* output) { … }
bool FormatLineOptions(int depth, const Message& options,
const DescriptorPool* pool, std::string* output) { … }
class SourceLocationCommentPrinter { … };
}
std::string FileDescriptor::DebugString() const { … }
std::string FileDescriptor::DebugStringWithOptions(
const DebugStringOptions& debug_string_options) const { … }
std::string Descriptor::DebugString() const { … }
std::string Descriptor::DebugStringWithOptions(
const DebugStringOptions& options) const { … }
void Descriptor::DebugString(int depth, std::string* contents,
const DebugStringOptions& debug_string_options,
bool include_opening_clause) const { … }
std::string FieldDescriptor::DebugString() const { … }
std::string FieldDescriptor::DebugStringWithOptions(
const DebugStringOptions& debug_string_options) const { … }
std::string FieldDescriptor::FieldTypeNameDebugString() const { … }
void FieldDescriptor::DebugString(
int depth, std::string* contents,
const DebugStringOptions& debug_string_options) const { … }
std::string OneofDescriptor::DebugString() const { … }
std::string OneofDescriptor::DebugStringWithOptions(
const DebugStringOptions& options) const { … }
void OneofDescriptor::DebugString(
int depth, std::string* contents,
const DebugStringOptions& debug_string_options) const { … }
std::string EnumDescriptor::DebugString() const { … }
std::string EnumDescriptor::DebugStringWithOptions(
const DebugStringOptions& options) const { … }
void EnumDescriptor::DebugString(
int depth, std::string* contents,
const DebugStringOptions& debug_string_options) const { … }
std::string EnumValueDescriptor::DebugString() const { … }
std::string EnumValueDescriptor::DebugStringWithOptions(
const DebugStringOptions& options) const { … }
void EnumValueDescriptor::DebugString(
int depth, std::string* contents,
const DebugStringOptions& debug_string_options) const { … }
std::string ServiceDescriptor::DebugString() const { … }
std::string ServiceDescriptor::DebugStringWithOptions(
const DebugStringOptions& options) const { … }
void ServiceDescriptor::DebugString(
std::string* contents,
const DebugStringOptions& debug_string_options) const { … }
std::string MethodDescriptor::DebugString() const { … }
std::string MethodDescriptor::DebugStringWithOptions(
const DebugStringOptions& options) const { … }
void MethodDescriptor::DebugString(
int depth, std::string* contents,
const DebugStringOptions& debug_string_options) const { … }
bool FileDescriptor::GetSourceLocation(const std::vector<int>& path,
SourceLocation* out_location) const { … }
bool FileDescriptor::GetSourceLocation(SourceLocation* out_location) const { … }
bool FieldDescriptor::is_packed() const { … }
bool Descriptor::GetSourceLocation(SourceLocation* out_location) const { … }
bool FieldDescriptor::GetSourceLocation(SourceLocation* out_location) const { … }
bool OneofDescriptor::GetSourceLocation(SourceLocation* out_location) const { … }
bool EnumDescriptor::GetSourceLocation(SourceLocation* out_location) const { … }
bool MethodDescriptor::GetSourceLocation(SourceLocation* out_location) const { … }
bool ServiceDescriptor::GetSourceLocation(SourceLocation* out_location) const { … }
bool EnumValueDescriptor::GetSourceLocation(
SourceLocation* out_location) const { … }
void Descriptor::GetLocationPath(std::vector<int>* output) const { … }
void FieldDescriptor::GetLocationPath(std::vector<int>* output) const { … }
void OneofDescriptor::GetLocationPath(std::vector<int>* output) const { … }
void EnumDescriptor::GetLocationPath(std::vector<int>* output) const { … }
void EnumValueDescriptor::GetLocationPath(std::vector<int>* output) const { … }
void ServiceDescriptor::GetLocationPath(std::vector<int>* output) const { … }
void MethodDescriptor::GetLocationPath(std::vector<int>* output) const { … }
namespace {
struct OptionsToInterpret { … };
}
class DescriptorBuilder { … };
const FileDescriptor* DescriptorPool::BuildFile(
const FileDescriptorProto& proto) { … }
const FileDescriptor* DescriptorPool::BuildFileCollectingErrors(
const FileDescriptorProto& proto, ErrorCollector* error_collector) { … }
const FileDescriptor* DescriptorPool::BuildFileFromDatabase(
const FileDescriptorProto& proto) const { … }
DescriptorBuilder::DescriptorBuilder(
const DescriptorPool* pool, DescriptorPool::Tables* tables,
DescriptorPool::ErrorCollector* error_collector)
: … { … }
DescriptorBuilder::~DescriptorBuilder() { … }
void DescriptorBuilder::AddError(
const std::string& element_name, const Message& descriptor,
DescriptorPool::ErrorCollector::ErrorLocation location,
const std::string& error) { … }
void DescriptorBuilder::AddError(
const std::string& element_name, const Message& descriptor,
DescriptorPool::ErrorCollector::ErrorLocation location, const char* error) { … }
void DescriptorBuilder::AddNotDefinedError(
const std::string& element_name, const Message& descriptor,
DescriptorPool::ErrorCollector::ErrorLocation location,
const std::string& undefined_symbol) { … }
void DescriptorBuilder::AddWarning(
const std::string& element_name, const Message& descriptor,
DescriptorPool::ErrorCollector::ErrorLocation location,
const std::string& error) { … }
bool DescriptorBuilder::IsInPackage(const FileDescriptor* file,
const std::string& package_name) { … }
void DescriptorBuilder::RecordPublicDependencies(const FileDescriptor* file) { … }
Symbol DescriptorBuilder::FindSymbolNotEnforcingDepsHelper(
const DescriptorPool* pool, const std::string& name, bool build_it) { … }
Symbol DescriptorBuilder::FindSymbolNotEnforcingDeps(const std::string& name,
bool build_it) { … }
Symbol DescriptorBuilder::FindSymbol(const std::string& name, bool build_it) { … }
Symbol DescriptorBuilder::LookupSymbolNoPlaceholder(
const std::string& name, const std::string& relative_to,
ResolveMode resolve_mode, bool build_it) { … }
Symbol DescriptorBuilder::LookupSymbol(
const std::string& name, const std::string& relative_to,
DescriptorPool::PlaceholderType placeholder_type, ResolveMode resolve_mode,
bool build_it) { … }
static bool ValidateQualifiedName(StringPiece name) { … }
Symbol DescriptorPool::NewPlaceholder(StringPiece name,
PlaceholderType placeholder_type) const { … }
Symbol DescriptorPool::NewPlaceholderWithMutexHeld(
StringPiece name, PlaceholderType placeholder_type) const { … }
FileDescriptor* DescriptorPool::NewPlaceholderFile(
StringPiece name) const { … }
FileDescriptor* DescriptorPool::NewPlaceholderFileWithMutexHeld(
StringPiece name, internal::FlatAllocator& alloc) const { … }
bool DescriptorBuilder::AddSymbol(const std::string& full_name,
const void* parent, const std::string& name,
const Message& proto, Symbol symbol) { … }
void DescriptorBuilder::AddPackage(const std::string& name,
const Message& proto, FileDescriptor* file) { … }
void DescriptorBuilder::ValidateSymbolName(const std::string& name,
const std::string& full_name,
const Message& proto) { … }
template <class DescriptorT>
void DescriptorBuilder::AllocateOptions(
const typename DescriptorT::OptionsType& orig_options,
DescriptorT* descriptor, int options_field_tag,
const std::string& option_name, internal::FlatAllocator& alloc) { … }
void DescriptorBuilder::AllocateOptions(const FileOptions& orig_options,
FileDescriptor* descriptor,
internal::FlatAllocator& alloc) { … }
template <class DescriptorT>
void DescriptorBuilder::AllocateOptionsImpl(
const std::string& name_scope, const std::string& element_name,
const typename DescriptorT::OptionsType& orig_options,
DescriptorT* descriptor, const std::vector<int>& options_path,
const std::string& option_name, internal::FlatAllocator& alloc) { … }
#define BUILD_ARRAY …
void DescriptorBuilder::AddRecursiveImportError(
const FileDescriptorProto& proto, int from_here) { … }
void DescriptorBuilder::AddTwiceListedError(const FileDescriptorProto& proto,
int index) { … }
void DescriptorBuilder::AddImportError(const FileDescriptorProto& proto,
int index) { … }
static bool ExistingFileMatchesProto(const FileDescriptor* existing_file,
const FileDescriptorProto& proto) { … }
static void PlanAllocationSize(
const RepeatedPtrField<EnumValueDescriptorProto>& values,
internal::FlatAllocator& alloc) { … }
static void PlanAllocationSize(
const RepeatedPtrField<EnumDescriptorProto>& enums,
internal::FlatAllocator& alloc) { … }
static void PlanAllocationSize(
const RepeatedPtrField<OneofDescriptorProto>& oneofs,
internal::FlatAllocator& alloc) { … }
static void PlanAllocationSize(
const RepeatedPtrField<FieldDescriptorProto>& fields,
internal::FlatAllocator& alloc) { … }
static void PlanAllocationSize(
const RepeatedPtrField<DescriptorProto::ExtensionRange>& ranges,
internal::FlatAllocator& alloc) { … }
static void PlanAllocationSize(
const RepeatedPtrField<DescriptorProto>& messages,
internal::FlatAllocator& alloc) { … }
static void PlanAllocationSize(
const RepeatedPtrField<MethodDescriptorProto>& methods,
internal::FlatAllocator& alloc) { … }
static void PlanAllocationSize(
const RepeatedPtrField<ServiceDescriptorProto>& services,
internal::FlatAllocator& alloc) { … }
static void PlanAllocationSize(const FileDescriptorProto& proto,
internal::FlatAllocator& alloc) { … }
const FileDescriptor* DescriptorBuilder::BuildFile(
const FileDescriptorProto& proto) { … }
FileDescriptor* DescriptorBuilder::BuildFileImpl(
const FileDescriptorProto& proto, internal::FlatAllocator& alloc) { … }
const std::string* DescriptorBuilder::AllocateNameStrings(
const std::string& scope, const std::string& proto_name,
internal::FlatAllocator& alloc) { … }
namespace {
struct IncrementWhenDestroyed { … };
}
void DescriptorBuilder::BuildMessage(const DescriptorProto& proto,
const Descriptor* parent,
Descriptor* result,
internal::FlatAllocator& alloc) { … }
void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto,
Descriptor* parent,
FieldDescriptor* result,
bool is_extension,
internal::FlatAllocator& alloc) { … }
void DescriptorBuilder::BuildExtensionRange(
const DescriptorProto::ExtensionRange& proto, const Descriptor* parent,
Descriptor::ExtensionRange* result, internal::FlatAllocator& alloc) { … }
void DescriptorBuilder::BuildReservedRange(
const DescriptorProto::ReservedRange& proto, const Descriptor* parent,
Descriptor::ReservedRange* result, internal::FlatAllocator&) { … }
void DescriptorBuilder::BuildReservedRange(
const EnumDescriptorProto::EnumReservedRange& proto,
const EnumDescriptor* parent, EnumDescriptor::ReservedRange* result,
internal::FlatAllocator&) { … }
void DescriptorBuilder::BuildOneof(const OneofDescriptorProto& proto,
Descriptor* parent, OneofDescriptor* result,
internal::FlatAllocator& alloc) { … }
void DescriptorBuilder::CheckEnumValueUniqueness(
const EnumDescriptorProto& proto, const EnumDescriptor* result) { … }
void DescriptorBuilder::BuildEnum(const EnumDescriptorProto& proto,
const Descriptor* parent,
EnumDescriptor* result,
internal::FlatAllocator& alloc) { … }
void DescriptorBuilder::BuildEnumValue(const EnumValueDescriptorProto& proto,
const EnumDescriptor* parent,
EnumValueDescriptor* result,
internal::FlatAllocator& alloc) { … }
void DescriptorBuilder::BuildService(const ServiceDescriptorProto& proto,
const void* ,
ServiceDescriptor* result,
internal::FlatAllocator& alloc) { … }
void DescriptorBuilder::BuildMethod(const MethodDescriptorProto& proto,
const ServiceDescriptor* parent,
MethodDescriptor* result,
internal::FlatAllocator& alloc) { … }
#undef BUILD_ARRAY
void DescriptorBuilder::CrossLinkFile(FileDescriptor* file,
const FileDescriptorProto& proto) { … }
void DescriptorBuilder::CrossLinkMessage(Descriptor* message,
const DescriptorProto& proto) { … }
void DescriptorBuilder::CrossLinkExtensionRange(
Descriptor::ExtensionRange* range,
const DescriptorProto::ExtensionRange& ) { … }
void DescriptorBuilder::CrossLinkField(FieldDescriptor* field,
const FieldDescriptorProto& proto) { … }
void DescriptorBuilder::CrossLinkEnum(EnumDescriptor* enum_type,
const EnumDescriptorProto& proto) { … }
void DescriptorBuilder::CrossLinkEnumValue(
EnumValueDescriptor* enum_value,
const EnumValueDescriptorProto& ) { … }
void DescriptorBuilder::CrossLinkService(ServiceDescriptor* service,
const ServiceDescriptorProto& proto) { … }
void DescriptorBuilder::CrossLinkMethod(MethodDescriptor* method,
const MethodDescriptorProto& proto) { … }
void DescriptorBuilder::SuggestFieldNumbers(FileDescriptor* file,
const FileDescriptorProto& proto) { … }
#define VALIDATE_OPTIONS_FROM_ARRAY …
static bool IsLite(const FileDescriptor* file) { … }
void DescriptorBuilder::ValidateFileOptions(FileDescriptor* file,
const FileDescriptorProto& proto) { … }
void DescriptorBuilder::ValidateProto3(FileDescriptor* file,
const FileDescriptorProto& proto) { … }
static std::string ToLowercaseWithoutUnderscores(const std::string& name) { … }
void DescriptorBuilder::ValidateProto3Message(Descriptor* message,
const DescriptorProto& proto) { … }
void DescriptorBuilder::ValidateProto3Field(FieldDescriptor* field,
const FieldDescriptorProto& proto) { … }
void DescriptorBuilder::ValidateProto3Enum(EnumDescriptor* enm,
const EnumDescriptorProto& proto) { … }
void DescriptorBuilder::ValidateMessageOptions(Descriptor* message,
const DescriptorProto& proto) { … }
void DescriptorBuilder::ValidateFieldOptions(
FieldDescriptor* field, const FieldDescriptorProto& proto) { … }
void DescriptorBuilder::ValidateEnumOptions(EnumDescriptor* enm,
const EnumDescriptorProto& proto) { … }
void DescriptorBuilder::ValidateEnumValueOptions(
EnumValueDescriptor* ,
const EnumValueDescriptorProto& ) { … }
void DescriptorBuilder::ValidateExtensionRangeOptions(
const std::string& full_name, Descriptor::ExtensionRange* extension_range,
const DescriptorProto_ExtensionRange& proto) { … }
void DescriptorBuilder::ValidateServiceOptions(
ServiceDescriptor* service, const ServiceDescriptorProto& proto) { … }
void DescriptorBuilder::ValidateMethodOptions(
MethodDescriptor* , const MethodDescriptorProto& ) { … }
bool DescriptorBuilder::ValidateMapEntry(FieldDescriptor* field,
const FieldDescriptorProto& proto) { … }
void DescriptorBuilder::DetectMapConflicts(const Descriptor* message,
const DescriptorProto& proto) { … }
void DescriptorBuilder::ValidateJSType(FieldDescriptor* field,
const FieldDescriptorProto& proto) { … }
#undef VALIDATE_OPTIONS_FROM_ARRAY
DescriptorBuilder::OptionInterpreter::OptionInterpreter(
DescriptorBuilder* builder)
: … { … }
DescriptorBuilder::OptionInterpreter::~OptionInterpreter() { … }
bool DescriptorBuilder::OptionInterpreter::InterpretOptions(
OptionsToInterpret* options_to_interpret) { … }
bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption(
Message* options, const std::vector<int>& src_path,
const std::vector<int>& options_path) { … }
void DescriptorBuilder::OptionInterpreter::UpdateSourceCodeInfo(
SourceCodeInfo* info) { … }
void DescriptorBuilder::OptionInterpreter::AddWithoutInterpreting(
const UninterpretedOption& uninterpreted_option, Message* options) { … }
bool DescriptorBuilder::OptionInterpreter::ExamineIfOptionIsSet(
std::vector<const FieldDescriptor*>::const_iterator
intermediate_fields_iter,
std::vector<const FieldDescriptor*>::const_iterator intermediate_fields_end,
const FieldDescriptor* innermost_field, const std::string& debug_msg_name,
const UnknownFieldSet& unknown_fields) { … }
bool DescriptorBuilder::OptionInterpreter::SetOptionValue(
const FieldDescriptor* option_field, UnknownFieldSet* unknown_fields) { … }
class DescriptorBuilder::OptionInterpreter::AggregateOptionFinder
: public TextFormat::Finder { … };
namespace {
class AggregateErrorCollector : public io::ErrorCollector { … };
}
bool DescriptorBuilder::OptionInterpreter::SetAggregateOption(
const FieldDescriptor* option_field, UnknownFieldSet* unknown_fields) { … }
void DescriptorBuilder::OptionInterpreter::SetInt32(
int number, int32_t value, FieldDescriptor::Type type,
UnknownFieldSet* unknown_fields) { … }
void DescriptorBuilder::OptionInterpreter::SetInt64(
int number, int64_t value, FieldDescriptor::Type type,
UnknownFieldSet* unknown_fields) { … }
void DescriptorBuilder::OptionInterpreter::SetUInt32(
int number, uint32_t value, FieldDescriptor::Type type,
UnknownFieldSet* unknown_fields) { … }
void DescriptorBuilder::OptionInterpreter::SetUInt64(
int number, uint64_t value, FieldDescriptor::Type type,
UnknownFieldSet* unknown_fields) { … }
void DescriptorBuilder::LogUnusedDependency(const FileDescriptorProto& proto,
const FileDescriptor* result) { … }
Symbol DescriptorPool::CrossLinkOnDemandHelper(StringPiece name,
bool expecting_enum) const { … }
void FieldDescriptor::InternalTypeOnceInit() const { … }
void FieldDescriptor::TypeOnceInit(const FieldDescriptor* to_init) { … }
const Descriptor* FieldDescriptor::message_type() const { … }
const EnumDescriptor* FieldDescriptor::enum_type() const { … }
const EnumValueDescriptor* FieldDescriptor::default_value_enum() const { … }
const std::string& FieldDescriptor::PrintableNameForExtension() const { … }
void FileDescriptor::InternalDependenciesOnceInit() const { … }
void FileDescriptor::DependenciesOnceInit(const FileDescriptor* to_init) { … }
const FileDescriptor* FileDescriptor::dependency(int index) const { … }
const Descriptor* MethodDescriptor::input_type() const { … }
const Descriptor* MethodDescriptor::output_type() const { … }
namespace internal {
void LazyDescriptor::Set(const Descriptor* descriptor) { … }
void LazyDescriptor::SetLazy(StringPiece name,
const FileDescriptor* file) { … }
void LazyDescriptor::Once(const ServiceDescriptor* service) { … }
}
}
}
#include <google/protobuf/port_undef.inc>