rdbxx  1.0.10
RDB Class Reference

Provides interface for manipulating RDB tables. More...

#include <RDB.h>

Inheritance diagram for RDB:
Collaboration diagram for RDB:

Public Types

Enumerations for read/write/group return status.
enum  Status
 Acceptable column justifications. More...
 

Public Member Functions

Constructing and destructing and initializing RDB objects.
 RDB (const std::string &name="", std::ios::openmode mode=std::ios::in)
 Attaches RDB object to a file. More...
 
 RDB (std::istream *isptr)
 Attaches RDB object to an istream. More...
 
 RDB (std::ostream *osptr)
 Attaches RDB object to an ostream. More...
 
 RDB (const RDB &rdb)
 Copies RDB object. More...
 
 ~RDB (void)
 Deletes resources allocated by the RDB object. More...
 
I/O related operations.
void open (const std::string &name, std::ios::openmode mode=std::ios::in)
 Attaches RDB object to a file. More...
 
void open (std::istream *isptr)
 Attaches RDB object to an istream. More...
 
void open (std::ostream *osptr)
 Attaches RDB object to an ostream. More...
 
void open (const RDB &rdb)
 Copies RDB object. More...
 
void close (void)
 Closes the stream attached to RDB object. More...
 
int read (void)
 Read a line of data from the istream. More...
 
bool write (void)
 Write a line of data to the ostream. More...
 
bool rewind (void)
 Rewind the stream to the beginning of the first row of data. More...
 
Auto-indexing related methods.
bool autoIdx (void) const
 Indicates if auto-indexing is activated. More...
 
void autoIdx (const bool on)
 Activates/deactivates auto-indexing. More...
 
void advanceIdx (void)
 Increments the indices in the RDBColumn data elements. More...
 
Column group manipulation (break columns)
void setGroup (const std::string &name, bool group=true)
 Turn on/off group status for the named column. More...
 
void setGroup (const int idx, bool group=true)
 Turn on/off group status for the indexed column. More...
 
bool getGroup (const std::string &name)
 Returns group status, true if its a new group, for the named column. More...
 
bool getGroup (const int idx)
 Returns group status, true if its a new group, for the indexed column. More...
 
bool newGroup (void)
 Checks if any column indicates a new group. More...
 
Comment accessors.
void setComment (const std::string &comm, const int idx=-1)
 Add RDBComment in header of RDB object. More...
 
void setComment (RDBComment &comm, const int idx=-1)
 Add or replace RDBComment in header of RDB object. More...
 
void setComment (RDBComment &comm, const std::string &name, const size_t idx=0)
 Add or replace RDBComment in header of RDB object. More...
 
void setComment (const RDB &rdb)
 Copy all comments from an existing RDB object. More...
 
RDBCommentgetComment (const size_t idx)
 Return RDBComment at given index. More...
 
RDBCommentgetComment (const std::string &name, const size_t idx=0)
 Return RDBComment with given keyword. More...
 
Column accessors.
void setColumn (const std::string &name, const std::string &def, const int idx=-1)
 Add an RDBColumn in RDB object. More...
 
void setColumn (RDBColumn *col, const int idx=-1)
 Add or replace RDBColumn in RDB object. More...
 
void setColumn (RDBColumn *col, const std::string &name, const size_t idx=0)
 Add of replace RDBColumn in RDB object. More...
 
void setColumn (const RDB &rdb)
 Copy all columns from an existing RDB object. More...
 
RDBColumngetColumn (const size_t idx)
 Return pointer to RDBColumn at given index. More...
 
RDBColumngetColumn (const std::string &name, const size_t idx=0)
 Return pointer to RDBColumn with given name. More...
 
Column index based accessors.
void setName (const size_t idx, const std::string &name)
 Modify the name of the RDBColumn at idx. More...
 
void setDef (const size_t idx, const std::string &def)
 Modify the definition of the RDBColumn at idx. More...
 
void setWidth (const size_t idx, const long width)
 Modify the width of the RDBColumn at idx. More...
 
void setType (const size_t idx, const RDBColumn::Type type)
 Modify the type of the RDBColumn at idx. More...
 
void setJust (const size_t idx, const RDBColumn::Just just)
 Modify the justification of the RDBColumn at idx. More...
 
void setDesc (const size_t idx, const std::string &desc)
 Modify the description of the RDBColumn at idx. More...
 
void mapData (const size_t idx, double data[], const size_t nelems=1)
 Map RDBColumn data to user-supplied memory. More...
 
void mapData (const size_t idx, long data[], const size_t nelems=1)
 Map RDBColumn data to user-supplied memory. More...
 
void mapData (const size_t idx, std::string data[], const size_t nelems=1)
 Map RDBColumn data to user-supplied memory. More...
 
void setData (const size_t idx, const double data)
 Sets the data value of RDBColumn, converting as necessary. More...
 
void setData (const size_t idx, const long data)
 Sets the data value of RDBColumn, converting as necessary. More...
 
void setData (const size_t idx, const std::string &data)
 Sets the data value of RDBColumn, converting as necessary. More...
 
void getName (const size_t idx, std::string &name) const
 Return the name of the RDBColumn at idx. More...
 
void getDef (const size_t idx, std::string &def)
 Return the definition of the RDBColumn at idx. More...
 
void getWidth (const size_t idx, long &width) const
 Return the width of the RDBColumn at idx. More...
 
void getType (const size_t idx, RDBColumn::Type &type) const
 Return the type of the RDBColumn at idx. More...
 
void getJust (const size_t idx, RDBColumn::Just &just) const
 Return the just of the RDBColumn at idx. More...
 
void getDesc (const size_t idx, std::string &desc) const
 Return the description of the RDBColumn at idx. More...
 
void getData (const size_t idx, double &data)
 Return the data of the RDBColumn at idx, converting if necessary. More...
 
void getData (const size_t idx, long &data)
 Return the data of the RDBColumn at idx, converting if necessary. More...
 
void getData (const size_t idx, std::string &data)
 Return the data of the RDBColumn at idx, converting if necessary. More...
 
std::string getName (const size_t idx) const
 Return the name of the RDBColumn at idx. More...
 
std::string getDef (const size_t idx)
 Return the definition of the RDBColumn at idx. More...
 
long getWidth (const size_t idx) const
 Return the width of the RDBColumn at idx. More...
 
RDBColumn::Type getType (const size_t idx) const
 Return the type of the RDBColumn at idx. More...
 
RDBColumn::Just getJust (const size_t idx) const
 Return the justification of the RDBColumn at idx. More...
 
