Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
MessageHandler Struct Reference
Inheritance diagram for MessageHandler:
Collaboration diagram for MessageHandler:

Public Types

enum  State { kExpectObjectStart , kExpectNameOrObjectEnd , kExpectValue }
 
- Public Types inherited from BaseReaderHandler< UTF8<>, MessageHandler >
typedef UTF8<>::Ch Ch
 
typedef internal::SelectIf< internal::IsSame< MessageHandler, void >, BaseReaderHandler, MessageHandler >::Type Override
 

Public Member Functions

 MessageHandler ()
 
bool StartObject ()
 
bool String (const char *str, SizeType length, bool)
 
bool EndObject (SizeType)
 
bool Default ()
 
- Public Member Functions inherited from BaseReaderHandler< UTF8<>, MessageHandler >
bool Default ()
 
bool Null ()
 
bool Bool (bool)
 
bool Int (int)
 
bool Uint (unsigned)
 
bool Int64 (int64_t)
 
bool Uint64 (uint64_t)
 
bool Double (double)
 
bool RawNumber (const Ch *str, SizeType len, bool copy)
 enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length)
 
bool String (const Ch *, SizeType, bool)
 
bool StartObject ()
 
bool Key (const Ch *str, SizeType len, bool copy)
 
bool EndObject (SizeType)
 
bool StartArray ()
 
bool EndArray (SizeType)
 

Public Attributes

MessageMap messages_
 
enum MessageHandler::State state_
 
std::string name_
 

Detailed Description

Definition at line 25 of file messagereader.cpp.

Member Enumeration Documentation

◆ State

Enumerator
kExpectObjectStart 
kExpectNameOrObjectEnd 
kExpectValue 

Definition at line 59 of file messagereader.cpp.

Constructor & Destructor Documentation

◆ MessageHandler()

MessageHandler::MessageHandler ( )
inline

Definition at line 27 of file messagereader.cpp.

Member Function Documentation

◆ Default()

bool MessageHandler::Default ( )
inline

Definition at line 56 of file messagereader.cpp.

56{ return false; } // All other events are invalid.

◆ EndObject()

bool MessageHandler::EndObject ( SizeType )
inline

Definition at line 54 of file messagereader.cpp.

54{ return state_ == kExpectNameOrObjectEnd; }

◆ StartObject()

bool MessageHandler::StartObject ( )
inline

Definition at line 29 of file messagereader.cpp.

29 {
30 switch (state_) {
33 return true;
34 default:
35 return false;
36 }
37 }

◆ String()

bool MessageHandler::String ( const char * str,
SizeType length,
bool  )
inline

Definition at line 39 of file messagereader.cpp.

39 {
40 switch (state_) {
42 name_ = string(str, length);
44 return true;
45 case kExpectValue:
46 messages_.insert(MessageMap::value_type(name_, string(str, length)));
48 return true;
49 default:
50 return false;
51 }
52 }

Member Data Documentation

◆ messages_

MessageMap MessageHandler::messages_

Definition at line 58 of file messagereader.cpp.

◆ name_

std::string MessageHandler::name_

Definition at line 64 of file messagereader.cpp.

◆ state_

enum MessageHandler::State MessageHandler::state_

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