Implementation of LLSD parsers and formatters. More...
#include "linden_common.h"
#include "llsdserialize.h"
#include "llmemory.h"
#include "llstreamtools.h"
#include <iostream>
#include <string>
#include "apr_base64.h"
#include <netinet/in.h>
#include "lldate.h"
#include "llsd.h"
#include "llstring.h"
#include "lluri.h"
Functions | |
int | deserialize_boolean (std::istream &istr, LLSD &data, const std::string &compare, bool value) |
helper method for dealing with the different notation boolean format. | |
int | deserialize_string (std::istream &istr, std::string &value, S32 max_bytes) |
Figure out what kind of string it is (raw or delimited) and handoff. | |
int | deserialize_string_delim (std::istream &istr, std::string &value, char d) |
Parse a delimited string. | |
int | deserialize_string_raw (std::istream &istr, std::string &value, S32 max_bytes) |
Read a raw string off the stream. | |
U64 | ll_htonll (U64 hostlonglong) |
void | serialize_string (const std::string &value, std::ostream &str) |
Do notation escaping of a string to an ostream. |
Implementation of LLSD parsers and formatters.
Copyright (c) 2006-2009, Linden Research, Inc.
Second Life Viewer Source Code The source code in this file ("Source Code") is provided by Linden Lab to you under the terms of the GNU General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other License"), formally executed by you and Linden Lab. Terms of the GPL can be found in doc/GPL-license.txt in this distribution, or online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
There are special exceptions to the terms and conditions of the GPL as it is applied to this Source Code. View the full text of the exception in the file doc/FLOSS-exception.txt in this software distribution, or online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
By copying, modifying or distributing this software, you acknowledge that you have read and understood your obligations described above, and agree to abide by those obligations.
ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE. $/LicenseInfo$
int deserialize_boolean | ( | std::istream & | istr, | |
LLSD & | data, | |||
const std::string & | compare, | |||
bool | value | |||
) |
helper method for dealing with the different notation boolean format.
istr | The stream to read from with the leading character stripped. | |
data | [out] the result of the parse. | |
compare | The string to compare the boolean against | |
vale | The value to assign to data if the parse succeeds. |
int deserialize_string | ( | std::istream & | istr, | |
std::string & | value, | |||
S32 | max_bytes | |||
) |
Figure out what kind of string it is (raw or delimited) and handoff.
Local functions.
istr | The stream to read from. | |
value | [out] The string which was found. | |
max_bytes | The maximum possible length of the string. Passing in a negative value will skip this check. |
local functions
int deserialize_string_delim | ( | std::istream & | istr, | |
std::string & | value, | |||
char | d | |||
) |
Parse a delimited string.
istr | The stream to read from, with the delimiter already popped. | |
value | [out] The string which was found. | |
d | The delimiter to use. |
int deserialize_string_raw | ( | std::istream & | istr, | |
std::string & | value, | |||
S32 | max_bytes | |||
) |
Read a raw string off the stream.
istr | The stream to read from, with the (len) parameter leading the stream. | |
value | [out] The string which was found. | |
d | The delimiter to use. | |
max_bytes | The maximum possible length of the string. Passing in a negative value will skip this check. |
U64 ll_htonll | ( | U64 | hostlonglong | ) |
Endian handlers
void serialize_string | ( | const std::string & | value, | |
std::ostream & | str | |||
) |
Do notation escaping of a string to an ostream.
value | The string to escape and serialize | |
str | The stream to serialize to. |