std::string getDesc (const size_t idx) const
 Return the description of the RDBColumn at idx. More...
 
double getDataDouble (const size_t idx)
 Return the data of the RDBColumn at idx, converting if necessary. More...
 
long getDataLong (const size_t idx)
 Return the data of the RDBColumn at idx, converting if necessary. More...
 
std::string getDataString (const size_t idx)
 Return the data of the RDBColumn at idx, converting if necessary. More...
 
Column name based accessors.
void setName (const std::string &name, const std::string &newname)
 Modify the RDBColumn name. More...
 
void setDef (const std::string &name, const std::string &def)
 Modify the RDBColumn definition. More...
 
void setWidth (const std::string &name, const long width)
 Modify the RDBColumn width. More...
 
void setType (const std::string &name, const RDBColumn::Type type)
 Modify the RDBColumn type. More...
 
void setJust (const std::string &name, const RDBColumn::Just just)
 Modify the RDBColumn justification. More...
 
void setDesc (const std::string &name, const std::string &desc)
 Modify the RDBColumn description. More...
 
void mapData (const std::string &name, double data[], const size_t nelems=1)
 Map RDBColum data to user-supplied memory. More...
 
void mapData (const std::string &name, long data[], const size_t nelems=1)
 Map RDBColum data to user-supplied memory. More...
 
void mapData (const std::string &name, std::string data[], const size_t nelems=1)
 Map RDBColum data to user-supplied memory. More...
 
void setData (const std::string &name, const double data)
 Modify the RDBColumn data, converting if necessary. More...
 
void setData (const std::string &name, const long data)
 Modify the RDBColumn data, converting if necessary. More...
 
void setData (const std::string &name, const std::string &data)
 Modify the RDBColumn data, converting if necessary. More...
 
void getName (const std::string &name, std::string &namefound) const
 Return the name of the RDBColumn. More...
 
void getDef (const std::string &name, std::string &def)
 Return the definition of the RDBColumn. More...
 
void getWidth (const std::string &name, long &width) const
 Return the width of the RDBColumn. More...
 
void getType (const std::string &name, RDBColumn::Type &type) const
 Return the type of the RDBColumn. More...
 
void getJust (const std::string &name, RDBColumn::Just &just) const
 Return the justification of the RDBColumn. More...
 
void getDesc (const std::string &name, std::string &desc) const
 Return the description of the RDBColumn. More...
 
void getData (const std::string &name, double &data)
 Return the data of the RDBColumn, converting if necessary. More...
 
void getData (const std::string &name, long &data)
 Return the data of the RDBColumn, converting if necessary. More...
 
void getData (const std::string &name, std::string &data)
 Return the data of the RDBColumn, converting if necessary. More...
 
std::string getName (const std::string &name) const
 Return the name of the RDBColumn. More...
 
std::string getDef (const std::string &name)
 Return the definition of the RDBColumn. More...
 
long getWidth (const std::string &name) const
 Return the width of the RDBColumn. More...
 
RDBColumn::Type getType (const std::string &name) const
 Return the type of the RDBColumn. More...
 
RDBColumn::Just getJust (const std::string &name) const
 Return the justification of the RDBColumn. More...
 
std::string getDesc (const std::string &name) const
 Return the description of the RDBColumn. More...
 
double getDataDouble (const std::string &name)
 Return the data of the RDBColumn, converting if necessary. More...
 
long getDataLong (const std::string &name)
 Return the data of the RDBColumn, converting if necessary. More...
 
std::string getDataString (const std::string &name)
 Return the data of the RDBColumn, converting if necessary. More...
 
Table and header statistics.
size_t nComments (void) const
 Return number of comments in RDB object. More...
 
size_t nColumns (void) const
 Return number of columns in RDB object. More...
 
size_t nRows (void)
 Return number of rows in RDB object. More...
 

Protected Member Functions

void parseHeader (void)
 Parse header, i.e. comments and column names and definitions. More...
 
std::vector< std::string > parseLine (const std::string &line) const
 Parse fields in a row. More...
 
size_t parseLine (bool &newgroup)
 Parse fields in a row. More...
 

Protected Attributes

std::string _filename
 Name of RDB file. More...
 
std::ios::openmode _mode
 Open mode of the associated stream. More...
 
std::istream * _isptr
 Istream attached to data file. More...
 
std::ostream * _osptr
 Ostream attached to data file. More...
 
bool _myisptr
 Indicates if RDB object is responsible for deallocating the istream. More...
 
bool _myosptr
 Indicates if RDB object is responsible for deallocating the ostream. More...
 
size_t _rewindto
 Position of beginning of first row of data. More...
 
size_t _ncomms
 Number of comments. More...
 
size_t _ncols
 Number of columns. More...
 
size_t _nrows
 Number of rows. More...
 
bool _knowrows
 Indicates if associated file must be scanned to determine number of rows. More...
 
long _rownum
 Current table row number. More...
 
long _frownum
 Current file row number. More...
 
bool _autoidx
 Indicates if RDBColumn data elements should be advanced. More...
 
bool _firstread
 Indicates if this is the first call to RDB::read. More...
 
bool _lastread
 Indicates if this is the last call to RDB::read. More...
 
bool _writehdr
 Indicates if the header has been output. More...
 
RDBComment_comms
 Array of RDBComments. More...
 
RDBColumn ** _cols
 Array of RDBColumns. More...
 
RDBLongColumn _nrcol
 Hidden column, containing row number. More...
 
bool * _mycols
 Indicates if RDB object is responsible for deallocating given RDBColumn. More...
 
std::string _line
 Line from RDB table. More...
 

Friends

Stream insertion and extraction operators.
std::istream & operator>> (std::istream &is, RDB &rdb)
 Read table from input stream. More...
 
std::ostream & operator<< (std::ostream &os, RDB &rdb)
 Write table to output stream. More...
 

Detailed Description

Provides interface for manipulating RDB tables.

Definition at line 42 of file RDB.h.

Member Enumeration Documentation

◆ Status

Acceptable column justifications.

Definition at line 55 of file RDB.h.

Constructor & Destructor Documentation

◆ RDB() [1/4]

RDB::RDB ( const std::string &  name = "",
std::ios::openmode  mode = std::ios::in 
)

Attaches RDB object to a file.

Parameters
namethe name of the RDB file.
modethe ios::openmode of the file.
Exceptions
RDBErrerror opening RDB file.
RDBErrerror parsing RDB comment or column name and definition.
RDBErrerror parsing RDB column definition.

Attaches RDB object's I/O stream to the file. If mode is set to ios::in, it calls RDB::parseHeader(void) to read comments, column names, and column definitions.

