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

CTBxmlIStream Class Reference

XML input stream **. More...

#include "CTBxmlIStream.hxx"

Collaboration diagram for CTBxmlIStream:

Collaboration graph
[legend]
List of all members.

Public Methods

 CTBxmlIStream ()
 CTBxmlIStream (istream *p_is)
 CTBxmlIStream (const char *c_filename, int i_mode=ios::in, int i_prot=0664)
virtual ~CTBxmlIStream ()
void Attach (istream *p_is)
void Open (const char *c_filename, int i_mode=ios::in, int i_prot=0664)
void Close ()
bool Good () const
bool Bad () const
bool Fail () const
bool Eof () const
bool Eod () const
void TrimWhite (bool b_trim)
void DropWhite (bool b_drop)
bool TrimWhite () const
bool DropWhite () const
void Get (CTBxmlToken &token)
void GetTagOrData (CTBxmlToken &token)
void GetTagOrNonWhiteData (CTBxmlToken &token)
void Unget (CTBxmlToken &token)
const CTBxmlTokenPeek ()
const CTBxmlTokenPeekTagOrData ()
const CTBxmlTokenPeekTagOrNonWhiteData ()
bool NextNotEnd ()
bool CheckElement (const char *c_name)
void GetTaggedValue (const char *c_name, int &i_value)
void GetTaggedValue (const char *c_name, float &f_value)
void GetTaggedValue (const char *c_name, double &d_value)
void GetTaggedValue (const char *c_name, CTBstring &value)
void GetTaggedValue (const char *c_name, CTBtime &value)
void OpenElement (const char *c_name=0)
void CloseElement ()
void DropElement ()
istream * GetDataStream ()
void ToStream (ostream &os) const
void Dump (int i_indent=0, ostream &os=cout, const char *p_text=0) const
bool operator! () const
 operator void * () const
CTBxmlIStream & operator>> (CTBxmlToken &token)
CTBxmlIStream & operator>> (const CTBxmlOpen &manip)
CTBxmlIStream & operator>> (const CTBxmlClose &manip)

Private Methods

void GetDataFromLexer (CTBxmlToken &token)
void GetTagFromLexer (CTBxmlToken &token)
void SetFail (const char *c_message)
const CTBxmlTokenFailToken () const
CTBstring ConvertCharRef (const CTBstring &cref)
CTBstring ConvertEntityRef (const CTBstring &eref)
int GetLexerToken (int i_lexmode, CTBxmlToken &token)

Private Attributes

istream * mp_is
bool mb_attached
bool mb_trimwhite
bool mb_dropwhite
bool mb_fail
bool mb_bad
bool mb_eof
istrstream * mp_iss
CTBstring m_data
CTBvector< CTBstringm_tagstack
CTBint mi_taglevel
CTBxmlToken m_untoken
CTBxmlToken m_token
CTBxmlLexer m_lex
CTBxmlLexerToken m_lextoken

Related Functions

(Note that these are not member functions.)

template<class T> CTBxmlIStream & operator>> (CTBxmlIStream &xis, T &obj)
ostream & operator<< (ostream &os, const CTBxmlIStream &obj)

Detailed Description

XML input stream **.

Definition at line 89 of file CTBxmlIStream.hxx.


Constructor & Destructor Documentation

CTBxmlIStream::CTBxmlIStream
 

Default constructor.

Definition at line 216 of file CTBxmlIStream.cxx.

CTBxmlIStream::CTBxmlIStream istream * p_is [explicit]
 

Construct with attached stream.

Definition at line 236 of file CTBxmlIStream.cxx.

CTBxmlIStream::CTBxmlIStream const char * c_filename,
int i_mode = ios::in,
int i_prot = 0664
[explicit]
 

Construct with a file.

Definition at line 256 of file CTBxmlIStream.cxx.

CTBxmlIStream::~CTBxmlIStream [virtual]
 

Virtual destructor.

