Isis Developer Reference
TableRecord.h
Go to the documentation of this file.
1 #ifndef TableRecord_h
2 #define TableRecord_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 #include <vector>
11 #include "TableField.h"
12 
13 namespace Isis {
38  class TableRecord {
39  public:
40  TableRecord();
41  ~TableRecord();
42 
43 
44  static QString toString(TableRecord record, QString fieldDelimiter = ",", bool fieldNames = false, bool endLine = true);
45 
46  void operator+=(Isis::TableField &field);
47  TableField&operator [](const int field);
48  TableField &operator[](const QString &field);
49 
50  int Fields() const;
51  int RecordSize() const;
52 
53  void Pack(char *buf) const;
54  void Unpack(const char *buf);
55  void Swap(char *buf) const;
56 
57  private:
58  std::vector<TableField> p_fields;
60  };
61 };
62 
63 #endif
Isis::TableRecord::Pack
void Pack(char *buf) const
Writes record information into the binary buffer.
Definition: TableRecord.cpp:100
TableField.h
Isis::TableRecord::operator[]
TableField & operator[](const int field)
Returns the TableField at the specified location in the TableRecord.
Definition: TableRecord.cpp:45
Isis::TableRecord::Fields
int Fields() const
Returns the number of fields that are currently in the record.
Definition: TableRecord.cpp:78
Isis::TableRecord
Definition: TableRecord.h:38
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::TableRecord::~TableRecord
~TableRecord()
Destroys the TableRecord object.
Definition: TableRecord.cpp:25
Isis::TableField::isInteger
bool isInteger() const
Determines whether the field type is Integer.
Definition: TableField.cpp:122
IString.h
Isis::IString::UpCase
IString UpCase()
Converst any lower case characters in the object IString with uppercase characters.
Definition: IString.cpp:617
Isis::TableRecord::RecordSize
int RecordSize() const
Returns the number of bytes per record.
Definition: TableRecord.cpp:87
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::TableField::isReal
bool isReal() const
Determines whether the field type is Text.
Definition: TableField.cpp:150
Isis::TableField::bytes
int bytes() const
Returns the number of bytes in the field value.
Definition: TableField.cpp:159
Isis::TableRecord::TableRecord
TableRecord()
Constructs an empty TableRecord object. No member variables are set.
Definition: TableRecord.cpp:21
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::TableField::isDouble
bool isDouble() const
Determines whether the field type is Double.
Definition: TableField.cpp:132
Isis::TableField::size
int size() const
Returns the number of values stored for the field at each record.
Definition: TableField.cpp:168
Isis::TableRecord::Unpack
void Unpack(const char *buf)
Reads record information from the binary buffer.
Definition: TableRecord.cpp:152
IException.h
std
Namespace for the standard library.
Isis::TableField::isText
bool isText() const
Determines whether the field type is Text.
Definition: TableField.cpp:141
TableRecord.h
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
Isis::TableRecord::toString
static QString toString(TableRecord record, QString fieldDelimiter=",", bool fieldNames=false, bool endLine=true)
Definition: TableRecord.cpp:230
Isis::TableRecord::operator+=
void operator+=(Isis::TableField &field)
Adds a TableField to a TableRecord.
Definition: TableRecord.cpp:34
Isis::TableRecord::Swap
void Swap(char *buf) const
Swaps bytes of the buffer, depending on the TableField::Type.
Definition: TableRecord.cpp:168
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::TableField
Class for storing an Isis::Table's field information.
Definition: TableField.h:47