If no filename is specified, then the RDB::open() method may be used later to attach a file to the object.

Definition at line 117 of file RDB.cc.

◆ RDB() [2/4]

RDB::RDB ( std::istream *  isptr)

Attaches RDB object to an istream.

Parameters
isptrinput stream to attach to the RDB object.
Exceptions
RDBErrerror parsing RDB comment or column name and definition.
RDBErrerror parsing RDB column definition.

Attaches the istream to the RDB object. RDB::parseHeader(void) is called to read comments, column names, and column definitions.

Definition at line 163 of file RDB.cc.

◆ RDB() [3/4]

RDB::RDB ( std::ostream *  osptr)

Attaches RDB object to an ostream.

Parameters
osptroutput stream to attach to the RDB object.

Attaches the ostream to the RDB object.

Definition at line 198 of file RDB.cc.

◆ RDB() [4/4]

RDB::RDB ( const RDB rdb)

Copies RDB object.

Parameters
rdbcopy RDB object.

Makes a copy of the argument.

Definition at line 233 of file RDB.cc.

◆ ~RDB()

RDB::~RDB ( void  )

Deletes resources allocated by the RDB object.

Deletes RDBComments and RDBColumns.

Closes only the streams the object opened. User is responsible for closing streams they supply to the object.

Warning
If the user supplies an RDBColumn object via the RDB::setColumn() method, the user is responsible for deleting that object.

Definition at line 270 of file RDB.cc.

Member Function Documentation

◆ advanceIdx()

void RDB::advanceIdx ( void  )

Increments the indices in the RDBColumn data elements.

This method advances the auto-indices for all RDBColumns associated with this object.

Definition at line 856 of file RDB.cc.

◆ autoIdx() [1/2]

bool RDB::autoIdx ( void  ) const

Indicates if auto-indexing is activated.

Returns
State of the auto-indexing flag for this object.

Definition at line 842 of file RDB.cc.

◆ autoIdx() [2/2]

void RDB::autoIdx ( const bool  on)

Activates/deactivates auto-indexing.

Parameters
onsets the auto-indexing behavior for the RDB object and its columns.

Sets RDBTable::_autoidx. This effectly turns off the auto-incrementing behavior for a single call to RDB::read(void) or RDB::write(void). For arrays of mapped memory, this will cause one line's data to overwrite the previous line's data.

Warning
RDB::_autoidx is set to true after each call to RDB::read(void) or RDB::write(void).

Definition at line 829 of file RDB.cc.

◆ close()

void RDB::close ( void  )

Closes the stream attached to RDB object.

Closes any streams that the RDB object created.

Definition at line 525 of file RDB.cc.

◆ getColumn() [1/2]

RDBColumn * RDB::getColumn ( const size_t  idx)

Return pointer to RDBColumn at given index.

Parameters
idxthe index of the RDBColumn.
Exceptions
RDBErrerror if the index is out of range.
Returns
RDBColumn with index equal to idx.

RDBColumns are indexed in the order in which they appear in the RDB file starting with 0. Parameter idx must be between 0 and RDB::nColumns(void) less one.

Definition at line 1432 of file RDB.cc.

◆ getColumn() [2/2]

RDBColumn * RDB::getColumn ( const std::string &  name,
const size_t  idx = 0 
)

Return pointer to RDBColumn with given name.

Parameters
namethe name of the column.
idxcurrently not defined.
Exceptions
RDBErrNotFnderror if there is no column with matching name.
Returns
RDBColumn with matching name.

Definition at line 1457 of file RDB.cc.

◆ getComment() [1/2]

RDBComment & RDB::getComment ( const size_t  idx)

Return RDBComment at given index.

Parameters
idxthe index of the RDBComment.
Exceptions
RDBErrNoterror if the index is out of range.
Returns
RDBComment with index equal to idx.

RDBComments are indexed in the order in which they appear in the RDB file starting with 0. Parameter idx must be between 0 and RDB::nComments(void) less one.

Definition at line 1147 of file RDB.cc.

◆ getComment() [2/2]

RDBComment & RDB::getComment ( const std::string &  name,
const size_t  idx = 0 
)

Return RDBComment with given keyword.

Parameters
namethe name of the comment keyword.
idxcurrently not defined.
Exceptions
RDBErrerror if there is no comment with matching keyword.
Returns
RDBComment with matching keyword.

Definition at line 1172 of file RDB.cc.

◆ getData() [1/6]

void RDB::getData ( const size_t  idx,
double &  data 
)

Return the data of the RDBColumn at idx, converting if necessary.

Parameters
idxindex of RDBColumn
dataretrieve data of RDBColumn.
Exceptions
RDBErrif index is out of range.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 1932 of file RDB.cc.

◆ getData() [2/6]

void RDB::getData ( const size_t  idx,
long &  data 
)

Return the data of the RDBColumn at idx, converting if necessary.

Parameters
idxindex of RDBColumn
dataretrieve data of RDBColumn.
Exceptions
RDBErrif index is out of range.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 1960 of file RDB.cc.

◆ getData() [3/6]

void RDB::getData ( const size_t  idx,
std::string &  data 
)

Return the data of the RDBColumn at idx, converting if necessary.

Parameters
idxindex of RDBColumn
dataretrieve data of RDBColumn.
Exceptions
RDBErrif index is out of range.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 1988 of file RDB.cc.

◆ getData() [4/6]

void RDB::getData ( const std::string &  name,
double &  data 
)

Return the data of the RDBColumn, converting if necessary.

Parameters
nameof RDBColumn
datadata of RDBColumn.
Exceptions
RDBErrif no matching column name is found.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 2777 of file RDB.cc.

◆ getData() [5/6]

void RDB::getData ( const std::string &  name,
long &  data 
)

Return the data of the RDBColumn, converting if necessary.

Parameters
nameof RDBColumn
datadata of RDBColumn.
Exceptions
RDBErrif no matching column name is found.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 2811 of file RDB.cc.

◆ getData() [6/6]

void RDB::getData ( const std::string &  name,
std::string &  data 
)

Return the data of the RDBColumn, converting if necessary.

Parameters
nameof RDBColumn
datadata of RDBColumn.
Exceptions
RDBErrif data is invalid datatype for RDBColumn.
RDBErrif no matching column name is found.

Definition at line 2845 of file RDB.cc.

◆ getDataDouble() [1/2]

double RDB::getDataDouble ( const size_t  idx)

Return the data of the RDBColumn at idx, converting if necessary.

Parameters
idxindex of RDBColumn
Exceptions
RDBErrif index is out of range.
RDBErrif data is invalid datatype for RDBColumn.
Returns
data of RDBColumn.

Definition at line 2137 of file RDB.cc.

◆ getDataDouble() [2/2]

double RDB::getDataDouble ( const std::string &  name)

Return the data of the RDBColumn, converting if necessary.

Parameters
nameof RDBColumn
Exceptions
RDBErrif no matching column name is found.
RDBErrif data is invalid datatype for RDBColumn.
Returns
data of RDBColumn.

Definition at line 3024 of file RDB.cc.

◆ getDataLong() [1/2]

long RDB::getDataLong ( const size_t  idx)

Return the data of the RDBColumn at idx, converting if necessary.

Parameters
idxindex of RDBColumn
Exceptions
RDBErrif index is out of range.
RDBErrif data is invalid datatype for RDBColumn.
Returns
Data of RDBColumn.

Definition at line 2166 of file RDB.cc.

◆ getDataLong() [2/2]

long RDB::getDataLong ( const std::string &  name)

Return the data of the RDBColumn, converting if necessary.

Parameters
nameof RDBColumn
Exceptions
RDBErrif no matching column name is found.
RDBErrif data is invalid datatype for RDBColumn.
Returns
data of RDBColumn.

Definition at line 3057 of file RDB.cc.

◆ getDataString() [1/2]

std::string RDB::getDataString ( const size_t  idx)

Return the data of the RDBColumn at idx, converting if necessary.

Parameters
idxindex of RDBColumn
Exceptions
RDBErrif index is out of range.
RDBErrif data is invalid datatype for RDBColumn.
Returns
data of RDBColumn.

Definition at line 2195 of file RDB.cc.

◆ getDataString() [2/2]

std::string RDB::getDataString ( const std::string &  name)

Return the data of the RDBColumn, converting if necessary.

Parameters
nameof RDBColumn
Exceptions
RDBErrif no matching column name is found.
RDBErrif data is invalid datatype for RDBColumn.
Returns
data of RDBColumn.

Definition at line 3090 of file RDB.cc.

◆ getDef() [1/4]

void RDB::getDef ( const size_t  idx,
std::string &  def 
)

Return the definition of the RDBColumn at idx.

Parameters
idxindex of RDBColumn.
defretrieve definition of RDBColumn.
Exceptions
RDBErrif index is out of range.

Definition at line 1836 of file RDB.cc.

◆ getDef() [2/4]

std::string RDB::getDef ( const size_t  idx)

Return the definition of the RDBColumn at idx.

Parameters
idxindex of RDBColumn
Exceptions
RDBErrif index is out of range.
Returns
definition of RDBColumn.

Definition at line 2036 of file RDB.cc.

◆ getDef() [3/4]

void RDB::getDef ( const std::string &  name,
std::string &  def 
)

Return the definition of the RDBColumn.

Parameters
nameof RDBColumn
defdefinition of RDBColumn.
Exceptions
RDBErrif no matching column name is found.

Definition at line 2656 of file RDB.cc.

◆ getDef() [4/4]

std::string RDB::getDef ( const std::string &  name)

Return the definition of the RDBColumn.

Parameters
nameof RDBColumn
Exceptions
RDBErrif no matching column name is found.
Returns
definition of RDBColumn.

Definition at line 2903 of file RDB.cc.

◆ getDesc() [1/4]

void RDB::getDesc ( const size_t  idx,
std::string &  desc 
) const

Return the description of the RDBColumn at idx.

Parameters
idxindex of RDBColumn
descretrieve description of RDBColumn.
Exceptions
RDBErrif index is out of range.

Definition at line 1912 of file RDB.cc.

◆ getDesc() [2/4]

std::string RDB::getDesc ( const size_t  idx) const

Return the description of the RDBColumn at idx.

Parameters
idxindex of RDBColumn
Exceptions
RDBErrif index is out of range.
Returns
description of RDBColumn.

Definition at line 2116 of file RDB.cc.

◆ getDesc() [3/4]

void RDB::getDesc ( const std::string &  name,
std::string &  desc 
) const

Return the description of the RDBColumn.

Parameters
nameof RDBColumn
descdescription of RDBColumn.
Exceptions
RDBErrif no matching column name is found.

Definition at line 2752 of file RDB.cc.

◆ getDesc() [4/4]

std::string RDB::getDesc ( const std::string &  name) const

Return the description of the RDBColumn.

Parameters
nameof RDBColumn
Exceptions
RDBErrif no matching column name is found.
Returns
description of RDBColumn.

Definition at line 2999 of file RDB.cc.

◆ getGroup() [1/2]

bool RDB::getGroup ( const std::string &  name)

Returns group status, true if its a new group, for the named column.

Parameters
namethe name of the column.
Exceptions
RDBErrNotFnderror if there is no column with matching name.
Returns
Status of the column's group flag.

Definition at line 937 of file RDB.cc.

◆ getGroup() [2/2]

bool RDB::getGroup ( const int  idx)

Returns group status, true if its a new group, for the indexed column.

Parameters
idxthe column index.
Exceptions
RDBErrerror if the index is out of range.
Returns
Status of the column's group flag.

Definition at line 966 of file RDB.cc.

◆ getJust() [1/4]

void RDB::getJust ( const size_t  idx,
RDBColumn::Just just 
) const

Return the just of the RDBColumn at idx.

Parameters
idxindex of RDBColumn
justretrieve just of RDBColumn.
Exceptions
RDBErrif index is out of range.

Definition at line 1893 of file RDB.cc.

◆ getJust() [2/4]

RDBColumn::Just RDB::getJust ( const size_t  idx) const

Return the justification of the RDBColumn at idx.

Parameters
idxindex of RDBColumn
Exceptions
RDBErrif index is out of range.
Returns
justification of RDBColumn.

Definition at line 2096 of file RDB.cc.

◆ getJust() [3/4]

void RDB::getJust ( const std::string &  name,
RDBColumn::Just just 
) const

Return the justification of the RDBColumn.

Parameters
nameof RDBColumn
justjustification of RDBColumn.
Exceptions
RDBErrif no matching column name is found.

Definition at line 2728 of file RDB.cc.

◆ getJust() [4/4]

RDBColumn::Just RDB::getJust ( const std::string &  name) const

Return the justification of the RDBColumn.

Parameters
nameof RDBColumn
Exceptions
RDBErrif no matching column name is found.
Returns
justification of RDBColumn.

Definition at line 2975 of file RDB.cc.

◆ getName() [1/4]

void RDB::getName ( const size_t  idx,
std::string &  name 
) const

