rwlogo
HydraExpress 4.6

HydraExpress C++ API Reference Guide


   


Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::XmlStringWriter Class Reference
[Core XML]

Implements an rwsf::XmlWriter that uses an std::string as a data sink. More...

#include <rwsf/core/XmlStringWriter.h>

Inheritance diagram for rwsf::XmlStringWriter:
rwsf::XmlWriter

List of all members.

Public Member Functions

 XmlStringWriter (size_t capacity=RWSF_STR_WRITER_BUFFER_SIZE)
size_t getLength () const
size_t getBufferLength () const
std::string getString () const
void flush ()
void resize (size_t size)

Related Functions

(Note that these are not member functions.)



static const size_t RWSF_STR_WRITER_BUFFER_SIZE

Detailed Description

Class rwsf::XmlStringWriter implements an rwsf::XmlWriter that uses an std::string as a data sink. This class provides a string buffer-based implementation of the rwsf::XmlWriter interface to aid in writing XML content to a string.

This class inherits most functions from rwsf::XmlWriter.


Constructor & Destructor Documentation

rwsf::XmlStringWriter::XmlStringWriter ( size_t  capacity = RWSF_STR_WRITER_BUFFER_SIZE  ) 

Constructs an rwsf::XmlStringWriter that contains an empty std::string. The initial capacity of the underlying buffer is set to capacity. The default capacity is defined by RWSF_STR_WRITER_BUFFER_SIZE.


Member Function Documentation

void rwsf::XmlStringWriter::flush (  )  [virtual]

Ensures any buffered data has been written.

Implements rwsf::XmlWriter.

size_t rwsf::XmlStringWriter::getBufferLength (  )  const

Returns the length of the buffer.

size_t rwsf::XmlStringWriter::getLength (  )  const

Returns the length of the std::string this object contains.

std::string rwsf::XmlStringWriter::getString (  )  const

Returns the std::string this object contains.

void rwsf::XmlStringWriter::resize ( size_t  size  ) 

Resizes this rwsf::XmlStringWriter object's internal character buffer to size. If size is less than the current position in the buffer, the buffer is truncated to the new size and the position set to the end of the buffer.


Friends And Related Function Documentation

const size_t RWSF_STR_WRITER_BUFFER_SIZE [related]

This constant declares the size of the XmlStringWriter internal buffer. The built-in default size is 4kb (4096 bytes).


Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.