#include <llsdserialize.h>
Inheritance diagram for LLSDBinaryParser:
Public Member Functions | |
LLSDBinaryParser () | |
Constructor. | |
virtual S32 | parse (std::istream &istr, LLSD &data) const |
Call this method to parse a stream for LLSD. | |
Static Public Member Functions | |
static LLSD | parse (std::istream &istr) |
Simple notation parse. | |
Protected Member Functions | |
virtual | ~LLSDBinaryParser () |
Destructor. | |
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. | |
void | parseString (std::istream &istr, std::string &value) const |
Parse a string from the istream and assign it to data. |
Definition at line 205 of file llsdserialize.h.
LLSDBinaryParser::~LLSDBinaryParser | ( | ) | [protected, virtual] |
LLSDBinaryParser::LLSDBinaryParser | ( | ) |
LLSD LLSDBinaryParser::parse | ( | std::istream & | istr | ) | [static] |
Simple notation parse.
This simplified parser cannot not distinguish between a failed parse and a parse which yields a single undefined LLSD. You can use this if error checking will be implicit in the use of the results of the parse.
istr | The input stream. |
Definition at line 837 of file llsdserialize.cpp.
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.
istr | The input stream. | |
data[out] | The newly parse structured data. |
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 669 of file llsdserialize.cpp.
References c, LLSD::clear(), deserialize_string_delim(), ll_ntohd(), llendl, llinfos, mData, parseArray(), parseMap(), parseString(), S32, size, and UUID_BYTES.
Referenced by parse(), parseArray(), and parseMap().
Parse an array from the istream.
istr | The input stream. | |
array | The array to append the parsed data. |
Definition at line 882 of file llsdserialize.cpp.
References LLSD::append(), c, count, LLSD::emptyArray(), parse(), S32, and size.
Referenced by parse().
Parse a map from the istream.
istr | The input stream. | |
map | The map to add the parsed data. |
Definition at line 847 of file llsdserialize.cpp.
References c, count, deserialize_string_delim(), LLSD::emptyMap(), LLSD::insert(), parse(), parseString(), S32, and size.
Referenced by parse().
void LLSDBinaryParser::parseString | ( | std::istream & | istr, | |
std::string & | value | |||
) | const [private] |
Parse a string from the istream and assign it to data.
istr | The input stream. | |
value[out] | The string to assign. |
Definition at line 911 of file llsdserialize.cpp.
Referenced by parse(), and parseMap().