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

CTBline Class Reference

Represents a line of a command or configuration file. **. More...

#include "CTBline.hxx"

Collaboration diagram for CTBline:

Collaboration graph
[legend]
List of all members.

Public Methods

 CTBline ()
 ~CTBline ()
void Set (const char *c_line)
const char * Get () const
void ContinueLine (bool b_continue)
void CommentDelimiter (char c_comment)
void TrimWhite (bool b_trim)
void ToLowerCase (bool b_lower)
void SkipEmpty (bool b_skip)
bool ContinueLine () const
char CommentDelimiter () const
bool TrimWhite () const
bool ToLowerCase () const
bool SkipEmpty () const
bool Good ()
bool Fail ()
bool Bad ()
bool Eof ()
void FromStream (istream &is)
istrstream & GetStream ()
bool operator! () const
 operator void * () const

Private Methods

void SetupString ()
void SetupStream ()

Private Attributes

CTBstring m_string
bool mb_streamvalid
istrstream m_stream
bool mb_continue
char mc_comment
bool mb_trimwhite
bool mb_tolower
bool mb_skipempty

Related Functions

(Note that these are not member functions.)

ostream & operator<< (ostream &os, const CTBline &obj)
istream & operator>> (istream &is, CTBline &obj)
template<class T> CTBline & operator>> (CTBline &line, T &obj)

Detailed Description

Represents a line of a command or configuration file. **.

Todo:
implement continuation line and comment handling

Definition at line 20 of file CTBline.hxx.


Constructor & Destructor Documentation

CTBline::CTBline
 

Default constructor.

Definition at line 27 of file CTBline.cxx.

CTBline::~CTBline
 

Destructor.

Definition at line 40 of file CTBline.cxx.


Member Function Documentation

void CTBline::Set const char * c_line
 

Set line to c_line.

Definition at line 46 of file CTBline.cxx.

const char * CTBline::Get const [inline]
 

Access line as const char* .

Definition at line 17 of file CTBline.icc.

Referenced by operator<<().

void CTBline::ContinueLine bool b_continue [inline]
 

A backslash-newline will start a continuation line.

Definition at line 25 of file CTBline.icc.

void CTBline::CommentDelimiter char c_comment [inline]
 

All characters after c_comment are discarted.

Definition at line 34 of file CTBline.icc.

void CTBline::TrimWhite bool b_trim [inline]
 

Leading and trailing white space will be trimmed if b_trim is true .

Definition at line 43 of file CTBline.icc.

void CTBline::ToLowerCase bool b_lower [inline]
 

All characters will be converted to lower case if b_lower is true .

Definition at line 52 of file CTBline.icc.

void CTBline::SkipEmpty bool b_skip [inline]
 

Empty lines will be skipped if b_skip is true .

Definition at line 61 of file CTBline.icc.

bool CTBline::ContinueLine const [inline]
 

Returns true if a backslash-newline will start a continuation line.

Definition at line 70 of file CTBline.icc.

char CTBline::CommentDelimiter const [inline]
 

Returns comment delimiter.

Definition at line 78 of file CTBline.icc.

bool CTBline::TrimWhite const [inline]
 

Returns true if white space will be trimmed.

Definition at line 86 of file CTBline.icc.

bool CTBline::ToLowerCase const [inline]
 

Returns true if all characters will be converted to lower case.

Definition at line 94 of file CTBline.icc.

bool CTBline::SkipEmpty const [inline]
 

Returns true if empty lines will be skipped.

Definition at line 102 of file CTBline.icc.

bool CTBline::Good [inline]
 

Returns true if stream state is good .

Definition at line 110 of file CTBline.icc.

bool CTBline::Fail [inline]
 

Returns true if stream state is fail .

Definition at line 118 of file CTBline.icc.

bool CTBline::Bad [inline]
 

Returns true if stream state is bad .

Definition at line 126 of file CTBline.icc.

bool CTBline::Eof [inline]
 

Returns true if stream state is eof .

Definition at line 134 of file CTBline.icc.

void CTBline::FromStream istream & is
 

Read a new line from input stream is. INTERNAL.

Definition at line 58 of file CTBline.cxx.

Referenced by operator>>().

istrstream & CTBline::GetStream [inline]
 

Access internal string stream representation of line. INTERNAL.

Definition at line 144 of file CTBline.icc.

Referenced by Bad(), Eof(), Fail(), Good(), and operator>>().

bool CTBline::operator! const [inline]
 

Returns true if stream is in fail state.

Definition at line 153 of file CTBline.icc.

CTBline::operator void * const [inline]
 

Returns true if stream NOT in fail state.

Definition at line 161 of file CTBline.icc.

void CTBline::SetupString [private]
 

Perform transformations of the input characters (like trim and casing).

Definition at line 71 of file CTBline.cxx.

Referenced by FromStream(), and Set().

void CTBline::SetupStream [private]
 

Convert line into a string stream.

Definition at line 82 of file CTBline.cxx.

Referenced by GetStream().


Friends And Related Function Documentation

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

ostream insertion.

Definition at line 172 of file CTBline.icc.

istream & operator>> istream & is,
CTBline & obj
[related]
 

istream extraction.

Definition at line 184 of file CTBline.icc.

template<class T>
CTBline & operator>> CTBline & line,
T & obj
[related]
 

extract object obj of type T from a CTBline .

Definition at line 197 of file CTBline.icc.


Member Data Documentation

CTBstring CTBline::m_string [private]
 

Definition at line 58 of file CTBline.hxx.

bool CTBline::mb_streamvalid [private]
 

Definition at line 60 of file CTBline.hxx.

istrstream CTBline::m_stream [private]
 

Definition at line 61 of file CTBline.hxx.

bool CTBline::mb_continue [private]
 

Definition at line 63 of file CTBline.hxx.

char CTBline::mc_comment [private]
 

Definition at line 64 of file CTBline.hxx.

bool CTBline::mb_trimwhite [private]
 

Definition at line 65 of file CTBline.hxx.

bool CTBline::mb_tolower [private]
 

Definition at line 66 of file CTBline.hxx.

bool CTBline::mb_skipempty [private]
 

Definition at line 67 of file CTBline.hxx.


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