Atlas  0.7.0
Networking protocol for the Worldforge system.
Atlas::Codecs::Bach Class Reference
Inheritance diagram for Atlas::Codecs::Bach:
Collaboration diagram for Atlas::Codecs::Bach:

Public Member Functions

 Bach (std::istream &in, std::ostream &out, Atlas::Bridge &b)
 
void poll () override
 
void streamBegin () override
 
void streamMessage () override
 
void streamEnd () override
 
void mapMapItem (std::string name) override
 
void mapListItem (std::string name) override
 
void mapIntItem (std::string name, std::int64_t) override
 
void mapFloatItem (std::string name, double) override
 
void mapStringItem (std::string name, std::string) override
 
void mapNoneItem (std::string name) override
 
void mapEnd () override
 
void listMapItem () override
 
void listListItem () override
 
void listIntItem (std::int64_t) override
 
void listFloatItem (double) override
 
void listStringItem (std::string) override
 
void listNoneItem () override
 
void listEnd () override
 
unsigned linenum () const
 

Protected Types

enum  State {
  PARSE_INIT , PARSE_STREAM , PARSE_MAP , PARSE_LIST ,
  PARSE_NAME , PARSE_DATA , PARSE_INT , PARSE_FLOAT ,
  PARSE_STRING , PARSE_LITERAL , PARSE_COMMENT
}
 

Protected Member Functions

bool stringmode () const
 
void parseInit (char)
 
void parseStream (char)
 
void parseMap (char)
 
void parseList (char)
 
void parseData (char)
 
void parseInt (char)
 
void parseFloat (char)
 
void parseString (char)
 
void parseLiteral (char)
 
void parseName (char)
 
void parseComment (char)
 
void writeIntItem (const std::string &, std::int64_t)
 
void writeFloatItem (const std::string &, double)
 
void writeStringItem (const std::string &, std::string)
 
void writeLine (const std::string &, bool=true, bool=false)
 

Static Protected Member Functions

static std::string encodeString (std::string)
 
static std::string decodeString (std::string)
 

Protected Attributes

std::istream & m_istream
 
std::ostream & m_ostream
 
Bridgem_bridge
 
bool m_comma
 
unsigned m_linenum
 
std::string m_name
 
std::string m_data
 
std::stack< State > m_state
 

Detailed Description

Definition at line 22 of file Bach.h.

Member Function Documentation

◆ listEnd()

void Atlas::Codecs::Bach::listEnd ( )
overridevirtual

Ends the currently streamed list.

Implements Atlas::Bridge.

Definition at line 622 of file Bach.cpp.

◆ listFloatItem()

void Atlas::Codecs::Bach::listFloatItem ( double  )
overridevirtual

Adds a float to the currently streamed list.

Implements Atlas::Bridge.

Definition at line 606 of file Bach.cpp.

◆ listIntItem()

void Atlas::Codecs::Bach::listIntItem ( std::int64_t  )
overridevirtual

Adds an integer to the currently streamed list.

Implements Atlas::Bridge.

Definition at line 601 of file Bach.cpp.

◆ listListItem()

void Atlas::Codecs::Bach::listListItem ( )
overridevirtual

Starts a list object in the currently streamed list.

Implements Atlas::Bridge.

Definition at line 596 of file Bach.cpp.

◆ listMapItem()

void Atlas::Codecs::Bach::listMapItem ( )
overridevirtual

Starts a map object in the currently streamed list.

Implements Atlas::Bridge.

Definition at line 591 of file Bach.cpp.

◆ listNoneItem()

void Atlas::Codecs::Bach::listNoneItem ( )
overridevirtual

Adds an empty item to the currently streamed list.

Implements Atlas::Bridge.

Definition at line 616 of file Bach.cpp.

◆ listStringItem()

void Atlas::Codecs::Bach::listStringItem ( std::string  )
overridevirtual

Adds a string to the currently streamed list.

Implements Atlas::Bridge.

Definition at line 611 of file Bach.cpp.

◆ mapEnd()

void Atlas::Codecs::Bach::mapEnd ( )
overridevirtual

Ends the currently streamed map.

Implements Atlas::Bridge.

Definition at line 586 of file Bach.cpp.

◆ mapFloatItem()

void Atlas::Codecs::Bach::mapFloatItem ( std::string  name,
double   
)
overridevirtual

Adds a float to the currently streamed map.

Implements Atlas::Bridge.

Definition at line 569 of file Bach.cpp.

◆ mapIntItem()

void Atlas::Codecs::Bach::mapIntItem ( std::string  name,
std::int64_t   
)
overridevirtual

Adds an integer to the currently streamed map.

Implements Atlas::Bridge.

Definition at line 564 of file Bach.cpp.

◆ mapListItem()

void Atlas::Codecs::Bach::mapListItem ( std::string  name)
overridevirtual

Starts a list object to the currently streamed map.

Implements Atlas::Bridge.

Definition at line 559 of file Bach.cpp.

◆ mapMapItem()

void Atlas::Codecs::Bach::mapMapItem ( std::string  name)
overridevirtual

Starts a map object to the currently streamed map.

Implements Atlas::Bridge.

Definition at line 554 of file Bach.cpp.

◆ mapNoneItem()

void Atlas::Codecs::Bach::mapNoneItem ( std::string  name)
overridevirtual

Adds a none item to the currently streamed map.

Implements Atlas::Bridge.

Definition at line 579 of file Bach.cpp.

◆ mapStringItem()

void Atlas::Codecs::Bach::mapStringItem ( std::string  name,
std::string   
)
overridevirtual

Adds a string to the currently streamed map.

Implements Atlas::Bridge.

Definition at line 574 of file Bach.cpp.

◆ streamBegin()

void Atlas::Codecs::Bach::streamBegin ( )
overridevirtual

Begin an Atlas stream.

Implements Atlas::Bridge.

Definition at line 540 of file Bach.cpp.

◆ streamEnd()

void Atlas::Codecs::Bach::streamEnd ( )
overridevirtual

Ends the Atlas stream.

Implements Atlas::Bridge.

Definition at line 545 of file Bach.cpp.

◆ streamMessage()

void Atlas::Codecs::Bach::streamMessage ( )
overridevirtual

Start a message in an Atlas stream.

Implements Atlas::Bridge.

Definition at line 549 of file Bach.cpp.


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