Return the name of the RDBColumn at idx.

Parameters
idxindex of RDBColumn.
nameretrieve name of RDBColumn.
Exceptions
RDBErrif index is out of range.

Definition at line 1817 of file RDB.cc.

◆ getName() [2/4]

std::string RDB::getName ( const size_t  idx) const

Return the name of the RDBColumn at idx.

Parameters
idxindex of RDBColumn
Exceptions
RDBErrif index is out of range.
Returns
name of RDBColumn.

Definition at line 2016 of file RDB.cc.

◆ getName() [3/4]

void RDB::getName ( const std::string &  name,
std::string &  namefound 
) const

Return the name of the RDBColumn.

Parameters
nameof RDBColumn
namefoundname of RDBColumn if found.
Exceptions
RDBErrif no matching column name is found.

Definition at line 2632 of file RDB.cc.

◆ getName() [4/4]

std::string RDB::getName ( const std::string &  name) const

Return the name of the RDBColumn.

Parameters
nameof RDBColumn
Exceptions
RDBErrif no matching column name is found.
Returns
name of RDBColumn.

Definition at line 2879 of file RDB.cc.

◆ getType() [1/4]

void RDB::getType ( const size_t  idx,
RDBColumn::Type type 
) const

Return the type of the RDBColumn at idx.

Parameters
idxindex of RDBColumn.
typeretrieve type of RDBColumn.
Exceptions
RDBErrif index is out of range.

Definition at line 1874 of file RDB.cc.

◆ getType() [2/4]

RDBColumn::Type RDB::getType ( const size_t  idx) const

Return the type of the RDBColumn at idx.

Parameters
idxindex of RDBColumn
Exceptions
RDBErrif index is out of range.
Returns
type of RDBColumn.

Definition at line 2076 of file RDB.cc.

◆ getType() [3/4]

void RDB::getType ( const std::string &  name,
RDBColumn::Type type 
) const

Return the type of the RDBColumn.

Parameters
nameof RDBColumn
typetype of RDBColumn.
Exceptions
RDBErrif no matching column name is found.

Definition at line 2704 of file RDB.cc.

◆ getType() [4/4]

RDBColumn::Type RDB::getType ( const std::string &  name) const

Return the type of the RDBColumn.

Parameters
nameof RDBColumn
Exceptions
RDBErrif no matching column name is found.
Returns
type of RDBColumn.

Definition at line 2951 of file RDB.cc.

◆ getWidth() [1/4]

void RDB::getWidth ( const size_t  idx,
long &  width 
) const

Return the width of the RDBColumn at idx.

Parameters
idxindex of RDBColumn.
widthretrieve width of RDBColumn.
Exceptions
RDBErrif index is out of range.

Definition at line 1855 of file RDB.cc.

◆ getWidth() [2/4]

long RDB::getWidth ( const size_t  idx) const

Return the width of the RDBColumn at idx.

Parameters
idxindex of RDBColumn
Exceptions
RDBErrif index is out of range.
Returns
width of RDBColumn.

Definition at line 2056 of file RDB.cc.

◆ getWidth() [3/4]

void RDB::getWidth ( const std::string &  name,
long &  width 
) const

Return the width of the RDBColumn.

Parameters
nameof RDBColumn
widthwidth of RDBColumn.
Exceptions
RDBErrif no matching column name is found.

Definition at line 2680 of file RDB.cc.

◆ getWidth() [4/4]

long RDB::getWidth ( const std::string &  name) const

Return the width of the RDBColumn.

Parameters
nameof RDBColumn
Exceptions
RDBErrif no matching column name is found.
Returns
width of RDBColumn.

Definition at line 2927 of file RDB.cc.

◆ mapData() [1/6]

void RDB::mapData ( const size_t  idx,
double  data[],
const size_t  nelems = 1 
)

Map RDBColumn data to user-supplied memory.

Parameters
idxindex of RDBColumn.
datauser-supplied memory for storing data.
nelemsnumber of elements in user-supplied data.
Exceptions
RDBErrif index is out of range.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 1649 of file RDB.cc.

◆ mapData() [2/6]

void RDB::mapData ( const size_t  idx,
long  data[],
const size_t  nelems = 1 
)

Map RDBColumn data to user-supplied memory.

Parameters
idxindex of RDBColumn.
datauser-supplied memorgy to stored data.
nelemsnumber of elems in user-supplied memory.
Exceptions
RDBErrif index is out of range.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 1677 of file RDB.cc.

◆ mapData() [3/6]

void RDB::mapData ( const size_t  idx,
std::string  data[],
const size_t  nelems = 1 
)

Map RDBColumn data to user-supplied memory.

Parameters
idxindex of RDBColumn.
datauser-supplied memory to store data.
nelemsnumber of elements in user-supplied data.
Exceptions
RDBErrif index is out of range.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 1706 of file RDB.cc.

◆ mapData() [4/6]

void RDB::mapData ( const std::string &  name,
double  data[],
const size_t  nelems = 1 
)

Map RDBColum data to user-supplied memory.

Parameters
nameof RDBColumn
datauser-supplied memory to store RDBColumn data.
nelemsnumber of elems in user-supplied memory.
Exceptions
RDBErrif no matching column name is found.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 2425 of file RDB.cc.

◆ mapData() [5/6]

void RDB::mapData ( const std::string &  name,
long  data[],
const size_t  nelems = 1 
)

Map RDBColum data to user-supplied memory.

Parameters
nameof RDBColumn
datauser-supplied memory to store RDBColumn data.
nelemsnumber of elems in user-supplied memory.
Exceptions
RDBErrif no matching column name is found.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 2461 of file RDB.cc.

◆ mapData() [6/6]

void RDB::mapData ( const std::string &  name,
std::string  data[],
const size_t  nelems = 1 
)

Map RDBColum data to user-supplied memory.

Parameters
nameof RDBColumn
datauser-supplied memory to store RDBColumn data.
nelemsnumber of elems in user-supplied memory.
Exceptions
RDBErrif no matching column name is found.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 2498 of file RDB.cc.

◆ nColumns()

size_t RDB::nColumns ( void  ) const

Return number of columns in RDB object.

Returns
Number of columns.

Definition at line 3132 of file RDB.cc.

◆ nComments()

size_t RDB::nComments ( void  ) const

Return number of comments in RDB object.

Returns
Number of comments.

Definition at line 3119 of file RDB.cc.

◆ newGroup()

bool RDB::newGroup ( void  )

Checks if any column indicates a new group.

Returns
True if any column indicates a new group, false otherwise.

A new group occurs when the data values between consecutive rows change.

Definition at line 988 of file RDB.cc.

◆ nRows()

size_t RDB::nRows ( void  )

Return number of rows in RDB object.

Returns
Number of rows.
Warning
This method reads through the entire RDB file to count the number of rows and then attempts to rewind the file to the location at which it began . If the stream attached to the RDB object is not seekable, this method will fail.

Definition at line 3150 of file RDB.cc.

◆ open() [1/4]

void RDB::open ( const std::string &  name,
std::ios::openmode  mode = std::ios::in 
)

Attaches RDB object to a file.

Parameters
namethe name of the RDB file.
modethe ios::openmode of the file.
Exceptions
RDBErrerror opening RDB file.
RDBErrerror parsing RDB comment or column name and definition.
RDBErrerror parsing RDB column definition.

Attaches RDB object's I/O stream to the file. If mode is set to ios::in, it calls RDB::parseHeader(void) to read comments, column names, and column definitions.

Warning
This method closes any previously opened streams.

Definition at line 315 of file RDB.cc.

◆ open() [2/4]

void RDB::open ( std::istream *  isptr)

Attaches RDB object to an istream.

Parameters
isptrinput stream to attach to the RDB object.
Exceptions
RDBErrerror parsing RDB comments or column names and definitions
RDBErrerror parsing RDB column definition.

Attaches the istream to the RDB object. RDB::parseHeader(void) is called to read comments, column names, and column definitions.

Warning
This method closes any previously opened streams.

Definition at line 399 of file RDB.cc.

◆ open() [3/4]

void RDB::open ( std::ostream *  osptr)

Attaches RDB object to an ostream.

Parameters
osptroutput stream to attach to the RDB object.

Attaches the ostream to the RDB object.

Warning
This method closes any previously opened streams.

Definition at line 431 of file RDB.cc.

◆ open() [4/4]

void RDB::open ( const RDB rdb)

Copies RDB object.

Parameters
rdbcopy RDB object.
Warning
This method is currently not implemented.

Definition at line 450 of file RDB.cc.

◆ parseHeader()

void RDB::parseHeader ( void  )
protected

Parse header, i.e. comments and column names and definitions.

Parses out comments and column names and defintions from the RDB file header.

This is used by RDB::open().

Definition at line 3184 of file RDB.cc.

◆ parseLine() [1/2]

std::vector< std::string > RDB::parseLine ( const std::string &  line) const
protected

Parse fields in a row.

Parameters
linethe line to be split.
Returns
Vector of tokens, one for each tab delimited field.

Splits the input line on tabs.

Definition at line 3283 of file RDB.cc.

◆ parseLine() [2/2]

size_t RDB::parseLine ( bool &  newgroup)
protected

Parse fields in a row.

Returns
number of tokens parsed.

Splits the line on tabs and assigns the tokens to the RDBColumns.

Definition at line 3315 of file RDB.cc.

◆ read()

int RDB::read ( void  )

Read a line of data from the istream.

Exceptions
RDBErrerror if the number of tokens found does not match the number of tokens expected.
RDBErrerror if non-numeric data is found in a numeric column.
RDBErrerror if a floating point number is being assigned to an integer column.

S *

Returns
RDB::Status indicating if end of file, end of line, or end of group was reached.

Reads, parses, and stores data from the next line in the RDB file is an input stream has been provided. If RDB::_autoidx is set, this method will advance the indices in each RDBColumn's data pointer before reading and will increment the row number, RDB::_rownum, for the default ‘_NR’ column.

Definition at line 588 of file RDB.cc.

◆ rewind()

bool RDB::rewind ( void  )

Rewind the stream to the beginning of the first row of data.

Returns
false if the stream associated with this RDB object cannot be rewound, i.e seekg() or seekp() is not defined.

Rewinds the stream associate with this object to the beginning of the first row of data. It also calls RDBColumn::rewind(void) for each RDBColumn. If the user supplied data storage to a particular column, the auto-incrementing index is rewound to point at the first element of the user supplied array.

Warning
If an istream or ostream, like cin or cout, was provided to the object, you only get one chance to read it. You can't rewind, you can't close and reopen.

Definition at line 771 of file RDB.cc.

◆ setColumn() [1/4]

void RDB::setColumn ( const std::string &  name,
const std::string &  def,
const int  idx = -1 
)

Add an RDBColumn in RDB object.

Parameters
nameof the RDBColumn object
defdefinition of the RDBColumn object
idxthe position of the column on which to operate.

Columns are numbered as they appear in the RDB file from left to right starting with 0. If the index is not specified or does not fall within the range of existing columns, an RDBColumn is created and is appended to the list of columns. The RDB object handles memory allocation and deletion.

Upon completion, the RDB object contains a pointer to the RDBColumn created. Any modifications to the RDBColumn outside of the RDB object will be reflected within the RDB object and vice versa.

Definition at line 1207 of file RDB.cc.

◆ setColumn() [2/4]

void RDB::setColumn ( RDBColumn col,
const int  idx = -1 
)

Add or replace RDBColumn in RDB object.

Parameters
cola reference to the RDBColumn object
idxthe position of the column on which to operate.

Columns are numbered as they appear in the RDB file from left to right starting with 0. If the index is not specified or does not fall within the range of existing columns, the RDBColumn is appended to the list of columns.

Upon completion, the RDB object contains a pointer to the RDBColumn provided. Any modifications to the RDBColumn outside of the RDB object will be reflected within the RDB object and vice versa.

Warning
The user is responsible for freeing the RDBColumn.

Definition at line 1273 of file RDB.cc.

◆ setColumn() [3/4]

void RDB::setColumn ( RDBColumn col,
const std::string &  name,
const size_t  idx = 0 
)

Add of replace RDBColumn in RDB object.

Parameters
cola reference to the RDBColumn object
namethe name of the column in this RDB object.
idxcurrently not defined.

If no matching column is found, the column is appended to the list of columns after assigning it a name of 'name'. Otherwise, col replaces the existing column.

Upon completion, the RDB object contains a pointer to the RDBColumn provided. Any modifications to the RDBColumn outside of the RDB object will be reflected within the RDB object and vice versa.

Warning
The user is responsible for freeing the RDBColumn.

Definition at line 1330 of file RDB.cc.

◆ setColumn() [4/4]

void RDB::setColumn ( const RDB rdb)

Copy all columns from an existing RDB object.

Parameters
rdba reference to an RDB object

Copies all columns from the argument to this RDB object. Any columns previously associated with this object are removed.

