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 Enumeration Documentation

◆ State

enum Atlas::Codecs::Bach::State
protected

Definition at line 73 of file Bach.h.

Constructor & Destructor Documentation

◆ Bach()

Atlas::Codecs::Bach::Bach ( std::istream &  in,
std::ostream &  out,
Atlas::Bridge b 
)

Definition at line 20 of file Bach.cpp.

Member Function Documentation

◆ decodeString()

std::string Atlas::Codecs::Bach::decodeString ( std::string  toDecode)
inlinestaticprotected

Definition at line 464 of file Bach.cpp.

◆ encodeString()

std::string Atlas::Codecs::Bach::encodeString ( std::string  toEncode)
inlinestaticprotected

Definition at line 478 of file Bach.cpp.

◆ linenum()

unsigned Atlas::Codecs::Bach::linenum ( ) const
inline

Definition at line 63 of file Bach.h.

◆ 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.

◆ parseComment()

void Atlas::Codecs::Bach::parseComment ( char  next)
inlineprotected

Definition at line 375 of file Bach.cpp.

◆ parseData()

void Atlas::Codecs::Bach::parseData ( char  next)
inlineprotected

Definition at line 274 of file Bach.cpp.

◆ parseFloat()

void Atlas::Codecs::Bach::parseFloat ( char  next)
inlineprotected

Definition at line 188 of file Bach.cpp.

◆ parseInit()

void Atlas::Codecs::Bach::parseInit ( char  next)
inlineprotected

Definition at line 25 of file Bach.cpp.

◆ parseInt()

void Atlas::Codecs::Bach::parseInt ( char  next)
inlineprotected

Definition at line 133 of file Bach.cpp.

◆ parseList()

void Atlas::Codecs::Bach::parseList ( char  next)
inlineprotected

Definition at line 84 of file Bach.cpp.

◆ parseLiteral()

void Atlas::Codecs::Bach::parseLiteral ( char  next)
inlineprotected

Definition at line 269 of file Bach.cpp.

◆ parseMap()

void Atlas::Codecs::Bach::parseMap ( char  next)
inlineprotected

Definition at line 52 of file Bach.cpp.

◆ parseName()

void Atlas::Codecs::Bach::parseName ( char  next)
inlineprotected

Definition at line 351 of file Bach.cpp.

◆ parseStream()

void Atlas::Codecs::Bach::parseStream ( char  next)
inlineprotected

Definition at line 34 of file Bach.cpp.

◆ parseString()

void Atlas::Codecs::Bach::parseString ( char  next)
inlineprotected

Definition at line 238 of file Bach.cpp.

◆ poll()

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

Implements Atlas::Codec.

Definition at line 391 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.

◆ stringmode()

bool Atlas::Codecs::Bach::stringmode ( ) const
protected

Definition at line 380 of file Bach.cpp.

◆ writeFloatItem()

void Atlas::Codecs::Bach::writeFloatItem ( const std::string &  name,
double  data 
)
protected

Definition at line 513 of file Bach.cpp.

◆ writeIntItem()

void Atlas::Codecs::Bach::writeIntItem ( const std::string &  name,
std::int64_t  data 
)
protected

Definition at line 503 of file Bach.cpp.

◆ writeLine()

void Atlas::Codecs::Bach::writeLine ( const std::string &  line,
bool  endline = true,
bool  endtag = false 
)
protected

Definition at line 533 of file Bach.cpp.

◆ writeStringItem()

void Atlas::Codecs::Bach::writeStringItem ( const std::string &  name,
std::string  data 
)
protected

Definition at line 523 of file Bach.cpp.

Member Data Documentation

◆ m_bridge

Bridge& Atlas::Codecs::Bach::m_bridge
protected

Definition at line 69 of file Bach.h.

◆ m_comma

bool Atlas::Codecs::Bach::m_comma
protected

Definition at line 70 of file Bach.h.

◆ m_data

std::string Atlas::Codecs::Bach::m_data
protected

Definition at line 89 of file Bach.h.

◆ m_istream

std::istream& Atlas::Codecs::Bach::m_istream
protected

Definition at line 67 of file Bach.h.

◆ m_linenum

unsigned Atlas::Codecs::Bach::m_linenum
protected

Definition at line 71 of file Bach.h.

◆ m_name

std::string Atlas::Codecs::Bach::m_name
protected

Definition at line 89 of file Bach.h.

◆ m_ostream

std::ostream& Atlas::Codecs::Bach::m_ostream
protected

Definition at line 68 of file Bach.h.

◆ m_state

std::stack<State> Atlas::Codecs::Bach::m_state
protected

Definition at line 90 of file Bach.h.


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