OECSVHeader¶
class OECSVHeader
This class stores the column names to be read or written to a
OEFormat_CSV
file. It is typically retrieved
from an oemolstreambase through the
oemolstreambase.GetCSVHeader
method. The object
available from that method is initialized during the first read or
write operation on that stream.
See also
OECreateCSVHeader
for creating a
OECSVHeader from the SD data tag in a molecule.
Constructors¶
OECSVHeader()
OECSVHeader(const OECSVHeader &rhs)
OECSVHeader(const std::vector<std::string> &columnNames)
The default constructors initializes the object to an empty
state. The copy constructor can be used to make a copy from
about OECSVHeader object. The class can also be
constructed directly from a std::vector
of std::string
.
operator=¶
OECSVHeader &operator=(const OECSVHeader &rhs)
Assignment operator to copy the contents of rhs
into this class.
operator bool¶
operator bool() const
Returns false
if this class has not been initialized with
any column names yet. Returns true
if this class does
contain column names.
GetColumnName¶
const std::string &GetColumnName(unsigned int fieldIdx) const
Return the column name for the particular index, starting at
zero. If fieldIdx
is not less than
OECSVHeader.GetNumColumns
, a reference to an
empty string is returned.
GetColumnNames¶
OESystem::OEIterBase<const std::string> *GetColumnNames() const
Returns an iterator over all the column names stored in this class.
GetNumColumns¶
unsigned int GetNumColumns() const
Returns the number of column names stored in this class.
IsValid¶
bool IsValid() const
Returns false
if this class has not been initialized with
any column names yet. Returns true
if this class does
contain column names.