Definition at line 277 of file CTBxmlIStream.cxx.


Member Function Documentation

void CTBxmlIStream::Attach istream * p_is
 

Attach external stream.

Definition at line 286 of file CTBxmlIStream.cxx.

Referenced by Open().

void CTBxmlIStream::Open const char * c_filename,
int i_mode = ios::in,
int i_prot = 0664
 

open stream.

Definition at line 299 of file CTBxmlIStream.cxx.

Referenced by CTBxmlIStream().

void CTBxmlIStream::Close
 

close stream.

Definition at line 322 of file CTBxmlIStream.cxx.

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

bool CTBxmlIStream::Good const [inline]
 

State check: good flag.

Definition at line 103 of file CTBxmlIStream.icc.

Referenced by ToStream().

bool CTBxmlIStream::Bad const [inline]
 

State check: bad flag.

Definition at line 111 of file CTBxmlIStream.icc.

bool CTBxmlIStream::Fail const [inline]
 

State check: fail flag.

Definition at line 118 of file CTBxmlIStream.icc.

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

bool CTBxmlIStream::Eof const [inline]
 

State check: eof flag.

Definition at line 126 of file CTBxmlIStream.icc.

Referenced by ToStream().

bool CTBxmlIStream::Eod const [inline]
 

State check: eod flag.

Definition at line 134 of file CTBxmlIStream.icc.

void CTBxmlIStream::TrimWhite bool b_trim [inline]
 

If b_trim is true: trim white space of data, drop white-only data.

Definition at line 142 of file CTBxmlIStream.icc.

void CTBxmlIStream::DropWhite bool b_drop [inline]
 

If b_drop is true: drop white-only data.

Definition at line 151 of file CTBxmlIStream.icc.

bool CTBxmlIStream::TrimWhite const [inline]
 

Returns true if trimming of white space is enabled.

Definition at line 160 of file CTBxmlIStream.icc.

Referenced by Get().

bool CTBxmlIStream::DropWhite const [inline]
 

Returns true if droping of white-only space is enabled.

Definition at line 168 of file CTBxmlIStream.icc.

void CTBxmlIStream::Get CTBxmlToken & token
 

Get next token.

Definition at line 346 of file CTBxmlIStream.cxx.

Referenced by CloseElement(), GetTagOrData(), GetTaggedValue(), Peek(), and operator>>().

void CTBxmlIStream::GetTagOrData CTBxmlToken & token
 

Get next tag or data token.

Definition at line 405 of file CTBxmlIStream.cxx.

Referenced by GetDataStream(), GetTagOrNonWhiteData(), GetTaggedValue(), and PeekTagOrData().

void CTBxmlIStream::GetTagOrNonWhiteData CTBxmlToken & token
 

Get next tag or non-white data token.

Definition at line 420 of file CTBxmlIStream.cxx.

Referenced by OpenElement(), and PeekTagOrNonWhiteData().

void CTBxmlIStream::Unget CTBxmlToken & token
 

Unget token.

