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

CTBattrList Class Reference

Key-value attribute list. **. More...

#include "CTBattrList.hxx"

Collaboration diagram for CTBattrList:

Collaboration graph
[legend]
List of all members.

Public Methods

 CTBattrList ()
 ~CTBattrList ()
void Set (const char *c_key, const char *c_value)
void Set (const char *c_key, const CTBstring &value)
CTBint Size () const
void Clear ()
void ToStream (ostream &os) const
void ToXStream (CTBxmlOStream &xos, const char *c_name="CTBattrList") const
void FromXStream (CTBxmlIStream &xis, const char *c_name="CTBattrList")
const CTBstringoperator[] (CTBint i_ind) const
const CTBstringoperator[] (const char *c_key) const
const CTBstringoperator[] (const CTBstring &key) const
bool operator! () const
 operator void * () const

Private Methods

CTBint Find (const char *c_key) const
CTBint Find (const CTBstring &key) const
CTBint FindOrCreate (const char *c_key)
CTBint FindOrCreate (const CTBstring &key)

Private Attributes

CTBvector< CTBpair< CTBstring,
CTBstring > > 
m_attrlist

Related Functions

(Note that these are not member functions.)

ostream & operator<< (ostream &os, const CTBattrList &obj)
CTBxmlOStreamoperator<< (CTBxmlOStream &xos, const CTBattrList &obj)
CTBxmlIStreamoperator>> (CTBxmlIStream &xis, CTBattrList &obj)

Detailed Description

Key-value attribute list. **.

Todo:
2001-01-28 Implement hash access and int,float,CTBtime,ect converters.

Definition at line 22 of file CTBattrList.hxx.


Constructor & Destructor Documentation

CTBattrList::CTBattrList
 

Default constructor.

Definition at line 27 of file CTBattrList.cxx.

CTBattrList::~CTBattrList
 

Destructor.

Definition at line 33 of file CTBattrList.cxx.


Member Function Documentation

void CTBattrList::Set const char * c_key,
const char * c_value
 

Set attribute with key c_key to c_value.

Definition at line 39 of file CTBattrList.cxx.

void CTBattrList::Set const char * c_key,
const CTBstring & value
 

Set attribute with key c_key to value.

Definition at line 48 of file CTBattrList.cxx.

CTBint CTBattrList::Size const [inline]
 

Returns number of attribute keys.

Definition at line 17 of file CTBattrList.icc.

void CTBattrList::Clear
 

Delete all attributes.

Definition at line 57 of file CTBattrList.cxx.

Referenced by FromXStream().

void CTBattrList::ToStream ostream & os const
 

ostream insertion.

Definition at line 66 of file CTBattrList.cxx.

Referenced by operator<<().

void CTBattrList::ToXStream CTBxmlOStream & xos,
const char * c_name = "CTBattrList"
const
 

XML ostream insertion.

Definition at line 77 of file CTBattrList.cxx.

Referenced by operator<<().

void CTBattrList::FromXStream CTBxmlIStream & xis,
const char * c_name = "CTBattrList"
 

XML istream extraction.

Definition at line 99 of file CTBattrList.cxx.

Referenced by operator>>().

const CTBstring & CTBattrList::operator[] CTBint i_ind const
 

Returns value of i_ind 'th attribute.

Definition at line 129 of file CTBattrList.cxx.

const CTBstring & CTBattrList::operator[] const char * c_key const
 

Returns value of attribute with key c_key.

Definition at line 138 of file CTBattrList.cxx.

const CTBstring & CTBattrList::operator[] const CTBstring & key const
 

Returns value of attribute with key c_key.

Definition at line 147 of file CTBattrList.cxx.

bool CTBattrList::operator! const [inline]
 

Negation operator, returns true if list is empty.

Definition at line 25 of file CTBattrList.icc.

CTBattrList::operator void * const [inline]
 

Returns non-zero pointer if list is non-empty.

Definition at line 33 of file CTBattrList.icc.

CTBint CTBattrList::Find const char * c_key const [private]
 

Returns index of attribute with key c_key or -1 of none defined.

Definition at line 156 of file CTBattrList.cxx.

Referenced by Find(), FindOrCreate(), and operator[]().

CTBint CTBattrList::Find const CTBstring & key const [private]
 

Returns index of attribute with key key or -1 of none defined.

Definition at line 167 of file CTBattrList.cxx.

CTBint CTBattrList::FindOrCreate const char * c_key [private]
 

Returns index of attribute with key c_key. Creates key if none available.

Definition at line 175 of file CTBattrList.cxx.

Referenced by FindOrCreate(), FromXStream(), and Set().

CTBint CTBattrList::FindOrCreate const CTBstring & key [private]
 

Returns index of attribute with key key. Creates key if none available.

Definition at line 188 of file CTBattrList.cxx.


Friends And Related Function Documentation

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

ostream insertion (see CTBattrList::ToStream() ).

Definition at line 44 of file CTBattrList.icc.

CTBxmlOStream & operator<< CTBxmlOStream & xos,
const CTBattrList & obj
[related]
 

XML ostream insertion operator (see CTBattrList::ToXStream() ).

Definition at line 56 of file CTBattrList.icc.

CTBxmlIStream & operator>> CTBxmlIStream & xis,
CTBattrList & obj
[related]
 

XML istream extraction operator (see CTBattrList::FromXStream() ).

Definition at line 68 of file CTBattrList.icc.


Member Data Documentation

CTBvector<CTBpair<CTBstring, CTBstring> > CTBattrList::m_attrlist [private]
 

Definition at line 57 of file CTBattrList.hxx.


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