aboutsummaryrefslogtreecommitdiff
path: root/src/old/xmlstringwriter.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-07-03 00:28:59 +0000
committerMike Buland <eichlan@xagasoft.com>2007-07-03 00:28:59 +0000
commitac517a2b7625e0aa0862679e961c6349f859ea3b (patch)
treee3e27a6b9bd5e2be6150088495c91fc91786ad9d /src/old/xmlstringwriter.h
parentf8d4301e9fa4f3709258505941e37fab2eadadc6 (diff)
parentbd865cee5f89116c1f054cd0e5c275e97c2d0a9b (diff)
downloadlibbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.gz
libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.bz2
libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.xz
libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.zip
The reorg is being put in trunk, I think it's ready. Now we just get to find
out how many applications won't work anymore :)
Diffstat (limited to 'src/old/xmlstringwriter.h')
-rw-r--r--src/old/xmlstringwriter.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/old/xmlstringwriter.h b/src/old/xmlstringwriter.h
new file mode 100644
index 0000000..0d567b9
--- /dev/null
+++ b/src/old/xmlstringwriter.h
@@ -0,0 +1,50 @@
1#ifndef XML_STRING_WRITER
2#define XML_STRING_WRITER
3
4#include "xmlnode.h"
5#include "xmlwriter.h"
6
7/**
8 * Implements xml writing in the XML standard format. Also allows you to
9 * break that format and auto-indent your exported xml data for ease of
10 * reading. The auto-indenting will only be applied to sections that
11 * have no content of their own already. This means that except for
12 * whitespace all of your data will be preserved perfectly.
13 * You can create an XmlWriter object around a file, or access the static
14 * write function directly and just hand it a filename and a root XmlNode.
15 * When using an XmlWriter object the interface is identicle to that of
16 * the XmlDocument class, so reference that class for API info. However
17 * when the initial (or root) node is closed, and the document is finished
18 * the file will be created and written to automatically. The user can
19 * check to see if this is actually true by calling the isFinished
20 * function in the XmlDocument class.
21 *@author Mike Buland
22 */
23class XmlStringWriter : public XmlWriter
24{
25public:
26 /**
27 * Construct a string writer using an internal string buffer.
28 *@param sIndent Optional indent to add to each line.
29 */
30 XmlStringWriter( const char *sIndent=NULL );
31
32 /**
33 * Destroy the string writer and the internal string.
34 */
35 virtual ~XmlStringWriter();
36
37 /**
38 * Get the string that was built. This is only valid after the document has
39 * been completed, so check isCompleted or be sure your addNode and
40 * closeNode calls match up.
41 *@returns A reference to the internal string object.
42 */
43 std::string &getString();
44
45private:
46 void writeString( const char *sString );
47 std::string sXml; /**< The string object we "write" to. */
48};
49
50#endif