The token is effectively `pushed back' into the input stream and will be re-delivered with the next Get() or operator>>() . Note, that it is only allowed to Unget() the last recently gotten token.

The token is cleared by this method and shouldn't be used afterwards.

Definition at line 441 of file CTBxmlIStream.cxx.

Referenced by GetDataStream(), GetTaggedValue(), OpenElement(), Peek(), PeekTagOrData(), and PeekTagOrNonWhiteData().

const CTBxmlToken & CTBxmlIStream::Peek
 

Returns a read-only reference to the next token in the stream.

Definition at line 461 of file CTBxmlIStream.cxx.

const CTBxmlToken & CTBxmlIStream::PeekTagOrData
 

Returns a read-only reference to the next tag or data token.

Definition at line 477 of file CTBxmlIStream.cxx.

const CTBxmlToken & CTBxmlIStream::PeekTagOrNonWhiteData
 

Returns a read-only reference to the next tag or non-white data token.

Definition at line 496 of file CTBxmlIStream.cxx.

Referenced by CheckElement(), CTBattrList::FromXStream(), and NextNotEnd().

bool CTBxmlIStream::NextNotEnd [inline]
 

Returns true if next tag or non-white data token is not an end tag.

Definition at line 176 of file CTBxmlIStream.icc.

Referenced by CTBattrList::FromXStream().

bool CTBxmlIStream::CheckElement const char * c_name
 

Returns true if next token is start tag and name equals c_name .

Definition at line 517 of file CTBxmlIStream.cxx.

void CTBxmlIStream::GetTaggedValue const char * c_name,
int & i_value
 

Definition at line 530 of file CTBxmlIStream.cxx.

Referenced by CTBattrList::FromXStream().

void CTBxmlIStream::GetTaggedValue const char * c_name,
float & f_value
 

Definition at line 553 of file CTBxmlIStream.cxx.

void CTBxmlIStream::GetTaggedValue const char * c_name,
double & d_value
 

Definition at line 576 of file CTBxmlIStream.cxx.

void CTBxmlIStream::GetTaggedValue const char * c_name,
CTBstring & value
 

Definition at line 599 of file CTBxmlIStream.cxx.

void CTBxmlIStream::GetTaggedValue const char * c_name,
CTBtime & value
 

Definition at line 624 of file CTBxmlIStream.cxx.

void CTBxmlIStream::OpenElement const char * c_name = 0
 

Opens an element.

Definition at line 638 of file CTBxmlIStream.cxx.

Referenced by DropElement(), CTBattrList::FromXStream(), GetTaggedValue(), and operator>>().

void CTBxmlIStream::CloseElement
 

Closes current element.

Definition at line 656 of file CTBxmlIStream.cxx.

Referenced by DropElement(), CTBattrList::FromXStream(), GetTaggedValue(), and operator>>().

void CTBxmlIStream::DropElement
 

Drop next element.

Definition at line 669 of file CTBxmlIStream.cxx.

Referenced by CTBattrList::FromXStream().

istream * CTBxmlIStream::GetDataStream
 

Returns a strstream with the last cdata value.

Definition at line 680 of file CTBxmlIStream.cxx.

Referenced by operator>>().

void CTBxmlIStream::ToStream ostream & os const
 

ostream insertion.

Definition at line 712 of file CTBxmlIStream.cxx.

Referenced by operator<<().

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

Dump.

Definition at line 743 of file CTBxmlIStream.cxx.

bool CTBxmlIStream::operator! const [inline]
 

Negation operator, returns true if stream in fail state.

Definition at line 187 of file CTBxmlIStream.icc.

CTBxmlIStream::operator void * const [inline]
 

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

Definition at line 195 of file CTBxmlIStream.icc.

CTBxmlIStream & CTBxmlIStream::operator>> CTBxmlToken & token [inline]
 

extract a token from input stream (see Get() ).

Definition at line 203 of file CTBxmlIStream.icc.

CTBxmlIStream & CTBxmlIStream::operator>> const CTBxmlOpen & manip [inline]
 

expect a start tag (see OpenElement() ).

Definition at line 212 of file CTBxmlIStream.icc.

CTBxmlIStream & CTBxmlIStream::operator>> const CTBxmlClose & manip [inline]
 

Expect an end tag (see CloseElement() ).

Definition at line 221 of file CTBxmlIStream.icc.

void CTBxmlIStream::GetDataFromLexer CTBxmlToken & token [private]
 

Get next token: expect data.

Definition at line 772 of file CTBxmlIStream.cxx.

Referenced by Get().

void CTBxmlIStream::GetTagFromLexer CTBxmlToken & token [private]
 

Get next token: expect tag.

Definition at line 826 of file CTBxmlIStream.cxx.

Referenced by Get().

void CTBxmlIStream::SetFail const char * c_message [private]
 

Set fail state bit.

Definition at line 996 of file CTBxmlIStream.cxx.

Referenced by Get(), GetDataStream(), GetTaggedValue(), and OpenElement().

const CTBxmlToken & CTBxmlIStream::FailToken const [private]
 

Returns const reference to a token in state fail.

Definition at line 1007 of file CTBxmlIStream.cxx.

Referenced by Peek(), PeekTagOrData(), and PeekTagOrNonWhiteData().

CTBstring CTBxmlIStream::ConvertCharRef const CTBstring & cref [private]
 

Convert a character reference.

Definition at line 1017 of file CTBxmlIStream.cxx.

Referenced by GetDataFromLexer(), and GetTagFromLexer().

CTBstring CTBxmlIStream::ConvertEntityRef const CTBstring & eref [private]
 

Convert a entity reference.

Definition at line 1026 of file CTBxmlIStream.cxx.

Referenced by GetDataFromLexer(), and GetTagFromLexer().

int CTBxmlIStream::GetLexerToken int i_lexmode,
CTBxmlToken & token
[private]
 

Combo: set lexer mode, get lexer token, add text to token, returns type.

Definition at line 1043 of file CTBxmlIStream.cxx.

Referenced by GetDataFromLexer(), and GetTagFromLexer().


Friends And Related Function Documentation

template<class T>
CTBxmlIStream & operator>> CTBxmlIStream & xis,
T & obj
[related]
 

xistream extraction operator.

Definition at line 234 of file CTBxmlIStream.icc.

ostream & operator<< ostream & os,
const CTBxmlIStream & obj
[related]
 

ostream insertion operator.

Definition at line 247 of file CTBxmlIStream.icc.


Member Data Documentation

istream* CTBxmlIStream::mp_is [private]
 

input stream pointer.

Definition at line 169 of file CTBxmlIStream.hxx.

bool CTBxmlIStream::mb_attached [private]
 

true if stream attached.

Definition at line 170 of file CTBxmlIStream.hxx.

bool CTBxmlIStream::mb_trimwhite [private]
 

trim white space of data.

Definition at line 171 of file CTBxmlIStream.hxx.

bool CTBxmlIStream::mb_dropwhite [private]
 

drop white space only data.

Definition at line 172 of file CTBxmlIStream.hxx.

bool CTBxmlIStream::mb_fail [private]
 

state: operation failed.

Definition at line 173 of file CTBxmlIStream.hxx.

bool CTBxmlIStream::mb_bad [private]
 

state: major stream error.

Definition at line 174 of file CTBxmlIStream.hxx.

bool CTBxmlIStream::mb_eof [private]
 

state: end-of-file.

Definition at line 175 of file CTBxmlIStream.hxx.

istrstream* CTBxmlIStream::mp_iss [private]
 

string stream for cdata.

Definition at line 176 of file CTBxmlIStream.hxx.

CTBstring CTBxmlIStream::m_data [private]
 

holds text if cdata token.

Definition at line 177 of file CTBxmlIStream.hxx.

CTBvector<CTBstring> CTBxmlIStream::m_tagstack [private]
 

stack of parent tags.

Definition at line 178 of file CTBxmlIStream.hxx.

CTBint CTBxmlIStream::mi_taglevel [private]
 

tag nesting level.

Definition at line 179 of file CTBxmlIStream.hxx.

CTBxmlToken CTBxmlIStream::m_untoken [private]
 

ungotten token.

Definition at line 180 of file CTBxmlIStream.hxx.

CTBxmlToken CTBxmlIStream::m_token [private]
 

`current' token.

Definition at line 181 of file CTBxmlIStream.hxx.

CTBxmlLexer CTBxmlIStream::m_lex [private]
 

lexer.

Definition at line 182 of file CTBxmlIStream.hxx.

CTBxmlLexerToken CTBxmlIStream::m_lextoken [private]
 

lexer token.

Definition at line 183 of file CTBxmlIStream.hxx.


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