Made to Order Software Corporation Logo

LLChatLib: LLSDFormatter Class Reference

LLSDFormatter Class Reference

Abstract base class for formatting LLSD. More...

#include <llsdserialize.h>

Inheritance diagram for LLSDFormatter:

List of all members.

Public Types

enum  e_formatter_options_type
typedef enum
LLSDFormatter::e_formatter_options_type 
EFormatterOptions

Public Member Functions

void boolalpha (bool alpha)
 Set the boolean serialization format.

virtual S32 format (const LLSD &data, std::ostream &ostr, U32 options=LLSDFormatter::OPTIONS_NONE) const =0
 Call this method to format an LLSD to a stream.

 LLSDFormatter ()
 Constructor.

void realFormat (const std::string &format)
 Set the real format.

Protected Member Functions

void formatReal (LLSD::Real real, std::ostream &ostr) const
 Helper method which appropriately obeys the real format.

virtual ~LLSDFormatter ()
 Destructor.


Detailed Description

Abstract base class for formatting LLSD.


Member Typedef Documentation


Member Enumeration Documentation

Options for output


Constructor & Destructor Documentation

LLSDFormatter::LLSDFormatter (  ) 

Constructor.

LLSDFormatter


Member Function Documentation

void LLSDFormatter::boolalpha ( bool  alpha  ) 

Set the boolean serialization format.

Parameters:
alpha Serializes boolean as alpha if true.
virtual S32 LLSDFormatter::format ( const LLSD data,
std::ostream &  ostr,
U32  options = LLSDFormatter::OPTIONS_NONE 
) const [pure virtual]

Call this method to format an LLSD to a stream.

Parameters:
data The data to write.
ostr The destination stream for the data.
Returns:
Returns The number of LLSD objects fomatted out

Implemented in LLSDNotationFormatter, LLSDXMLFormatter, and LLSDBinaryFormatter.

void LLSDFormatter::formatReal ( LLSD::Real  real,
std::ostream &  ostr 
) const [protected]

Helper method which appropriately obeys the real format.

Parameters:
real The real value to format.
ostr The destination stream for the data.
void LLSDFormatter::realFormat ( const std::string &  format  ) 

Set the real format.

By default, the formatter will use default double serialization which is frequently frustrating for many applications. You can set the precision on the stream independently, but that still might not work depending on the value. EXAMPLES:
%.2f


Parameters:
format A format string which follows the printf format rules. Specify an empty string to return to default formatting.

The documentation for this class was generated from the following files:
Generated on Thu Sep 23 17:18:44 2010 for LLChatLib by  doxygen 1.6.3