8#include <unordered_map>
34 explicit operator bool()
const {
return isValid(); }
38 uint32_t
getUInt(
const std::string& field,
unsigned int arrayIndex = 0)
const;
39 int32_t
getInt(
const std::string& field,
unsigned int arrayIndex = 0)
const;
40 float getFloat(
const std::string& field,
unsigned int arrayIndex = 0)
const;
41 std::string
getString(
const std::string& field,
unsigned int arrayIndex = 0)
const;
52 DB2Table(std::unique_ptr<DB2Reader> reader, std::vector<DB2FieldInfo> fields);
Unified reader for WDC2, WDC3, WDC4 and WDC5 DB2 files.
Lightweight handle to a single row in a DB2Table.
std::string getString(const std::string &field, unsigned int arrayIndex=0) const
float getFloat(const std::string &field, unsigned int arrayIndex=0) const
int32_t getInt(const std::string &field, unsigned int arrayIndex=0) const
uint32_t recordID() const
uint32_t getUInt(const std::string &field, unsigned int arrayIndex=0) const
DB2Row(const DB2Table *table, size_t recordIndex)
bool operator!=(const Iterator &other) const
Iterator(const DB2Table *table, size_t index)
Provides typed, field-name-based access to records in a WDC DB2 file.
DB2Row getRow(uint32_t id) const
const DB2FieldInfo * findField(const std::string &name) const
uint32_t readUInt(size_t recordIndex, const DB2FieldInfo &field, unsigned int arrayIndex) const
std::vector< DB2FieldInfo > m_fields
size_t getRowCount() const
DB2Table(const DB2Table &)=delete
DB2Row getRowByIndex(size_t index) const
std::unordered_map< std::string, size_t > m_fieldNameToIndex
std::string readString(size_t recordIndex, const DB2FieldInfo &field, unsigned int arrayIndex) const
DB2Table & operator=(const DB2Table &)=delete
std::unique_ptr< DB2Reader > m_reader
const DB2FieldInfo * resolveField(const std::string &name, unsigned int &arrayIndex) const
uint32_t getRecordID(size_t recordIndex) const
Describes a single field (column) in a DB2 table.
bool isRelationshipData
Whether this field is relationship data.
int pos
DB2 field position index (-1 for non-inline/key).
std::string name
Column name.
std::string type
Type string ("text", "float", "int8", "uint8", etc.).
unsigned int arraySize
Array size (> 1 for array fields).
bool isKey
Whether this field is the primary key.