Warning
The user is responsible for free any RDBColumns previously allocated and assigned to this RDB object via the RDB::setColumn methods.

Definition at line 1367 of file RDB.cc.

◆ setComment() [1/4]

void RDB::setComment ( const std::string &  comm,
const int  idx = -1 
)

Add RDBComment in header of RDB object.

Parameters
comma comment string.
idxthe position of the comment on which to operate.

Comments are numbered as they appear in the RDB file from top to bottom. If the index is not specified or does not fall within the range of existing comments, the RDBComment is appended to the list of comments.

Definition at line 1014 of file RDB.cc.

◆ setComment() [2/4]

void RDB::setComment ( RDBComment comm,
const int  idx = -1 
)

Add or replace RDBComment in header of RDB object.

Parameters
comma reference to the RDBComment object
idxthe position of the comment on which to operate.

Comments are numbered as they appear in the RDB file from top to bottom. If the index is not specified or does not fall within the range of existing comments, the RDBComment is appended to the list of comments.

Definition at line 1052 of file RDB.cc.

◆ setComment() [3/4]

void RDB::setComment ( RDBComment comm,
const std::string &  name,
const size_t  idx = 0 
)

Add or replace RDBComment in header of RDB object.

Parameters
comma reference to the RDBComment object
namethe name of the comment keyword.
idxcurrently not defined.

If no matching comment keyword is found, the comment is appended to the list of comments. Otherwise, comm replaces the existing comment.

Definition at line 1089 of file RDB.cc.

◆ setComment() [4/4]

void RDB::setComment ( const RDB rdb)

Copy all comments from an existing RDB object.

Parameters
rdba reference to an RDB object

Copies all comments from the argument to this RDB object. Any comments previously associated with this object are removed.

Definition at line 1115 of file RDB.cc.

◆ setData() [1/6]

void RDB::setData ( const size_t  idx,
const double  data 
)

Sets the data value of RDBColumn, converting as necessary.

Parameters
idxindex of RDBColumn.
datavalue to assign to RDBColumn data.
Exceptions
RDBErrif index is out of range.
RDBErrif data is invalid for RDBColumn.

Definition at line 1734 of file RDB.cc.

◆ setData() [2/6]

void RDB::setData ( const size_t  idx,
const long  data 
)

Sets the data value of RDBColumn, converting as necessary.

Parameters
idxindex of RDBColumn.
datavalue to assign to RDBColumn data.
Exceptions
RDBErrif index is out of range.
RDBErrif data is invalid for RDBColumn.

Definition at line 1762 of file RDB.cc.

◆ setData() [3/6]

void RDB::setData ( const size_t  idx,
const std::string &  data 
)

Sets the data value of RDBColumn, converting as necessary.

Parameters
idxindex of RDBColumn/
datavalue to assign RDBColumn data.
Exceptions
RDBErrif index is out of range.
RDBErrif data is invalid for RDBColumn.

Definition at line 1790 of file RDB.cc.

◆ setData() [4/6]

void RDB::setData ( const std::string &  name,
const double  data 
)

Modify the RDBColumn data, converting if necessary.

Parameters
nameof RDBColumn
datavalue to assign RDBColumn data.
Exceptions
RDBErrif no matching column name is found.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 2533 of file RDB.cc.

◆ setData() [5/6]

void RDB::setData ( const std::string &  name,
const long  data 
)

Modify the RDBColumn data, converting if necessary.

Parameters
nameof RDBColumn
datavalue to assign RDBColumn data.
Exceptions
RDBErrif no matching column name is found.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 2566 of file RDB.cc.

◆ setData() [6/6]

void RDB::setData ( const std::string &  name,
const std::string &  data 
)

Modify the RDBColumn data, converting if necessary.

Parameters
nameof RDBColumn
datavalue to assign RDBColumn data.
Exceptions
RDBErrif no matching column name is found.
RDBErrif data is invalid datatype for RDBColumn.

Definition at line 2599 of file RDB.cc.

◆ setDef() [1/2]

void RDB::setDef ( const size_t  idx,
const std::string &  def 
)

Modify the definition of the RDBColumn at idx.

Parameters
idxindex of RDBColumn.
defRDBColumn definition.
Exceptions
RDBErrif index is out of range.
RDBErrif def is invalid RDBColumn definition.

Definition at line 1508 of file RDB.cc.

◆ setDef() [2/2]

void RDB::setDef ( const std::string &  name,
const std::string &  def 
)

Modify the RDBColumn definition.

Parameters
nameof RDBColumn
defdefinition of RDBColumn.
Exceptions
RDBErrif no matching column name is found.
RDBErrif def is invalid definition for RDBColumn.

Definition at line 2249 of file RDB.cc.

◆ setDesc() [1/2]

void RDB::setDesc ( const size_t  idx,
const std::string &  desc 
)

Modify the description of the RDBColumn at idx.

Parameters
idxindex of RDBColumn.
descRDBColumn description.
Exceptions
RDBErrif index is out of range.
RDBErrif desc is invalid RDBColumn description.

Definition at line 1620 of file RDB.cc.

◆ setDesc() [2/2]

void RDB::setDesc ( const std::string &  name,
const std::string &  desc 
)

Modify the RDBColumn description.

Parameters
nameof RDBColumn
descdescription of RDBColumn.
Exceptions
RDBErrif no matching column name is found.
RDBErrif desc is invalid description for RDBColumn.

Definition at line 2389 of file RDB.cc.

◆ setGroup() [1/2]

void RDB::setGroup ( const std::string &  name,
bool  group = true 
)

Turn on/off group status for the named column.

Parameters
groupa bool indicating whether group is on or off.
namethe name of the column in this RDB object.
Exceptions
RDBErerror if there is no column with matching name.

Definition at line 877 of file RDB.cc.

◆ setGroup() [2/2]

void RDB::setGroup ( const int  idx,
bool  group = true 
)

Turn on/off group status for the indexed column.

Parameters
groupa bool indicating whether group is on or off.
idxthe position of the column on which to operate.
Exceptions
RDBErrerror if there is no column with matching name.

Definition at line 910 of file RDB.cc.

◆ setJust() [1/2]

void RDB::setJust ( const size_t  idx,
const RDBColumn::Just  just 
)

Modify the justification of the RDBColumn at idx.

Parameters
idxindex of RDBColumn.
justRDBColumn justification.
Exceptions
RDBErrif index is out of range.
RDBErrif just is invalid RDBColumn justification.

Definition at line 1592 of file RDB.cc.

◆ setJust() [2/2]

void RDB::setJust ( const std::string &  name,
const RDBColumn::Just  just 
)

