#include <algorithm>
#include <cmath>
#include <iostream>
#include <list>
#include <string>
#include <utility>
#include "flatbuffers/base.h"
#include "flatbuffers/buffer.h"
#include "flatbuffers/idl.h"
#include "flatbuffers/reflection_generated.h"
#include "flatbuffers/util.h"
namespace flatbuffers {
const char *FLATBUFFERS_VERSION() { … }
namespace {
static const double kPi = …;
static_assert …;
#define ECHECK(call) …
#define NEXT() …
#define EXPECT(tok) …
static bool ValidateUTF8(const std::string &str) { … }
static bool IsLowerSnakeCase(const std::string &str) { … }
static void DeserializeDoc(std::vector<std::string> &doc,
const Vector<Offset<String>> *documentation) { … }
static CheckedError NoError() { … }
template<typename T> static std::string TypeToIntervalString() { … }
template<typename T>
static bool atot_scalar(const char *s, T *val, bool_constant<false>) { … }
template<typename T>
static bool atot_scalar(const char *s, T *val, bool_constant<true>) { … }
template<typename T>
static CheckedError atot(const char *s, Parser &parser, T *val) { … }
template<>
CheckedError atot<Offset<void>>(const char *s, Parser &parser,
Offset<void> *val) { … }
template<>
CheckedError atot<Offset64<void>>(const char *s, Parser &parser,
Offset64<void> *val) { … }
template<typename T>
static T *LookupTableByName(const SymbolTable<T> &table,
const std::string &name,
const Namespace ¤t_namespace,
size_t skip_top) { … }
#define FLATBUFFERS_GEN_TOKENS(TD) …
#ifdef __GNUC__
__extension__
#endif
enum { … };
static std::string TokenToString(int t) { … }
static bool IsIdentifierStart(char c) { … }
static bool CompareSerializedScalars(const uint8_t *a, const uint8_t *b,
const FieldDef &key) { … }
static bool CompareTablesByScalarKey(const Offset<Table> *_a,
const Offset<Table> *_b,
const FieldDef &key) { … }
static bool CompareTablesByStringKey(const Offset<Table> *_a,
const Offset<Table> *_b,
const FieldDef &key) { … }
static void SwapSerializedTables(Offset<Table> *a, Offset<Table> *b) { … }
template<typename T, typename F, typename S>
static void SimpleQsort(T *begin, T *end, size_t width, F comparator,
S swapper) { … }
template<typename T> static inline void SingleValueRepack(Value &e, T val) { … }
#if defined(FLATBUFFERS_HAS_NEW_STRTOD) && (FLATBUFFERS_HAS_NEW_STRTOD > 0)
static void SingleValueRepack(Value &e, float val) { … }
static void SingleValueRepack(Value &e, double val) { … }
#endif
template<typename T> static uint64_t EnumDistanceImpl(T e1, T e2) { … }
static bool compareFieldDefs(const FieldDef *a, const FieldDef *b) { … }
static Namespace *GetNamespace(
const std::string &qualified_name, std::vector<Namespace *> &namespaces,
std::map<std::string, Namespace *> &namespaces_index) { … }
static uint64_t HashFile(const char *source_filename, const char *source) { … }
template<typename T> static bool compareName(const T *a, const T *b) { … }
template<typename T> static void AssignIndices(const std::vector<T *> &defvec) { … }
}
void Parser::Message(const std::string &msg) { … }
void Parser::Warning(const std::string &msg) { … }
CheckedError Parser::Error(const std::string &msg) { … }
CheckedError Parser::RecurseError() { … }
const std::string &Parser::GetPooledString(const std::string &s) const { … }
class Parser::ParseDepthGuard { … };
std::string Namespace::GetFullyQualifiedName(const std::string &name,
size_t max_components) const { … }
std::string Parser::TokenToStringId(int t) const { … }
CheckedError Parser::ParseHexNum(int nibbles, uint64_t *val) { … }
CheckedError Parser::SkipByteOrderMark() { … }
CheckedError Parser::Next() { … }
bool Parser::Is(int t) const { … }
bool Parser::IsIdent(const char *id) const { … }
CheckedError Parser::Expect(int t) { … }
CheckedError Parser::ParseNamespacing(std::string *id, std::string *last) { … }
EnumDef *Parser::LookupEnum(const std::string &id) { … }
StructDef *Parser::LookupStruct(const std::string &id) const { … }
StructDef *Parser::LookupStructThruParentNamespaces(
const std::string &id) const { … }
CheckedError Parser::ParseTypeIdent(Type &type) { … }
CheckedError Parser::ParseType(Type &type) { … }
CheckedError Parser::AddField(StructDef &struct_def, const std::string &name,
const Type &type, FieldDef **dest) { … }
CheckedError Parser::ParseField(StructDef &struct_def) { … }
CheckedError Parser::ParseString(Value &val, bool use_string_pooling) { … }
CheckedError Parser::ParseComma() { … }
CheckedError Parser::ParseAnyValue(Value &val, FieldDef *field,
size_t parent_fieldn,
const StructDef *parent_struct_def,
size_t count, bool inside_vector) { … }
void Parser::SerializeStruct(const StructDef &struct_def, const Value &val) { … }
void Parser::SerializeStruct(FlatBufferBuilder &builder,
const StructDef &struct_def, const Value &val) { … }
template<typename F>
CheckedError Parser::ParseTableDelimiters(size_t &fieldn,
const StructDef *struct_def, F body) { … }
CheckedError Parser::ParseTable(const StructDef &struct_def, std::string *value,
uoffset_t *ovalue) { … }
template<typename F>
CheckedError Parser::ParseVectorDelimiters(size_t &count, F body) { … }
CheckedError Parser::ParseAlignAttribute(const std::string &align_constant,
size_t min_align, size_t *align) { … }
CheckedError Parser::ParseVector(const Type &vector_type, uoffset_t *ovalue,
FieldDef *field, size_t fieldn) { … }
CheckedError Parser::ParseArray(Value &array) { … }
CheckedError Parser::ParseNestedFlatbuffer(Value &val, FieldDef *field,
size_t fieldn,
const StructDef *parent_struct_def) { … }
CheckedError Parser::ParseMetaData(SymbolTable<Value> *attributes) { … }
CheckedError Parser::ParseEnumFromString(const Type &type,
std::string *result) { … }
CheckedError Parser::ParseHash(Value &e, FieldDef *field) { … }
CheckedError Parser::TokenError() { … }
CheckedError Parser::ParseFunction(const std::string *name, Value &e) { … }
CheckedError Parser::TryTypedValue(const std::string *name, int dtoken,
bool check, Value &e, BaseType req,
bool *destmatch) { … }
CheckedError Parser::ParseSingleValue(const std::string *name, Value &e,
bool check_now) { … }
StructDef *Parser::LookupCreateStruct(const std::string &name,
bool create_if_new, bool definition) { … }
const EnumVal *EnumDef::MinValue() const { … }
const EnumVal *EnumDef::MaxValue() const { … }
uint64_t EnumDef::Distance(const EnumVal *v1, const EnumVal *v2) const { … }
std::string EnumDef::AllFlags() const { … }
EnumVal *EnumDef::ReverseLookup(int64_t enum_idx,
bool skip_union_default) const { … }
EnumVal *EnumDef::FindByValue(const std::string &constant) const { … }
void EnumDef::SortByValue() { … }
void EnumDef::RemoveDuplicates() { … }
template<typename T> void EnumDef::ChangeEnumValue(EnumVal *ev, T new_value) { … }
namespace EnumHelper {
template<BaseType E> struct EnumValType { … };
template<> struct EnumValType<BASE_TYPE_ULONG> { … };
}
struct EnumValBuilder { … };
CheckedError Parser::ParseEnum(const bool is_union, EnumDef **dest,
const char *filename) { … }
CheckedError Parser::StartStruct(const std::string &name, StructDef **dest) { … }
CheckedError Parser::CheckClash(std::vector<FieldDef *> &fields,
StructDef *struct_def, const char *suffix,
BaseType basetype) { … }
std::vector<IncludedFile> Parser::GetIncludedFiles() const { … }
bool Parser::SupportsOptionalScalars(const flatbuffers::IDLOptions &opts) { … }
bool Parser::SupportsOptionalScalars() const { … }
bool Parser::SupportsDefaultVectorsAndStrings() const { … }
bool Parser::SupportsAdvancedUnionFeatures() const { … }
bool Parser::SupportsAdvancedArrayFeatures() const { … }
bool Parser::Supports64BitOffsets() const { … }
bool Parser::SupportsUnionUnderlyingType() const { … }
Namespace *Parser::UniqueNamespace(Namespace *ns) { … }
std::string Parser::UnqualifiedName(const std::string &full_qualified_name) { … }
CheckedError Parser::ParseDecl(const char *filename) { … }
CheckedError Parser::ParseService(const char *filename) { … }
bool Parser::SetRootType(const char *name) { … }
void Parser::MarkGenerated() { … }
CheckedError Parser::ParseNamespace() { … }
CheckedError Parser::ParseProtoDecl() { … }
CheckedError Parser::StartEnum(const std::string &name, bool is_union,
EnumDef **dest) { … }
CheckedError Parser::ParseProtoFields(StructDef *struct_def, bool isextend,
bool inside_oneof) { … }
CheckedError Parser::ParseProtoMapField(StructDef *struct_def) { … }
CheckedError Parser::ParseProtoKey() { … }
CheckedError Parser::ParseProtoCurliesOrIdent() { … }
CheckedError Parser::ParseProtoOption() { … }
CheckedError Parser::ParseTypeFromProtoType(Type *type) { … }
CheckedError Parser::SkipAnyJsonValue() { … }
CheckedError Parser::ParseFlexBufferNumericConstant(
flexbuffers::Builder *builder) { … }
CheckedError Parser::ParseFlexBufferValue(flexbuffers::Builder *builder) { … }
bool Parser::ParseFlexBuffer(const char *source, const char *source_filename,
flexbuffers::Builder *builder) { … }
bool Parser::Parse(const char *source, const char **include_paths,
const char *source_filename) { … }
bool Parser::ParseJson(const char *json, const char *json_filename) { … }
std::ptrdiff_t Parser::BytesConsumed() const { … }
CheckedError Parser::StartParseFile(const char *source,
const char *source_filename) { … }
CheckedError Parser::ParseRoot(const char *source, const char **include_paths,
const char *source_filename) { … }
CheckedError Parser::CheckPrivateLeak() { … }
CheckedError Parser::CheckPrivatelyLeakedFields(const Definition &def,
const Definition &value_type) { … }
CheckedError Parser::DoParse(const char *source, const char **include_paths,
const char *source_filename,
const char *include_filename) { … }
CheckedError Parser::DoParseJson() { … }
std::set<std::string> Parser::GetIncludedFilesRecursive(
const std::string &file_name) const { … }
static flatbuffers::Offset<
flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>>
SerializeAttributesCommon(const SymbolTable<Value> &attributes,
FlatBufferBuilder *builder, const Parser &parser) { … }
static bool DeserializeAttributesCommon(
SymbolTable<Value> &attributes, Parser &parser,
const Vector<Offset<reflection::KeyValue>> *attrs) { … }
void Parser::Serialize() { … }
Offset<reflection::Object> StructDef::Serialize(FlatBufferBuilder *builder,
const Parser &parser) const { … }
bool StructDef::Deserialize(Parser &parser, const reflection::Object *object) { … }
Offset<reflection::Field> FieldDef::Serialize(FlatBufferBuilder *builder,
uint16_t id,
const Parser &parser) const { … }
bool FieldDef::Deserialize(Parser &parser, const reflection::Field *field) { … }
Offset<reflection::RPCCall> RPCCall::Serialize(FlatBufferBuilder *builder,
const Parser &parser) const { … }
bool RPCCall::Deserialize(Parser &parser, const reflection::RPCCall *call) { … }
Offset<reflection::Service> ServiceDef::Serialize(FlatBufferBuilder *builder,
const Parser &parser) const { … }
bool ServiceDef::Deserialize(Parser &parser,
const reflection::Service *service) { … }
Offset<reflection::Enum> EnumDef::Serialize(FlatBufferBuilder *builder,
const Parser &parser) const { … }
bool EnumDef::Deserialize(Parser &parser, const reflection::Enum *_enum) { … }
flatbuffers::Offset<
flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>>
EnumVal::SerializeAttributes(FlatBufferBuilder *builder,
const Parser &parser) const { … }
bool EnumVal::DeserializeAttributes(
Parser &parser, const Vector<Offset<reflection::KeyValue>> *attrs) { … }
Offset<reflection::EnumVal> EnumVal::Serialize(FlatBufferBuilder *builder,
const Parser &parser) const { … }
bool EnumVal::Deserialize(Parser &parser, const reflection::EnumVal *val) { … }
Offset<reflection::Type> Type::Serialize(FlatBufferBuilder *builder) const { … }
bool Type::Deserialize(const Parser &parser, const reflection::Type *type) { … }
flatbuffers::Offset<
flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>>
Definition::SerializeAttributes(FlatBufferBuilder *builder,
const Parser &parser) const { … }
bool Definition::DeserializeAttributes(
Parser &parser, const Vector<Offset<reflection::KeyValue>> *attrs) { … }
bool Parser::Deserialize(const uint8_t *buf, const size_t size) { … }
bool Parser::Deserialize(const reflection::Schema *schema) { … }
std::string Parser::ConformTo(const Parser &base) { … }
}