HydraExpress™ C++ API Reference Guide

 
Loading...
Searching...
No Matches
rwsf::XmlStreamWriter Class Reference

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

#include <rwsf/core/XmlStreamWriter.h>

Inheritance diagram for rwsf::XmlStreamWriter:
rwsf::XmlWriter

Public Member Functions

 XmlStreamWriter (std::ostream &out)
void flush ()
void writeToSink (char c)
void writeToSink (const char *textData, size_t textLength)
virtual void writeToSink (const std::string &text)
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 char *textData, size_t textLength, bool mustEscapeText)
void write (const std::string &text)
void write (const std::string &text, bool mustEscapeText)
void writeAttribute (const rwsf::XmlName &name, const char *valueData, size_t valueLength)
void writeAttribute (const rwsf::XmlName &name, const char *valueData, size_t valueLength, bool mustEscapeText)
void writeAttribute (const rwsf::XmlName &name, const std::string &value)
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 std::string &name, const char *valueData, size_t valueLength, bool mustEscapeText)
void writeAttribute (const std::string &name, const std::string &value)
void writeAttribute (const std::string &name, const std::string &value, 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 char *valueData, size_t valueLength, const rwsf::XmlName &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 includeTypeAttribute)
void writeSimpleElement (const rwsf::XmlName &name, const char *valueData, size_t valueLength, const std::string &schemaType, bool mustEscapeText, bool includeTypeAttribute)
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 rwsf::XmlName &name, const std::string &value, 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 includeTypeAttribute)
void writeSimpleElement (const std::string &name, const char *valueData, size_t valueLength, const std::string &schemaType, bool mustEscapeText, bool includeTypeAttribute)
void writeSimpleElement (const std::string &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 mustEscapeText, bool includeTypeAttribute)

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

Detailed Description

rwsf::XmlStreamWriter implements an rwsf::XmlWriter that uses an std::ostream as a data sink. The class inherits most functions from rwsf::XmlWriter and can be constructed on any std::ostream implementation.

Constructor & Destructor Documentation

◆ XmlStreamWriter()

rwsf::XmlStreamWriter::XmlStreamWriter ( std::ostream & out)
inline

Constructs an rwsf::XmlStreamWriter that writes to the std::ostream out. The caller should ensure that out is in a state which can be written to without failure. Additionally, the user must ensure that out is in scope longer than the rwsf::XmlStreamWriter instance.

Member Function Documentation

◆ flush()

void rwsf::XmlStreamWriter::flush ( )
inlinevirtual

Calls flush() on the underlying std::ostream.

Implements rwsf::XmlWriter.

◆ writeToSink() [1/3]

void rwsf::XmlStreamWriter::writeToSink ( char c)
inlinevirtual

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

Implements rwsf::XmlWriter.

◆ writeToSink() [2/3]

void rwsf::XmlStreamWriter::writeToSink ( const char * str,
size_t len )
inlinevirtual

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.

◆ writeToSink() [3/3]

virtual void rwsf::XmlWriter::writeToSink ( const std::string & text)
inlinevirtual

Writes a string text to the underlying data sink. By default this function calls the writeToSink(const char* str, size_t len) function with the appropriate data and length.

Reimplemented from rwsf::XmlWriter.

Copyright © 2026 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.