rdbxx  1.0.10
RDBComment Class Reference

Provides interface for manipulating RDB comments. More...

#include <RDBComment.h>

Public Member Functions

Constructing, destructing, and initializing RDBComment objects.
 RDBComment (const std::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 std::string &rdbcomment)
 Copy string to RDBComment object. More...
 
Data member initializers.
void setComment (const std::string &comment)
 Parses comment string for RDB comment elements. More...
 
void setCommentText (const std::string &comment)
 Parses string for RDB comment elements. More...
 
void setKeyword (const std::string &keyword)
 Set just the comment keyword. More...
 
void setValue (const std::string &value)
 Set just the comment value. More...
 
Data member accessors.
std::string getComment (void) const
 Return the full comment. More...
 
std::string getCommentText (void) const
 Return the full comment text. More...
 
std::string getKeyword (void) const
 Return the keyword, if any. More...
 
std::string getValue (void) const
 Return the keyword's value, if any. More...
 

Friends

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

Detailed Description

Provides interface for manipulating RDB comments.

Definition at line 33 of file RDBComment.h.

Constructor & Destructor Documentation

◆ RDBComment() [1/2]

RDBComment::RDBComment ( const std::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()

std::string RDBComment::getComment ( void  ) const

Return the full comment.

Returns
The comment string.

Definition at line 327 of file RDBComment.cc.

◆ getCommentText()

std::string RDBComment::getCommentText ( void  ) const

Return the full comment text.

Returns
The comment string.

Definition at line 349 of file RDBComment.cc.

◆ getKeyword()

std::string RDBComment::getKeyword ( void  ) const

Return the keyword, if any.

Returns
The keyword half of a keyword=value pair.

Definition at line 362 of file RDBComment.cc.

◆ getValue()

std::string RDBComment::getValue ( void  ) const

Return the keyword's value, if any.

Returns
The value half of a keyword=value pair.

Definition at line 375 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 std::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 std::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 std::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 std::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 281 of file RDBComment.cc.

◆ setValue()

void RDBComment::setValue ( const std::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 305 of file RDBComment.cc.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::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>>

std::istream& operator>> ( std::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: