Inheritance diagram for code::FileWriter:
The storage type that you should pass to getWriter to get this is TypeName::FlatFile.
Public Member Functions | |
virtual int | writeOut (const Buffer &, const char *directory, const char *filename) const |
To write into the storage device. | |
virtual | ~FileWriter () |
Call descendant's destructor. | |
int | writeOut (const Buffer &b, const std::string &dev, const std::string &msg) const |
int | writeOut (const Buffer &b, const std::string &filename) const |
int | writeXMLDocument (const XML::Document &, const std::string &deviceName, const std::string &messageName) |
Given a document created from its root element, the contents (in textual form) will be written out. | |
Static Public Member Functions | |
static void | introduceSelf () |
Announce descendant-type FileWriter to the system. | |
static SmartPtr< Writer > | getWriter (const std::string &) |
Obtain the storage type's Writer. | |
Protected Member Functions | |
FileWriter () | |
Empty default constructor. |
code::FileWriter::FileWriter | ( | ) | [protected] |
Empty default constructor.
Should be used only by subclasses; all others should use the factory method getWriter() in Writer.
virtual code::FileWriter::~FileWriter | ( | ) | [virtual] |
Call descendant's destructor.
Obtain the storage type's Writer.
Pass in as StorageType::FlatFile, etc. Of course, you can pass in the std::string itself.
On error, return SmartPtr that evaluates to NULL (or 0).
const_string& | storage type |
static void code::FileWriter::introduceSelf | ( | ) | [static] |
Announce descendant-type FileWriter to the system.
This function needs to be invoked before FileWriter can be used. In the case of baseline CODE, it will be invoked by the initialize function of Introducer. For new development, it has to be done explicitly.
int code::Writer::writeOut | ( | const Buffer & | b, | |
const std::string & | filename | |||
) | const [inline, inherited] |
int code::Writer::writeOut | ( | const Buffer & | b, | |
const std::string & | dev, | |||
const std::string & | msg | |||
) | const [inline, inherited] |
virtual int code::FileWriter::writeOut | ( | const Buffer & | , | |
const char * | directory, | |||
const char * | filename | |||
) | const [virtual] |
To write into the storage device.
Returns zero on success and negative on error.
buffer | bytes to write out | |
directory | ||
filename |
Implements code::Writer.
int code::Writer::writeXMLDocument | ( | const XML::Document & | , | |
const std::string & | deviceName, | |||
const std::string & | messageName | |||
) | [inherited] |
Given a document created from its root element, the contents (in textual form) will be written out.
This method writes out the entire document.
XMLDocument