Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

ph::persist::dumpobj Class Reference

#include <dumpobj.hpp>

Inheritance diagram for ph::persist::dumpobj:

ph::common::object_writer

Detailed Description

A concrete subclass of object_writer which dumps an object.

We write the objects like this:

object ::= object-start sub-object-list object-end

object-start ::= TAGNAME ["(" attr-list ")"] "{"

object-end ::= "}"

sub-object-list ::= (data-object | object)*

data-object ::= TAGNAME "=" data

attr-list ::= [attr-pair ([", " attr-pair])*]

attr-pair ::= name "=" value

And a typical tree might be:

root(name=root) { x=1 foos { foo(name=foo_1) { x=1 y=2.1 z=true } foo(name=foo_2) { x=4 y=10 z=false } } }

Definition at line 21 of file dumpobj.hpp.

Public Member Functions

 dumpobj (std::ostream *stream, std::ostream *console)
virtual bool start (const std::string &tagname)
virtual bool attr (const std::string &name, const std::string &value)
virtual bool data (const std::string &d)
virtual bool end (const std::string &tagname)


Constructor & Destructor Documentation

ph::persist::dumpobj::dumpobj std::ostream *  stream,
std::ostream *  console
[inline]
 

Definition at line 74 of file dumpobj.hpp.


Member Function Documentation

bool dumpobj::start const std::string &  tagname  )  [virtual]
 

Start a new tag with the writer.

Implements ph::common::object_writer.

Definition at line 14 of file dumpobj.cpp.

bool dumpobj::attr const std::string &  name,
const std::string &  value
[virtual]
 

Write out name/value pairs for the tag.

Implements ph::common::object_writer.

Definition at line 82 of file dumpobj.cpp.

bool dumpobj::data const std::string &  d  )  [virtual]
 

Write out arbitrary data for the tag.

Implements ph::common::object_writer.

Definition at line 99 of file dumpobj.cpp.

bool dumpobj::end const std::string &  tagname  )  [virtual]
 

End the tag. Note that it is usually possible for the implementation of the writer to save away the tag name, but for keeping the writers simple, it is included again.

Implements ph::common::object_writer.

Definition at line 43 of file dumpobj.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Apr 5 22:03:35 2006 for cppxmlobj by  doxygen 1.4.3