Modify the RDBColumn justification.

Parameters
nameof RDBColumn
justjustification of RDBColumn.
Exceptions
RDBErrif no matching column name is found.
RDBErrif just is invalid justification for RDBColumn.

Definition at line 2354 of file RDB.cc.

◆ setName() [1/2]

void RDB::setName ( const size_t  idx,
const std::string &  name 
)

Modify the name of the RDBColumn at idx.

Parameters
idxindex of RDBColumn.
nameto assign to RDBColumn at idx.
Exceptions
RDBErrif index is out of range.

Definition at line 1487 of file RDB.cc.

◆ setName() [2/2]

void RDB::setName ( const std::string &  name,
const std::string &  newname 
)

Modify the RDBColumn name.

Parameters
nameof RDBColumn
newnamenew name of RDBColumn.
Exceptions
RDBErrif no matching column name is found.
RDBErrif newname is invalid name for RDBColumn.

Definition at line 2223 of file RDB.cc.

◆ setType() [1/2]

void RDB::setType ( const size_t  idx,
const RDBColumn::Type  type 
)

Modify the type of the RDBColumn at idx.

Parameters
idxindex of RDBColumn.
typeRDBColumn type.
Exceptions
RDBErrif index is out of range.
RDBErrif type is invalid RDBColumn type.

Definition at line 1564 of file RDB.cc.

◆ setType() [2/2]

void RDB::setType ( const std::string &  name,
const RDBColumn::Type  type 
)

Modify the RDBColumn type.

Parameters
nameof RDBColumn
typetype of RDBColumn.
Exceptions
RDBErrif no matching column name is found.
RDBErrif type is invalid type for RDBColumn.

Definition at line 2319 of file RDB.cc.

◆ setWidth() [1/2]

void RDB::setWidth ( const size_t  idx,
const long  width 
)

Modify the width of the RDBColumn at idx.

Parameters
idxindex of RDBColumn.
widthRDBColumn width.
Exceptions
RDBErrif index is out of range.
RDBErrif width is invalid RDBColumn width.

Definition at line 1536 of file RDB.cc.

◆ setWidth() [2/2]

void RDB::setWidth ( const std::string &  name,
const long  width 
)

Modify the RDBColumn width.

Parameters
nameof RDBColumn
widthwidth of RDBColumn.
Exceptions
RDBErrif no matching column name is found.
RDBErrif width is invalid width for RDBColumn.

Definition at line 2284 of file RDB.cc.

◆ write()

bool RDB::write ( void  )

Write a line of data to the ostream.

Returns
false if EOF or if the ostream is bad.

Writes the next line of data to the RDB file, if an output stream has been provided. If the RDB header has not been written yet, it outputs the comments, column names and column definitions. If RDB::_autoidx is set, it will advance the indices in the RDBColumn's data pointer before reading and will increment the row number, RDB::_rownum, for the default ‘_NR’ column.

After a successful write, the RDB::_autoidx flag is set to true.

Definition at line 711 of file RDB.cc.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
RDB rdb 
)
friend

Write table to output stream.

Parameters
osthe output stream.
rdbthe table to print.
Returns
A reference to the output stream

Places the table on the output stream.

Definition at line 75 of file RDB.cc.

◆ operator>>

std::istream& operator>> ( std::istream &  is,
RDB rdb 
)
friend

Read table from input stream.

Parameters
isthe input stream.
rdbthe table to fill.
Returns
A reference to the input stream.

If the stream contains a valid rdbtable fill it... otherwise set ios: :failbit. failbit.

Definition at line 37 of file RDB.cc.

Member Data Documentation

◆ _autoidx

bool RDB::_autoidx
protected

Indicates if RDBColumn data elements should be advanced.

Definition at line 331 of file RDB.h.

◆ _cols

RDBColumn** RDB::_cols
protected

Array of RDBColumns.

Definition at line 342 of file RDB.h.

◆ _comms

RDBComment* RDB::_comms
protected

Array of RDBComments.

Definition at line 340 of file RDB.h.

◆ _filename

std::string RDB::_filename
protected

Name of RDB file.

Definition at line 302 of file RDB.h.

◆ _firstread

bool RDB::_firstread
protected

Indicates if this is the first call to RDB::read.

Definition at line 333 of file RDB.h.

◆ _frownum

long RDB::_frownum
protected

Current file row number.

Definition at line 328 of file RDB.h.

◆ _isptr

std::istream* RDB::_isptr
protected

Istream attached to data file.

Definition at line 307 of file RDB.h.

◆ _knowrows

bool RDB::_knowrows
protected

Indicates if associated file must be scanned to determine number of rows.

Definition at line 324 of file RDB.h.

◆ _lastread

bool RDB::_lastread
protected

Indicates if this is the last call to RDB::read.

Definition at line 335 of file RDB.h.

◆ _line

std::string RDB::_line
protected

Line from RDB table.

Definition at line 349 of file RDB.h.

◆ _mode

std::ios::openmode RDB::_mode
protected

Open mode of the associated stream.

Definition at line 304 of file RDB.h.

◆ _mycols

bool* RDB::_mycols
protected

Indicates if RDB object is responsible for deallocating given RDBColumn.

Definition at line 346 of file RDB.h.

◆ _myisptr

bool RDB::_myisptr
protected

Indicates if RDB object is responsible for deallocating the istream.

Definition at line 311 of file RDB.h.

◆ _myosptr

bool RDB::_myosptr
protected

Indicates if RDB object is responsible for deallocating the ostream.

Definition at line 313 of file RDB.h.

◆ _ncols

size_t RDB::_ncols
protected

Number of columns.

Definition at line 320 of file RDB.h.

◆ _ncomms

size_t RDB::_ncomms
protected

Number of comments.

Definition at line 318 of file RDB.h.

◆ _nrcol

RDBLongColumn RDB::_nrcol
protected

Hidden column, containing row number.

Definition at line 344 of file RDB.h.

◆ _nrows

size_t RDB::_nrows
protected

Number of rows.

Definition at line 322 of file RDB.h.

◆ _osptr

std::ostream* RDB::_osptr
protected

Ostream attached to data file.

Definition at line 309 of file RDB.h.

◆ _rewindto

size_t RDB::_rewindto
protected

Position of beginning of first row of data.

Definition at line 316 of file RDB.h.

◆ _rownum

long RDB::_rownum
protected

Current table row number.

Definition at line 326 of file RDB.h.

◆ _writehdr

bool RDB::_writehdr
protected

Indicates if the header has been output.

Definition at line 337 of file RDB.h.


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