RDBComment Class Reference

Provides interface for manipulating RDB comments. More...

#include <RDBComment.h>

List of all members.

Public Member Functions

Constructing, destructing, and initializing RDBComment objects.
 RDBComment (const string &comment="") throw ( RDBErr )
 Parses comment string for RDB comment structure.
 RDBComment (const RDBComment &rdbcomment)
 Copy RDBComment object.
 ~RDBComment (void)
 Destructor has nothing to do.
const RDBCommentoperator= (const RDBComment &rdbcomment)
 Copy RDBComment object.
const RDBCommentoperator= (const string &rdbcomment)
 Copy string to RDBComment object.
Data member initializers.
void setComment (const string &comment) throw ( RDBErr )
 Parses comment string for RDB comment elements.
void setCommentText (const string &comment)
 Parses string for RDB comment elements.
void setKeyword (const string &keyword) throw ( RDBErr )
 Set just the comment keyword.
void setValue (const string &value) throw ( RDBErr )
 Set just the comment value.
Data member accessors.
string getComment (void) const
 Return the full comment.
string getCommentText (void) const
 Return the full comment text.
string getKeyword (void) const
 Return the keyword, if any.
string getValue (void) const
 Return the keyword's value, if any.

Friends

Stream insertion and extraction operators.
istream & operator>> (istream &is, RDBComment &rdbcomment) throw ( RDBErr )
 Read comment from input stream.
ostream & operator<< (ostream &os, const RDBComment &rdbcomment)
 Write comment to output stream.


Detailed Description

Provides interface for manipulating RDB comments.

Definition at line 35 of file RDBComment.h.


Constructor & Destructor Documentation

RDBComment::RDBComment ( const string &  comment = ""  )  throw ( RDBErr )

Parses comment string for RDB comment structure.

Parameters:
comment the comment string.
Assigns the string comment to the RDBComment's data member. Parses for keyword=value pairs.

Definition at line 102 of file RDBComment.cc.

RDBComment::RDBComment ( const RDBComment rdbcomment  ) 

Copy RDBComment object.

Parameters:
rdbcomment a reference to the RDBComment to copy.
Copies the RDBComment into this object.

Definition at line 125 of file RDBComment.cc.

References operator=().

RDBComment::~RDBComment ( void   ) 

Destructor has nothing to do.

Nothing to do.

Definition at line 137 of file RDBComment.cc.


Member Function Documentation

const RDBComment & RDBComment::operator= ( const RDBComment rdbcomment  ) 

Copy RDBComment object.

Parameters:
rdbcomment a reference to the RDBComment to copy.
Returns:
A reference to this.

Definition at line 150 of file RDBComment.cc.

References _comment, _keyword, and _value.

Referenced by RDBComment().

const RDBComment & RDBComment::operator= ( const string &  comment  ) 

Copy string to RDBComment object.

Parameters:
comment a string comment to copy.
Returns:
A reference to this.

Definition at line 172 of file RDBComment.cc.

References setCommentText().

void RDBComment::setComment ( const string &  comment  )  throw ( RDBErr )

Parses comment string for RDB comment elements.

Parameters:
comment Strips leading '#' character if present. If next character is ':', then it searches for a keyword=value pair.

Definition at line 190 of file RDBComment.cc.

References setCommentText().

Referenced by setKeyword(), and setValue().

void RDBComment::setCommentText ( const string &  comment  ) 

Parses string for RDB comment elements.

Parameters:
comment Strips leading '#' character if present. If next character is ':', then it searches for a keyword=value pair.

Definition at line 222 of file RDBComment.cc.

Referenced by operator=(), and setComment().

void RDBComment::setKeyword ( const string &  keyword  )  throw ( RDBErr )

Set just the comment keyword.

Parameters:
keyword the keyword part of a keyword=value pair.
Updates just the keyword half of a keyword=value pair.

Definition at line 278 of file RDBComment.cc.

References setComment().

void RDBComment::setValue ( const string &  value  )  throw ( RDBErr )

Set just the comment value.

Parameters:
value the value part of a keyword=value pair.
Updates just the value half of a keyword=value pair.

Definition at line 302 of file RDBComment.cc.

References setComment().

string RDBComment::getComment ( void   )  const

Return the full comment.

Returns:
The comment string.

Definition at line 324 of file RDBComment.cc.

string RDBComment::getCommentText ( void   )  const

Return the full comment text.

Returns:
The comment string.

Definition at line 346 of file RDBComment.cc.

string RDBComment::getKeyword ( void   )  const

Return the keyword, if any.

Returns:
The keyword half of a keyword=value pair.

Definition at line 359 of file RDBComment.cc.

string RDBComment::getValue ( void   )  const

Return the keyword's value, if any.

Returns:
The value half of a keyword=value pair.

Definition at line 372 of file RDBComment.cc.


Friends And Related Function Documentation

istream& operator>> ( istream &  is,
RDBComment rdbcomment 
) throw ( RDBErr ) [friend]

Read comment from input stream.

Parameters:
is the input stream.
rdbcomment the comment to fill.
Returns:
A reference to the input stream.
If the line is an RDB comment line, i.e. it starts with a '#', then fill the comment. Otherwise, set ios::failbit.

Definition at line 38 of file RDBComment.cc.

ostream& operator<< ( ostream &  os,
const RDBComment rdbcomment 
) [friend]

Write comment to output stream.

Parameters:
os the output stream.
rdbcomment the comment to print.
Returns:
A reference to the output stream
Places the comment on the output stream. Appends a '#' character if its a plain comment or a "#:" string if its a keyword/value comment.

Definition at line 73 of file RDBComment.cc.


The documentation for this class was generated from the following files:

Generated on Tue Sep 15 11:07:30 2009 for rdbxx by  doxygen 1.5.6