Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

CTBxmlOStream Class Reference

XML output stream **. More...

#include "CTBxmlOStream.hxx"

Collaboration diagram for CTBxmlOStream:

Collaboration graph
[legend]
List of all members.

Public Methods

 CTBxmlOStream ()
 CTBxmlOStream (ostream *p_os)
 CTBxmlOStream (const char *c_filename, int i_mode=ios::out, int i_prot=0664)
virtual ~CTBxmlOStream ()
void Attach (ostream *p_os)
void Open (const char *c_filename, int i_mode=ios::out, int i_prot=0664)
void Close ()
bool Good () const
bool Bad () const
bool Fail () const
bool Eof () const
void PutStartTag (const char *c_name)
void PutEmptyTag (const char *c_name)
void PutEndTag ()
void PutTaggedValue (const char *c_name, int i_value, const char *c_format=0, int i_width=0)
void PutTaggedValue (const char *c_name, unsigned int i_value, const char *c_format=0, int i_width=0)
void PutTaggedValue (const char *c_name, long i_value, const char *c_format=0, int i_width=0)
void PutTaggedValue (const char *c_name, unsigned long i_value, const char *c_format=0, int i_width=0)
void PutTaggedValue (const char *c_name, double d_value, const char *c_format=0, int i_width=0, int i_precision=0)
void PutTaggedValue (const char *c_name, const char *c_value, bool b_dropempty=false)
void PutTaggedValue (const char *c_name, const CTBstring &value, bool b_dropempty=false)
void PutTaggedValue (const char *c_name, const CTBtime &value, bool b_dropinvalid=false)
ostream * Stream () const
void SetBad ()
void SetFail ()
void Dump (int i_indent=0, ostream &os=cout, const char *p_text=0) const
bool operator! () const
 operator void * () const
CTBxmlOStream & operator<< (const char *c_text)
CTBxmlOStream & operator<< (char *c_text)
CTBxmlOStream & operator<< (const CTBxmlStartTag &tag)
CTBxmlOStream & operator<< (const CTBxmlEmptyTag &tag)
CTBxmlOStream & operator<< (const CTBxmlEndTag &tag)

Private Types

enum  type { starttag, endtag, emptytag }

Private Methods

void PutEscapedString (const char *c_text, CTBint i_length=-1)
void PutEscapedString (const CTBstring &string)

Private Attributes

ostream * mp_os
bool mb_attached
bool mb_autonewline
bool mb_autoindent
bool mb_bad
bool mb_fail
int mi_lasttag
CTBstack< CTBstringm_tagstack

Detailed Description

XML output stream **.

Definition at line 24 of file CTBxmlOStream.hxx.


Member Enumeration Documentation

enum CTBxmlOStream::type [private]
 

Enumeration values:
starttag   start tag (<xxx...>).
endtag   end tag (</xxx>).
emptytag   empty tag (<xxx .../>).

Definition at line 94 of file CTBxmlOStream.hxx.


Constructor & Destructor Documentation

CTBxmlOStream::CTBxmlOStream
 

Default constructor.

Definition at line 31 of file CTBxmlOStream.cxx.

CTBxmlOStream::CTBxmlOStream ostream * p_os [explicit]
 

Construct with attached stream.

Definition at line 46 of file CTBxmlOStream.cxx.

CTBxmlOStream::CTBxmlOStream const char * c_filename,
int i_mode = ios::out,
int i_prot = 0664
[explicit]
 

Construct with a file.

Definition at line 61 of file CTBxmlOStream.cxx.

CTBxmlOStream::~CTBxmlOStream [virtual]
 

Virtual destructor.

Definition at line 77 of file CTBxmlOStream.cxx.


Member Function Documentation

void CTBxmlOStream::Attach ostream * p_os
 

Attach external stream.

Definition at line 86 of file CTBxmlOStream.cxx.

Referenced by Open().

void CTBxmlOStream::Open const char * c_filename,
int i_mode = ios::out,
int i_prot = 0664
 

Open stream.

Definition at line 102 of file CTBxmlOStream.cxx.

Referenced by CTBxmlOStream().

void CTBxmlOStream::Close
 

Close stream.

Definition at line 126 of file CTBxmlOStream.cxx.

Referenced by Attach(), Open(), and ~CTBxmlOStream().

bool CTBxmlOStream::Good const
 

State check: good flag.

Definition at line 148 of file CTBxmlOStream.cxx.

bool CTBxmlOStream::Bad const
 

State check: bad flag.

Definition at line 157 of file CTBxmlOStream.cxx.

bool CTBxmlOStream::Fail const
 

State check: fail flag.

Definition at line 165 of file CTBxmlOStream.cxx.

Referenced by operator void *(), and operator!().

bool CTBxmlOStream::Eof const
 

State check: eof flag.

Definition at line 174 of file CTBxmlOStream.cxx.

void CTBxmlOStream::PutStartTag const char * c_name
 

Write start tag.

Definition at line 183 of file CTBxmlOStream.cxx.

Referenced by PutTaggedValue(), CTBattrList::ToXStream(), and operator<<().

void CTBxmlOStream::PutEmptyTag const char * c_name
 

Write empty tag.

Definition at line 203 of file CTBxmlOStream.cxx.

Referenced by operator<<().

void CTBxmlOStream::PutEndTag
 

Write end tag.

Definition at line 222 of file CTBxmlOStream.cxx.

Referenced by Close(), PutTaggedValue(), CTBattrList::ToXStream(), and operator<<().

void CTBxmlOStream::PutTaggedValue const char * c_name,
int i_value,
const char * c_format = 0,
int i_width = 0
 

Write int value i_value in tag-endtag brackets.

Definition at line 247 of file CTBxmlOStream.cxx.

Referenced by CTBattrList::ToXStream().

void CTBxmlOStream::PutTaggedValue const char * c_name,
unsigned int i_value,
const char * c_format = 0,
int i_width = 0
 

Write unsigned int value i_value in tag-endtag brackets.

Definition at line 264 of file CTBxmlOStream.cxx.

void CTBxmlOStream::PutTaggedValue const char * c_name,
long i_value,
const char * c_format = 0,
int i_width = 0
 

Write long value i_value in tag-endtag brackets.

Definition at line 282 of file CTBxmlOStream.cxx.

void CTBxmlOStream::PutTaggedValue const char * c_name,
unsigned long i_value,
const char * c_format = 0,
int i_width = 0
 

Write unsigned long value i_value in tag-endtag brackets.

Definition at line 299 of file CTBxmlOStream.cxx.

void CTBxmlOStream::PutTaggedValue const char * c_name,
double d_value,
const char * c_format = 0,
int i_width = 0,
int i_precision = 0
 

Write double value d_value in tag-endtag brackets.

Definition at line 317 of file CTBxmlOStream.cxx.

void CTBxmlOStream::PutTaggedValue const char * c_name,
const char * c_value,
bool b_dropempty = false
 

Write char string value c_value in tag-endtag brackets.

Definition at line 336 of file CTBxmlOStream.cxx.

void CTBxmlOStream::PutTaggedValue const char * c_name,
const CTBstring & value,
bool b_dropempty = false
 

Write CTBstring string value value in tag-endtag brackets.

Definition at line 355 of file CTBxmlOStream.cxx.

void CTBxmlOStream::PutTaggedValue const char * c_name,
const CTBtime & value,
bool b_dropempty = false
 

Write CTBtime time value value in tag-endtag brackets.

Definition at line 374 of file CTBxmlOStream.cxx.

ostream * CTBxmlOStream::Stream const [inline]
 

Access ostream pointer (INTERNAL).

Definition at line 19 of file CTBxmlOStream.icc.

Referenced by operator<<().

void CTBxmlOStream::SetBad [inline]
 

