FDO API Reference | Feature Data Objects |
#include <Writer.h>
Inherits FdoDisposable.
Inheritance diagram for FdoXmlWriter:
Definition at line 31 of file Writer.h.
Public Types | |
enum | LineFormat { LineFormat_None, LineFormat_Break, LineFormat_Indent } |
Specifies whether the output XML document has line breaks or indentation. More... | |
Public Member Functions | |
FDO_API_COMMON void | Close () |
Closes this XML Writer by writing end tags for all elements currently open. Once this function is called, no more elements can be added to the output document. | |
virtual FDO_API_COMMON FdoStringP | EncodeName (FdoStringP name)=0 |
utility function that converts FDO element names to valid XML element or attribute names. Conversion is done by changing each invalid character to a hex pattern ( "-xnnnn-" ). | |
FDO_API_COMMON FdoBoolean | GetDefaultRoot () |
Gets the current default root state. | |
FDO_API_COMMON FdoIoStream * | GetStream () |
Gets the underlying stream. If a text writer was passed to this object then the stream for this text writer is returned. If a stream was passed to this object then this stream is returned. If a file name as passed then a auto-generated stream (wrapped around the file) is returned. | |
FDO_API_COMMON FdoIoTextWriter * | GetTextWriter () |
Gets the underlying text writer. If a text writer was passed to this object then this text writer is returned. Otherwise, an auto-generated text writer is returned (a text writer wrapped around the file name or stream that was passed to this object). | |
virtual FDO_API_COMMON FdoBoolean | IsValidName (FdoStringP name)=0 |
Checks if a string is a valid XML 1.0 element or attribute name. | |
FDO_API_COMMON void | SetDefaultRoot (FdoBoolean defaultRoot) |
Sets whether to write the default root element. Must be called before the first element is written, otherwise an exception is thrown. | |
FDO_API_COMMON FdoStringP | UriToQName (FdoString *uri, FdoString *localName, FdoBoolean isElement=true) |
Given an element's or attribute's globally unique name ( uri and local name ), this function returns its fully qualified name as per the XML document being written, or the unqualified name if the uri is the default namespace. This is done by searching for the current namespace declaration that references the uri. | |
FDO_API_COMMON void | WriteAttribute (FdoString *attributeName, FdoString *attributeValue) |
Writes an attribute to the current element. A FdoXmlException is thrown if this function is called immediately after WriteEndElement(). | |
FDO_API_COMMON void | WriteBytes (FdoByte *bytes, FdoSize count) |
Writes arbitrary bytes to the XML Writer. Caller is responsible for ensuring that the text does not introduce any errors into the XML document. | |
FDO_API_COMMON void | WriteCharacters (FdoString *characters) |
Writes simple (character) content for the current element. This function can be called multiple times for the same element. The characters are appended to the element's content. A FdoXmlException is thrown if there is no current element. | |
FDO_API_COMMON void | WriteEndElement () |
Writes the end tag for the current element to the document. A FdoXmlException is thrown if there is no element to end. | |
FDO_API_COMMON void | WriteStartElement (FdoString *elementName) |
Writes an element start tag to the document. | |
Static Public Member Functions | |
FDO_API_COMMON FdoXmlWriter * | Create (FdoIoTextWriter *writer, FdoBoolean defaultRoot=true, LineFormat lineFormat=LineFormat_None, FdoSize lineLength=0) |
Constructs an XML writer on a text writer. | |
FDO_API_COMMON FdoXmlWriter * | Create (FdoIoStream *stream, FdoBoolean defaultRoot=true, LineFormat lineFormat=LineFormat_None, FdoSize lineLength=0) |
Constructs an XML writer on a stream. | |
FDO_API_COMMON FdoXmlWriter * | Create (FdoString *fileName, FdoBoolean defaultRoot=true, LineFormat lineFormat=LineFormat_None, FdoSize lineLength=0) |
Constructs an XML writer on a file. | |
Protected Member Functions | |
FdoXmlWriter (FdoIoTextWriter *writer, FdoBoolean defaultRoot, LineFormat lineFormat, FdoSize lineLength) | |
FdoXmlWriter () | |
DOXYGEN-IGNORE | |
void | WritePrologue () |
Write the prologue when needed. | |
virtual | ~FdoXmlWriter (void) |
|
|
DOXYGEN-IGNORE
|
|
|
|
|
|
Closes this XML Writer by writing end tags for all elements currently open. Once this function is called, no more elements can be added to the output document.
|
|
Constructs an XML writer on a text writer.
|
|
Constructs an XML writer on a stream.
|
|
Constructs an XML writer on a file.
|
|
utility function that converts FDO element names to valid XML element or attribute names. Conversion is done by changing each invalid character to a hex pattern ( "-xnnnn-" ).
|
|
Gets the current default root state.
Definition at line 177 of file Writer.h. References FDO_API_COMMON, and FdoBoolean. |
|
Gets the underlying stream. If a text writer was passed to this object then the stream for this text writer is returned. If a stream was passed to this object then this stream is returned. If a file name as passed then a auto-generated stream (wrapped around the file) is returned.
Definition at line 166 of file Writer.h. References FDO_API_COMMON. |
|
Gets the underlying text writer. If a text writer was passed to this object then this text writer is returned. Otherwise, an auto-generated text writer is returned (a text writer wrapped around the file name or stream that was passed to this object).
|
|
Checks if a string is a valid XML 1.0 element or attribute name.
|
|
Sets whether to write the default root element. Must be called before the first element is written, otherwise an exception is thrown.
|
|
Given an element's or attribute's globally unique name ( uri and local name ), this function returns its fully qualified name as per the XML document being written, or the unqualified name if the uri is the default namespace. This is done by searching for the current namespace declaration that references the uri.
|
|
Writes an attribute to the current element. A FdoXmlException is thrown if this function is called immediately after WriteEndElement().
|
|
Writes arbitrary bytes to the XML Writer. Caller is responsible for ensuring that the text does not introduce any errors into the XML document.
|
|
Writes simple (character) content for the current element. This function can be called multiple times for the same element. The characters are appended to the element's content. A FdoXmlException is thrown if there is no current element.
|
|
Writes the end tag for the current element to the document. A FdoXmlException is thrown if there is no element to end.
|
|
Write the prologue when needed.
|
|
Writes an element start tag to the document.
|
Comments or suggestions? Send us feedback. |