rdbxx
1.0.7_02
|
Provides interface for manipulating RDB comments. More...
#include <RDBComment.h>
Public Member Functions | |
Constructing, destructing, and initializing RDBComment objects. | |
RDBComment (const string &comment="") | |
Parses comment string for RDB comment structure. More... | |
RDBComment (const RDBComment &rdbcomment) | |
Copy RDBComment object. More... | |
~RDBComment (void) | |
Destructor has nothing to do. More... | |
const RDBComment & | operator= (const RDBComment &rdbcomment) |
Copy RDBComment object. More... | |
const RDBComment & | operator= (const string &rdbcomment) |
Copy string to RDBComment object. More... | |
Data member initializers. | |
void | setComment (const string &comment) |
Parses comment string for RDB comment elements. More... | |
void | setCommentText (const string &comment) |
Parses string for RDB comment elements. More... | |
void | setKeyword (const string &keyword) |
Set just the comment keyword. More... | |
void | setValue (const string &value) |
Set just the comment value. More... | |
Data member accessors. | |
string | getComment (void) const |
Return the full comment. More... | |
string | getCommentText (void) const |
Return the full comment text. More... | |
string | getKeyword (void) const |
Return the keyword, if any. More... | |
string | getValue (void) const |
Return the keyword's value, if any. More... | |
Friends | |
Stream insertion and extraction operators. | |
istream & | operator>> (istream &is, RDBComment &rdbcomment) |
Read comment from input stream. More... | |
ostream & | operator<< (ostream &os, const RDBComment &rdbcomment) |
Write comment to output stream. More... | |
Provides interface for manipulating RDB comments.
Definition at line 35 of file RDBComment.h.
RDBComment::RDBComment | ( | const string & | comment = "" | ) |
Parses comment string for RDB comment structure.
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.
rdbcomment | a reference to the RDBComment to copy. |
Copies the RDBComment into this object.
Definition at line 125 of file RDBComment.cc.
RDBComment::~RDBComment | ( | void | ) |
string RDBComment::getComment | ( | void | ) | const |
string RDBComment::getCommentText | ( | void | ) | const |
Return the full comment text.
Definition at line 346 of file RDBComment.cc.
string RDBComment::getKeyword | ( | void | ) | const |
Return the keyword, if any.
Definition at line 359 of file RDBComment.cc.
string RDBComment::getValue | ( | void | ) | const |
Return the keyword's value, if any.
Definition at line 372 of file RDBComment.cc.
const RDBComment & RDBComment::operator= | ( | const RDBComment & | rdbcomment | ) |
Copy RDBComment object.
rdbcomment | a reference to the RDBComment to copy. |
Definition at line 150 of file RDBComment.cc.
const RDBComment & RDBComment::operator= | ( | const string & | comment | ) |
Copy string to RDBComment object.
comment | a string comment to copy. |
Definition at line 172 of file RDBComment.cc.
void RDBComment::setComment | ( | const string & | comment | ) |
Parses comment string for RDB comment elements.
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.
void RDBComment::setCommentText | ( | const string & | comment | ) |
Parses string for RDB comment elements.
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.
void RDBComment::setKeyword | ( | const string & | keyword | ) |
Set just the comment keyword.
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.
void RDBComment::setValue | ( | const string & | value | ) |
Set just the comment value.
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.
|
friend |
Write comment to output stream.
os | the output stream. |
rdbcomment | the comment to print. |
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.
|
friend |
Read comment from input stream.
is | the input stream. |
rdbcomment | the comment to fill. |
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.