|
Isis 3 Programmer Reference
|
1 #ifndef ImportPdsTable_h
2 #define ImportPdsTable_h
12 #include <QStringList>
105 const QString &pdsTabFile=
"",
106 const QString &pdsTableName =
"TABLE");
109 QString
name()
const;
115 void load(
const QString &pdsLabFile,
const QString &pdsTabFile =
"",
116 const QString &pdsTableName =
"TABLE");
118 bool hasColumn(
const QString &colName)
const;
120 const bool &formatted =
true)
const;
124 QString
getType(
const QString &colName)
const;
125 bool setType(
const QString &colName,
const QString &dataType);
129 const QString &isisTableName);
131 const QString &isisTableName);
157 const QString &delimiter =
"")
const;
160 const QString &delimiter =
"")
const;
165 virtual bool processRow(
const int &row,
const QString &rowdata);
171 void loadLabel(
const QString &labfile, QString &tblfile,
172 const QString &tblname =
"");
TableField makeField(const ColumnDescr &cdesc)
Creates a TableField for the column type.
QString getColumnName(const unsigned int &index=0, const bool &formatted=true) const
Returns the name of the specifed column.
QString m_pdsTableFile
The name of the file containing the table data.
int m_pdsTableStart
The start byte of the PDS table data.
TableRecord makeRecord(const ColumnTypes &ctypes)
Creates a TableRecord for columns.
void fillTable(Table &table, const ColumnTypes &columns, TableRecord &record) const
Fill the ISIS Table object with PDS table data.
Contains Pvl Groups and Pvl Objects.
Import a PDS table file with a label description.
void load(const QString &pdsLabFile, const QString &pdsTabFile="", const QString &pdsTableName="TABLE")
Loads a PDS table label and (optional) data file.
int m_items
Number of items in column.
void loadTable(const QString &tabfile)
Loads the contents of a PDS table data file.
const ColumnDescr & getColumnDescriptor(const int &nth) const
Retrieve a column description by index.
int m_colnum
Column number.
virtual bool processRow(const int &row, const QString &rowdata)
Process a freshly read PDS table line of data.
int m_startByte
Starting byte of data.
int m_numBytes
Number bytes in column.
int rows() const
Returns the number of rows in the table.
QString getFormattedName(const QString &colname) const
Converts a column name to a camel-case after it has been cleansed.
QString getGenericType(const QString &ttype) const
Determine generic data type of a column.
QString getColumnValue(const QString &tline, const ColumnDescr &cdesc, const QString &delimiter="") const
Extracts a column from a QString based upon a description.
ImportPdsTable()
Default constructor.
ColumnTypes m_coldesc
Column descriptions.
virtual ~ImportPdsTable()
Destructs the ImportPdsTable object.
void setPdsByteOrder(QString byteOrder)
Sets the byte order for BINARY PDS table files.
bool setType(const QString &colName, const QString &dataType)
Change the datatype for a column.
int m_recordBytes
The number of bytes for one Isis table record.
QString m_byteOrder
The byte order of the PDS table file, if binary.
int m_trows
Number rows in table according to label.
TableField makeFieldFromBinaryTable(const ColumnDescr &cdesc)
Creates an empty TableField with the appropriate type from a binary PDS table column description.
Class for storing Table blobs information.
void init()
Initialize object variables.
ColumnDescr getColumnDescription(PvlObject &colobj, int nth) const
Extract a column description from a COLUMN object.
QStringList getColumnNames(const bool &formatted=true) const
Return the names of all the columns.
QString m_name
Name of column.
int m_rowBytes
The number of bytes for one PDS table row.
QString m_dataType
PDS table DATA_TYPE of column.
QStringList getColumnFields(const QString &tline, const ColumnDescr &cdesc, const QString &delimiter="") const
Extracts column fields from a QString based upon a description.
Table importTable(const QString &isisTableName)
Populate a Table object with the PDS table and return it.
QString name() const
Return the name of the PDS table.
bool hasColumn(const QString &colName) const
This method determines whether the PDS table has a column with the given name.
void loadLabel(const QString &labfile, QString &tblfile, const QString &tblname="")
Loads the contents of a PDS table label description.
ColumnDescr * findColumn(const QString &colName)
Searches internal column descriptors for a named column.
int m_itemBytes
Number bytes per item.
QString m_tableName
The name of the PDS table object.
TableField & extract(const Columns &columns, const ColumnDescr &cdesc, TableField &field) const
Extract a TableField from a PDS column in the text row.
void setName(const QString &name="TABLE")
Set the name of the PDS table object.
QString m_pdsTableType
The INTERCHANGE_FORMAT value for the table.
This is free and unencumbered software released into the public domain.
QString getType(const QString &colName) const
Get the type associated with the specified column.
int columns() const
Returns the number of columns in the table.
TableRecord extractBinary(char *rowBuffer, TableRecord &record) const
This method is used to set the field values for the given record.
Class for storing an Isis::Table's field information.