Set bad overwrite flag (INTERNAL).

Definition at line 29 of file CTBxmlOStream.icc.

Referenced by PutEmptyTag(), PutEndTag(), PutStartTag(), PutTaggedValue(), operator<<(), and operator<<().

void CTBxmlOStream::SetFail [inline]
 

Set fail overwrite flag (INTERNAL).

Definition at line 41 of file CTBxmlOStream.icc.

Referenced by PutEndTag().

void CTBxmlOStream::Dump int i_indent = 0,
ostream & os = cout,
const char * p_text = 0
const
 

Dump.

Definition at line 393 of file CTBxmlOStream.cxx.

bool CTBxmlOStream::operator! const [inline]
 

Negation operator, returns true if stream in fail state.

Definition at line 50 of file CTBxmlOStream.icc.

CTBxmlOStream::operator void * const [inline]
 

Returns non-zero pointer if stream NOT in fail state.

Definition at line 58 of file CTBxmlOStream.icc.

CTBxmlOStream & CTBxmlOStream::operator<< const char * c_text
 

Write string.

Definition at line 415 of file CTBxmlOStream.cxx.

Referenced by operator<<().

CTBxmlOStream & CTBxmlOStream::operator<< char * c_text [inline]
 

Write string.

This form is needed for string literals, which have the type `array of char' and are thus unfortunately for some historical reason `non-const'.

Definition at line 70 of file CTBxmlOStream.icc.

CTBxmlOStream & CTBxmlOStream::operator<< const CTBxmlStartTag & tag [inline]
 

Write start tag.

Definition at line 78 of file CTBxmlOStream.icc.

CTBxmlOStream & CTBxmlOStream::operator<< const CTBxmlEmptyTag & tag [inline]
 

Write empty tag.

Definition at line 87 of file CTBxmlOStream.icc.

CTBxmlOStream & CTBxmlOStream::operator<< const CTBxmlEndTag & tag [inline]
 

Write end tag.

Definition at line 96 of file CTBxmlOStream.icc.

void CTBxmlOStream::PutEscapedString const char * c_text,
CTBint i_length = -1
[private]
 

Write string and escape '<', '>', and '&'.

Definition at line 426 of file CTBxmlOStream.cxx.

Referenced by PutEscapedString(), PutTaggedValue(), and operator<<().

void CTBxmlOStream::PutEscapedString const CTBstring & string [private]
 

Write string and escape '<', '>', and '&'.

Definition at line 447 of file CTBxmlOStream.cxx.


Member Data Documentation

ostream* CTBxmlOStream::mp_os [private]
 

output stream pointer.

Definition at line 99 of file CTBxmlOStream.hxx.

bool CTBxmlOStream::mb_attached [private]
 

true if stream attached.

Definition at line 100 of file CTBxmlOStream.hxx.

bool CTBxmlOStream::mb_autonewline [private]
 

add
before tag if true.

Definition at line 101 of file CTBxmlOStream.hxx.

bool CTBxmlOStream::mb_autoindent [private]
 

indent tag if true.

Definition at line 102 of file CTBxmlOStream.hxx.

bool CTBxmlOStream::mb_bad [private]
 

if true forces bad state.

Definition at line 103 of file CTBxmlOStream.hxx.

bool CTBxmlOStream::mb_fail [private]
 

if true forces fail state.

Definition at line 104 of file CTBxmlOStream.hxx.

int CTBxmlOStream::mi_lasttag [private]
 

type of last tag.

Definition at line 105 of file CTBxmlOStream.hxx.

CTBstack<CTBstring> CTBxmlOStream::m_tagstack [private]
 

stack of parent tags.

Definition at line 106 of file CTBxmlOStream.hxx.


The documentation for this class was generated from the following files:
Generated at Fri Oct 24 18:14:15 2003 for CTBbase by doxygen1.2.9-20010812 written by Dimitri van Heesch, © 1997-2001