TrinityCore
Loading...
Searching...
No Matches
Deserializer Class Reference
+ Inheritance diagram for Deserializer:

Public Member Functions

bool ReadMessage (std::string_view json, google::protobuf::Message *message)
 
bool Key (Ch const *str, rapidjson::SizeType length, bool copy)
 
bool Null ()
 
bool Bool (bool b)
 
bool Int (int32 i)
 
bool Uint (uint32 i)
 
bool Int64 (int64 i)
 
bool Uint64 (uint64 i)
 
bool Double (double d)
 
bool String (Ch const *str, rapidjson::SizeType length, bool copy)
 
bool StartObject ()
 
bool EndObject (rapidjson::SizeType memberCount)
 
bool StartArray ()
 
bool EndArray (rapidjson::SizeType memberCount)
 
std::vector< std::string > const & GetErrors () const
 

Private Member Functions

bool CheckType (google::protobuf::FieldDescriptor::CppType expectedType)
 

Private Attributes

rapidjson::Reader _reader
 
std::stack< google::protobuf::FieldDescriptor const * > _state
 
std::stack< google::protobuf::Message * > _objectState
 
std::vector< std::string > _errors
 

Detailed Description

Definition at line 185 of file ProtobufJSON.cpp.

Member Function Documentation

◆ Bool()

bool Deserializer::Bool ( bool  b)

Definition at line 256 of file ProtobufJSON.cpp.

References _objectState, _state, Bool(), CheckType(), and SET_FIELD.

Referenced by Bool().

◆ CheckType()

bool Deserializer::CheckType ( google::protobuf::FieldDescriptor::CppType  expectedType)
private

Definition at line 419 of file ProtobufJSON.cpp.

References _errors, _state, and Trinity::StringFormat().

Referenced by Bool(), Int(), Int64(), and Uint64().

◆ Double()

bool Deserializer::Double ( double  d)

Definition at line 321 of file ProtobufJSON.cpp.

References _errors, _objectState, _state, Double, Float, SET_FIELD, and Trinity::StringFormat().

◆ EndArray()

bool Deserializer::EndArray ( rapidjson::SizeType  memberCount)

Definition at line 431 of file ProtobufJSON.cpp.

References _state.

◆ EndObject()

bool Deserializer::EndObject ( rapidjson::SizeType  memberCount)

Definition at line 393 of file ProtobufJSON.cpp.

References _objectState, and _state.

◆ GetErrors()

std::vector< std::string > const & Deserializer::GetErrors ( ) const
inline

Definition at line 204 of file ProtobufJSON.cpp.

References _errors.

Referenced by JSON::Deserialize().

◆ Int()

bool Deserializer::Int ( int32  i)

Definition at line 265 of file ProtobufJSON.cpp.

References _objectState, _state, CheckType(), Int32, and SET_FIELD.

◆ Int64()

bool Deserializer::Int64 ( int64  i)

Definition at line 303 of file ProtobufJSON.cpp.

References _objectState, _state, CheckType(), Int64, and SET_FIELD.

◆ Key()

bool Deserializer::Key ( Ch const *  str,
rapidjson::SizeType  length,
bool  copy 
)

Definition at line 229 of file ProtobufJSON.cpp.

References _errors, _objectState, _state, and Trinity::StringFormat().

◆ Null()

bool Deserializer::Null ( )

Definition at line 242 of file ProtobufJSON.cpp.

References _state.

◆ ReadMessage()

bool Deserializer::ReadMessage ( std::string_view  json,
google::protobuf::Message *  message 
)

Definition at line 215 of file ProtobufJSON.cpp.

References _errors, _objectState, _reader, _state, and ASSERT.

Referenced by JSON::Deserialize().

◆ StartArray()

bool Deserializer::StartArray ( )

Definition at line 402 of file ProtobufJSON.cpp.

References _errors, _state, and Trinity::StringFormat().

◆ StartObject()

bool Deserializer::StartObject ( )

Definition at line 370 of file ProtobufJSON.cpp.

References _errors, _objectState, _state, and Trinity::StringFormat().

◆ String()

bool Deserializer::String ( Ch const *  str,
rapidjson::SizeType  length,
bool  copy 
)

Definition at line 341 of file ProtobufJSON.cpp.

References _errors, _objectState, _state, SET_FIELD, String(), and Trinity::StringFormat().

Referenced by String().

◆ Uint()

bool Deserializer::Uint ( uint32  i)

Definition at line 274 of file ProtobufJSON.cpp.

References _errors, _objectState, _state, SET_FIELD, Trinity::StringFormat(), and UInt32.

◆ Uint64()

bool Deserializer::Uint64 ( uint64  i)

Definition at line 312 of file ProtobufJSON.cpp.

References _objectState, _state, CheckType(), SET_FIELD, and UInt64.

Member Data Documentation

◆ _errors

std::vector<std::string> Deserializer::_errors
private

◆ _objectState

std::stack<google::protobuf::Message*> Deserializer::_objectState
private

◆ _reader

rapidjson::Reader Deserializer::_reader
private

Definition at line 209 of file ProtobufJSON.cpp.

Referenced by ReadMessage().

◆ _state

std::stack<google::protobuf::FieldDescriptor const*> Deserializer::_state
private

The documentation for this class was generated from the following file: