textwolf
0.2
|
Character encoding dependent XML printer. More...
#include <xmlprinter.hpp>
Public Types | |
enum | State { Init, Content, TagAttribute, TagElement } |
Internal state. More... | |
Public Member Functions | |
void | printToBuffer (const char *src, std::size_t srcsize, BufferType &buf) const |
Prints a character string to an STL back insertion sequence buffer in the IO character set encoding. More... | |
void | printEsc (char ch, BufferType &buf, unsigned int nof_echr, const char *echr, const char **estr) const |
print a character substitute or the character itself More... | |
void | printToBufferSubstChr (const char *src, std::size_t srcsize, BufferType &buf, unsigned int nof_echr, const char *echr, const char **estr) const |
print a value with some characters replaced by a string More... | |
void | printToBufferAttributeValue (const char *src, std::size_t srcsize, BufferType &buf) const |
print attribute value string More... | |
void | printToBufferContent (const char *src, std::size_t srcsize, BufferType &buf) const |
print content value string More... | |
void | printToBuffer (char ch, BufferType &buf) const |
Prints a character to an STL back insertion sequence buffer in the IO character set encoding. More... | |
XMLPrinter (bool subDocument=false) | |
Default constructor. More... | |
XMLPrinter (const IOCharset &output_, bool subDocument=false) | |
Constructor. More... | |
XMLPrinter (const XMLPrinter &o) | |
Copy constructor. More... | |
void | reset (bool subDocument=false) |
Reset the state. More... | |
bool | printHeader (const char *encoding, const char *standalone, BufferType &buf) |
Prints an XML header (version "1.0") More... | |
bool | printDoctype (const char *rootid, const char *publicid, const char *systemid, BufferType &buf) |
Prints an XML <!DOCTYPE ...> declaration. More... | |
bool | exitTagContext (BufferType &buf) |
Close the current tag attribute context opened. More... | |
bool | printOpenTag (const char *src, std::size_t srcsize, BufferType &buf) |
Print the start of an open tag. More... | |
bool | printAttribute (const char *src, std::size_t srcsize, BufferType &buf) |
Print the start of an attribute name. More... | |
bool | printValue (const char *src, std::size_t srcsize, BufferType &buf) |
Print a content or attribute value depending on context. More... | |
bool | printCloseTag (BufferType &buf) |
Print the close of the current tag open. More... | |
State | state () const |
Get the current internal state. More... | |
const char * | lasterror () const |
Get the last error occurred. More... | |
Character encoding dependent XML printer.
IOCharset | Character set encoding of input and output |
AppCharset | Character set encoding of the application processor |
BufferType | STL back insertion sequence to use for printing output |
enum textwolf::XMLPrinter::State |
|
inlineexplicit |
Default constructor.
[in] | subDocument | do not require an Xml header to be printed if set to true |
|
inlineexplicit |
Constructor.
[in] | output_ | character set encoding instance (with the code page tables needed) for output |
[in] | subDocument | do not require an Xml header to be printed if set to true |
|
inline |
Copy constructor.
|
inline |
Close the current tag attribute context opened.
[out] | buf | buffer to print to |
|
inline |
Get the last error occurred.
|
inline |
Print the start of an attribute name.
[in] | src | start of the attribute name |
[in] | srcsize | length of the attribute name in bytes |
[out] | buf | buffer to print to |
|
inline |
Print the close of the current tag open.
[out] | buf | buffer to print to |
|
inline |
Prints an XML <!DOCTYPE ...> declaration.
[in] | rootid | root element name |
[in] | publicid | PUBLIC attribute |
[in] | systemid | SYSTEM attribute |
[out] | buf | buffer to print to |
|
inline |
print a character substitute or the character itself
[in] | ch | character to print |
[in,out] | buf | buffer to print to |
[in] | nof_echr | number of elements in echr and estr |
[in] | echr | ASCII characters to substitute |
[in] | estr | ASCII strings to substitute with (array parallel to echr) |
|
inline |
Prints an XML header (version "1.0")
[in] | encoding | character set encoding name |
[in] | standalone | standalone attribute ("yes","no" or NULL for undefined) |
[out] | buf | buffer to print to |
|
inline |
Print the start of an open tag.
[in] | src | start of the tag name |
[in] | srcsize | length of the tag name in bytes |
[out] | buf | buffer to print to |
|
inline |
Prints a character string to an STL back insertion sequence buffer in the IO character set encoding.
[in] | src | pointer to string to print |
[in] | srcsize | size of src in bytes |
[out] | buf | buffer to append result to |
|
inline |
Prints a character to an STL back insertion sequence buffer in the IO character set encoding.
[in] | ch | character to print |
[in,out] | buf | buffer to print to |
|
inline |
print attribute value string
[in] | src | pointer to attribute value string to print |
[in] | srcsize | size of src in bytes |
[in,out] | buf | buffer to print to |
|
inline |
print content value string
[in] | src | pointer to content string to print |
[in] | srcsize | size of src in bytes |
[in,out] | buf | buffer to print to |
|
inline |
print a value with some characters replaced by a string
[in] | src | pointer to attribute value string to print |
[in] | srcsize | size of src in bytes |
[in,out] | buf | buffer to print to |
[in] | nof_echr | number of elements in echr and estr |
[in] | echr | ASCII characters to substitute |
[in] | estr | ASCII strings to substitute with (array parallel to echr) |
|
inline |
Print a content or attribute value depending on context.
[in] | src | start of the value |
[in] | srcsize | length of the value in bytes |
[out] | buf | buffer to print to |
|
inline |
Reset the state.
[in] | subDocument | do not require an Xml header to be printed if set to true |
|
inline |
Get the current internal state.