LLSDBinaryParser Class Reference

Parser which handles binary formatted LLSD. More...

#include <llsdserialize.h>

Inheritance diagram for LLSDBinaryParser:

Inheritance graph
[legend]
Collaboration diagram for LLSDBinaryParser:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LLSDBinaryParser ()
 Constructor.

Protected Member Functions

virtual ~LLSDBinaryParser ()
 Destructor.
virtual S32 doParse (std::istream &istr, LLSD &data) const
 Call this method to parse a stream for LLSD.

Private Member Functions

S32 parseMap (std::istream &istr, LLSD &map) const
 Parse a map from the istream.
S32 parseArray (std::istream &istr, LLSD &array) const
 Parse an array from the istream.
bool parseString (std::istream &istr, std::string &value) const
 Parse a string from the istream and assign it to data.


Detailed Description

Parser which handles binary formatted LLSD.

Definition at line 316 of file llsdserialize.h.


Constructor & Destructor Documentation

LLSDBinaryParser::~LLSDBinaryParser (  )  [protected, virtual]

Destructor.

Definition at line 849 of file llsdserialize.cpp.

LLSDBinaryParser::LLSDBinaryParser (  ) 

Constructor.

LLSDBinaryParser

Definition at line 844 of file llsdserialize.cpp.


Member Function Documentation

S32 LLSDBinaryParser::doParse ( std::istream &  istr,
LLSD data 
) const [protected, virtual]

Call this method to parse a stream for LLSD.

This method parses the istream for a structured data. This method assumes that the istream is a complete llsd object -- for example an opened and closed map with an arbitrary nesting of elements. This method will return after reading one data object, allowing continued reading from the stream by the caller.

Parameters:
istr The input stream.
data[out] The newly parse structured data.
Returns:
Returns the number of LLSD objects parsed into data. Returns -1 on parse failure.

Undefined: '!'
Boolean: 't' for true 'f' for false
Integer: 'i' + 4 bytes network byte order
Real: 'r' + 8 bytes IEEE double
UUID: 'u' + 16 byte unsigned integer
String: 's' + 4 byte integer size + string
strings also secretly support the notation format Date: 'd' + 8 byte IEEE double for seconds since epoch
URI: 'l' + 4 byte integer size + string uri
Binary: 'b' + 4 byte integer size + binary data
Array: '[' + 4 byte integer size + all values + ']'
Map: '{' + 4 byte integer size every(key + value) + '}'
map keys are serialized as s + 4 byte integer size + string or in the notation format.

Implements LLSDParser.

Definition at line 854 of file llsdserialize.cpp.

References LLSDParser::account(), LLSD::clear(), deserialize_string_delim(), fullread(), LLSD::isUndefined(), ll_ntohd(), llendl, llinfos, LLSDParser::mCheckLimits, mData, LLSDParser::mMaxBytesLeft, LLSDParser::PARSE_FAILURE, parseArray(), parseMap(), parseString(), LLSDParser::read(), S32, and UUID_BYTES.

Referenced by parseArray(), and parseMap().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 LLSDBinaryParser::parseMap ( std::istream &  istr,
LLSD map 
) const [private]

Parse a map from the istream.

Parameters:
istr The input stream.
map The map to add the parsed data.
Returns:
Returns The number of LLSD objects parsed into data.

Definition at line 1083 of file llsdserialize.cpp.

References LLSDParser::account(), deserialize_string_delim(), doParse(), LLSD::emptyMap(), LLSD::insert(), LLSDParser::PARSE_FAILURE, parseString(), LLSDParser::read(), and S32.

Referenced by doParse().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 LLSDBinaryParser::parseArray ( std::istream &  istr,
LLSD array 
) const [private]

Parse an array from the istream.

Parameters:
istr The input stream.
array The array to append the parsed data.
Returns:
Returns The number of LLSD objects parsed into data.

Definition at line 1137 of file llsdserialize.cpp.

References LLSD::append(), doParse(), LLSD::emptyArray(), LLSDParser::PARSE_FAILURE, LLSDParser::read(), and S32.

Referenced by doParse().

Here is the call graph for this function:

Here is the caller graph for this function:

bool LLSDBinaryParser::parseString ( std::istream &  istr,
std::string &  value 
) const [private]

Parse a string from the istream and assign it to data.

Parameters:
istr The input stream.
value[out] The string to assign.
Returns:
Retuns true if a complete string was parsed.

Definition at line 1176 of file llsdserialize.cpp.

References LLSDParser::account(), fullread(), LLSDParser::mCheckLimits, LLSDParser::mMaxBytesLeft, LLSDParser::read(), and S32.

Referenced by doParse(), and parseMap().

Here is the call graph for this function:

Here is the caller graph for this function:


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

Generated on Fri May 16 09:03:33 2008 for SecondLife by  doxygen 1.5.5