Made to Order Software Corporation Logo

LLChatLib: /home/doug/src/oss/slitechat/trunk/LLChatLib/llcommon/llsdserialize.cpp File Reference

/home/doug/src/oss/slitechat/trunk/LLChatLib/llcommon/llsdserialize.cpp File Reference

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"
Include dependency graph for llsdserialize.cpp:
This graph shows which files directly or indirectly include this file:

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.


Detailed Description

Implementation of LLSD parsers and formatters.

Author:
Phoenix
Date:
2006-03-05
LicenseInfo
firstyear=2006&license=viewergpl

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$


Function Documentation

int deserialize_boolean ( std::istream &  istr,
LLSD data,
const std::string &  compare,
bool  value 
)

helper method for dealing with the different notation boolean format.

Parameters:
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.
Returns:
Returns number of bytes read off of the stream. Returns PARSE_FAILURE (-1) on failure.

Here is the call graph for this function:

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.

Parameters:
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.
Returns:
Returns number of bytes read off of the stream. Returns PARSE_FAILURE (-1) on failure.

local functions

Here is the call graph for this function:

int deserialize_string_delim ( std::istream &  istr,
std::string &  value,
char  d 
)

Parse a delimited string.

Parameters:
istr The stream to read from, with the delimiter already popped.
value [out] The string which was found.
d The delimiter to use.
Returns:
Returns number of bytes read off of the stream. Returns PARSE_FAILURE (-1) on failure.

Here is the call graph for this function:

int deserialize_string_raw ( std::istream &  istr,
std::string &  value,
S32  max_bytes 
)

Read a raw string off the stream.

Parameters:
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.
Returns:
Returns number of bytes read off of the stream. Returns PARSE_FAILURE (-1) on failure.
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.

Parameters:
value The string to escape and serialize
str The stream to serialize to.












Generated on Thu Sep 23 17:15:55 2010 for LLChatLib by  doxygen 1.6.3