code::Writer Class Reference

Inheritance diagram for code::Writer:

code::BzipWriter code::FileWriter code::GzipWriter code::LBWriter code::ZlibWriter List of all members.

Detailed Description

The purpose of Writer is to interact with a storage device.

There will be one writer subclass associated with every type of storage device. For maximum portability, all that the writer does is to write from a buffer (in memory). It does no parsing of the information content.

Author:
Lakshman
Version:
Author
lakshman
Date
2009/06/02 20:17:40
RCSfile
code_Writer.h,v
See also:
Reader

LB_Writer

File_Writer


Public Member Functions

virtual int writeOut (const Buffer &b, const char *deviceName, const char *messageName) const =0
 Write into the storage device.
int writeOut (const Buffer &b, const std::string &dev, const std::string &msg) const
int writeOut (const Buffer &b, const std::string &filename) const
virtual ~Writer ()
 Call descendant's destructor.
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 SmartPtr< WritergetWriter (const std::string &)
 Obtain the storage type's Writer.

Protected Member Functions

 Writer ()
 Empty default constructor.


Constructor & Destructor Documentation

virtual code::Writer::~Writer (  )  [virtual]

Call descendant's destructor.

code::Writer::Writer (  )  [protected]

Empty default constructor.

Should be used only by subclasses; all others should use the factory method getWriter().


Member Function Documentation

static SmartPtr< Writer > code::Writer::getWriter ( const std::string &   )  [static]

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).

Parameters:
const_string& storage type

int code::Writer::writeOut ( const Buffer b,
const std::string &  filename 
) const [inline]

int code::Writer::writeOut ( const Buffer b,
const std::string &  dev,
const std::string &  msg 
) const [inline]

virtual int code::Writer::writeOut ( const Buffer b,
const char *  deviceName,
const char *  messageName 
) const [pure virtual]

Write into the storage device.

Return zero on success and negative on error.

Implemented in code::LBWriter, code::BzipWriter, code::FileWriter, code::GzipWriter, and code::ZlibWriter.

int code::Writer::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.

This method writes out the entire document.

See also:
XMLOutputter

XMLDocument

Returns:
zero on success and negative on error.


Generated on Fri May 4 13:40:13 2012 for WDSS-IIw2 by  doxygen 1.4.7