rdbxx  1.0.7_02
RDBComment Class Reference

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 RDBCommentoperator= (const RDBComment &rdbcomment)
 Copy RDBComment object. More...
 
const RDBCommentoperator= (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...
 

Detailed Description

Provides interface for manipulating RDB comments.

Definition at line 35 of file RDBComment.h.

Constructor & Destructor Documentation

◆ RDBComment() [1/2]

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

Parses comment string for RDB comment structure.

Parameters
commentthe 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() [2/2]

RDBComment::RDBComment ( const RDBComment rdbcomment)

Copy RDBComment object.

Parameters
rdbcommenta reference to the RDBComment to copy.

Copies the RDBComment into this object.

Definition at line 125 of file RDBComment.cc.

◆ ~RDBComment()

RDBComment::~RDBComment ( void  )

Destructor has nothing to do.

Nothing to do.

Definition at line 137 of file RDBComment.cc.

Member Function Documentation

◆ getComment()

string RDBComment::getComment ( void  ) const

Return the full comment.

Returns
The comment string.

Definition at line 324 of file RDBComment.cc.

◆ getCommentText()

string RDBComment::getCommentText ( void  ) const

Return the full comment text.

Returns
The comment string.

Definition at line 346 of file RDBComment.cc.

◆ getKeyword()

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.

◆ getValue()

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.

◆ operator=() [1/2]

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

Copy RDBComment object.

Parameters
rdbcommenta reference to the RDBComment to copy.
Returns
A reference to this.

Definition at line 150 of file RDBComment.cc.

◆ operator=() [2/2]

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

Copy string to RDBComment object.

Parameters
commenta string comment to copy.
Returns
A reference to this.

Definition at line 172 of file RDBComment.cc.

◆ setComment()

void RDBComment::setComment ( const string &  comment)

Parses comment string for RDB comment elements.

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

Definition at line 190 of file RDBComment.cc.

◆ setCommentText()

void RDBComment::setCommentText ( const string &  comment)

Parses string for RDB comment elements.

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

Definition at line 222 of file RDBComment.cc.

◆ setKeyword()

void RDBComment::setKeyword ( const string &  keyword)

Set just the comment keyword.

Parameters
keywordthe 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.

◆ setValue()

void RDBComment::setValue ( const string &  value)

Set just the comment value.

Parameters
valuethe 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.

Friends And Related Function Documentation

◆ operator<<

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

Write comment to output stream.

Parameters
osthe output stream.
rdbcommentthe 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.

◆ operator>>

istream& operator>> ( istream &  is,
RDBComment rdbcomment 
)
friend

Read comment from input stream.

Parameters
isthe input stream.
rdbcommentthe 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.


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