HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Member Functions | Related Functions
rwsf::XmlStringWriter Class Reference

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

Public Member Functions

 XmlStringWriter (size_t capacity=RWSF_STR_WRITER_BUFFER_SIZE)
 
void flush ()
 
size_t getBufferLength () const
 
size_t getLength () const
 
std::string getString () const
 
void resize (size_t size)
 
void writeToSink (const char *, size_t)
 
void writeToSink (char)
 
- Public Member Functions inherited from rwsf::XmlWriter
 XmlWriter ()
 
void addNamespace (const rwsf::XmlNamespace &ns)
 
void addNamespaceDecl (const rwsf::XmlNamespace &ns)
 
void decrementIndent ()
 
int getCurrentIndent () const
 
bool getIgnoreWhitespace () const
 
bool getMustEscapeTextDefault () const
 
int getSizeOfIndent () const
 
void incrementIndent ()
 
void setCurrentIndent (int indent)
 
void setIgnoreWhitespace (bool ignore)
 
void setMustEscapeTextDefault (bool escape)
 
int setSizeOfIndent (int indentSize)
 
void write (const std::string &text)
 
void write (const std::string &text, bool mustEscapeText)
 
void write (const char *textData, size_t textLength, bool mustEscapeText)
 
void writeAttribute (const std::string &name, const std::string &value)
 
void writeAttribute (const rwsf::XmlName &name, const std::string &value)
 
void writeAttribute (const std::string &name, const std::string &value, bool mustEscapeText)
 
void writeAttribute (const rwsf::XmlName &name, const std::string &value, bool mustEscapeText)
 
void writeAttribute (const std::string &name, const char *valueData, size_t valueLength)
 
void writeAttribute (const rwsf::XmlName &name, const char *valueData, size_t valueLength)
 
void writeAttribute (const std::string &name, const char *valueData, size_t valueLength, bool mustEscapeText)
 
void writeAttribute (const rwsf::XmlName &name, const char *valueData, size_t valueLength, bool mustEscapeText)
 
void writeElementEnd (const rwsf::XmlName &name)
 
void writeElementStart (const rwsf::XmlName &name, const rwsf::XmlAttributeSet &attributes=rwsf::XmlAttributeSet(), bool emptyElement=false, const rwsf::XmlName &schemaType=rwsf::XmlName())
 
void writeIndentChars ()
 
void writeNewLine ()
 
void writeSimpleElement (const rwsf::XmlName &name, const std::string &value, const rwsf::XmlName &schemaType, bool includeTypeAttribute)
 
void writeSimpleElement (const rwsf::XmlName &name, const std::string &value, const std::string &schemaType, bool includeTypeAttribute)
 
void writeSimpleElement (const std::string &name, const std::string &value, const std::string &schemaType, bool includeTypeAttribute)
 
void writeSimpleElement (const rwsf::XmlName &name, const std::string &value, const std::string &schemaType, bool mustEscapeText, bool includeTypeAttribute)
 
void writeSimpleElement (const std::string &name, const std::string &value, const std::string &schemaType, bool mustEscapeText, bool includeTypeAttribute)
 
void writeSimpleElement (const rwsf::XmlName &name, const char *valueData, size_t valueLength, const rwsf::XmlName &schemaType, bool includeTypeAttribute)
 
void writeSimpleElement (const rwsf::XmlName &name, const char *valueData, size_t valueLength, const std::string &schemaType, bool includeTypeAttribute)
 
void writeSimpleElement (const std::string &name, const char *valueData, size_t valueLength, const std::string &schemaType, bool includeTypeAttribute)
 
void writeSimpleElement (const rwsf::XmlName &name, const char *valueData, size_t valueLength, const rwsf::XmlName &schemaType, bool mustEscapeText, bool includeTypeAttribute)
 
void writeSimpleElement (const rwsf::XmlName &name, const char *valueData, size_t valueLength, const std::string &schemaType, bool mustEscapeText, bool includeTypeAttribute)
 
void writeSimpleElement (const std::string &name, const char *valueData, size_t valueLength, const std::string &schemaType, bool mustEscapeText, bool includeTypeAttribute)
 

Related Functions

(Note that these are not member functions.)

static const size_t RWSF_STR_WRITER_BUFFER_SIZE
 

Additional Inherited Members

- Static Public Attributes inherited from rwsf::XmlWriter
static const std::string Blank
 
static const std::string Colon
 
static const std::string EndTag
 
static const std::string EqualToAndQuotes
 
static const std::string FalseValue
 
static const std::string MarkupAmpersand
 
static const std::string MarkupApos
 
static const std::string MarkupCR
 
static const std::string MarkupGt
 
static const std::string MarkupLt
 
static const std::string MarkupQuotes
 
static const std::string Newline
 
static const std::string Quotes
 
static const std::string StartEndTag
 
static const std::string StartTag
 
static const std::string TrueValue
 
static const std::string UnpairedTag
 
static const std::string WhiteSpace
 
static const std::string XmlNamespaceTag
 
- Protected Member Functions inherited from rwsf::XmlWriter
virtual void writeToSink (const std::string &text)
 

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.

void rwsf::XmlStringWriter::writeToSink ( const char *  str,
size_t  len 
)
virtual

Pure virtual function. In a derived class, this function writes the contents of str limited to the length of len to the underlying data sink.

Implements rwsf::XmlWriter.

void rwsf::XmlStringWriter::writeToSink ( char  c)
virtual

Pure virtual function. In a derived class, this function writes a single character c to the underlying data sink.

Implements rwsf::XmlWriter.

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 © 2020 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.