rwsf::XmlStreamWriter rwsf::XmlWriter
#include <rwsf/core/XmlStreamWriter.h>
rwsf::XmlStreamWriter implements an rwsf::XmlWriter that uses an std::ostream as a data sink. The class inherits most functions from rwsf::XmlWriter. This class can be constructed on any std::ostream implementation.
#include <rwsf/core/XmlStreamWriter.h> #include <rwsf/core/XmlName.h> #include <iostream> #include <fstream> int main (void) { std::ofstream out("output.xml"); rwsf::XmlStreamWriter w(out); rwsf::XmlNamespace rw("rw", "http://roguewave.example.com/xml-ol"); rwsf::XmlName message("message", rw); w.writeElementStart(message); w.write("Hello, World!"); w.writeElementEnd(message); return 0; } Writes the following output to output.xml: <rw:message xmlns:rw="http://roguewave.example.com/xml-ol">Hello, World!</rw:message>
XmlStreamWriter(std::ostream& out);
Constructs an rwsf::XmlStreamWriter that writes to the std::ostream out. The caller should ensure that out is in a good state before starting. Additionally, the user must ensure that out is in scope longer than the rwsf::XmlStreamWriter instance.
virtual void flush();
Calls flush() on the underlying std::ostream.
©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks and HydraSDO is a trademark of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.