25 #ifndef AURORA_2DAFILE_H 26 #define AURORA_2DAFILE_H 31 #include <boost/noncopyable.hpp> 79 bool empty(
size_t column)
const;
86 std::vector<Common::UString>
_data;
137 const std::vector<Common::UString> &
getHeaders()
const;
166 typedef std::map<Common::UString, size_t, Common::UString::iless>
HeaderMap;
206 #endif // AURORA_2DAFILE_H Class to hold the two-dimensional array of a 2DA file.
TwoDAFile(Common::SeekableReadStream &twoda)
void readHeaders2b(Common::SeekableReadStream &twoda)
void load(Common::SeekableReadStream &twoda)
const Common::UString & getString(size_t column) const
Return the contents of a cell as a string.
A class holding an UTF-8 string.
std::map< Common::UString, size_t, Common::UString::iless > HeaderMap
void skipRowNames2b(Common::SeekableReadStream &twoda)
std::vector< Common::UString > _headers
Common::UString _defaultString
The default string to return should a cell not exist.
size_t getRowCount() const
Return the number of rows in the array.
A vector of pointer to objects, with automatic deletion.
size_t getColumnCount() const
Return the number of columns in the array.
void writeCSV(Common::WriteStream &out) const
Write the 2DA data into a CSV stream.
int32 _defaultInt
The default int to return should a cell not exist.
void readRows2b(Common::SeekableReadStream &twoda)
Base for BioWare's Aurora engine files.
static void destroy(T *x)
std::vector< Common::UString > _data
void writeASCII(Common::WriteStream &out) const
Write the 2DA data into an V2.0 ASCII 2DA.
Low-level type definitions to handle fixed width types portably.
void read2a(Common::SeekableReadStream &twoda)
void writeBinary(Common::WriteStream &out) const
Write the 2DA data into an V2.b binary 2DA.
A vector storing pointer to objects, with automatic deletion.
int32 getInt(size_t column) const
Return the contents of a cell as an int.
Generic interface for a writable data stream.
void readDefault2a(Common::SeekableReadStream &twoda, Common::StreamTokenizer &tokenize)
static float parseFloat(const Common::UString &str)
const std::vector< Common::UString > & getHeaders() const
Return the columns' headers.
bool empty(size_t column) const
Check if the cell is empty.
const TwoDARow & getRow(size_t row) const
Get a row.
void readRows2a(Common::SeekableReadStream &twoda, Common::StreamTokenizer &tokenize)
Base class for most files found in games using BioWare's Aurora engine.
void readHeaders2a(Common::SeekableReadStream &twoda, Common::StreamTokenizer &tokenize)
Common::PtrVector< TwoDARow > _rows
float _defaultFloat
The default float to return should a cell not exist.
const Common::UString & getCell(size_t n) const
static int32 parseInt(const Common::UString &str)
TwoDAFile * _parent
The parent 2DA.
void read2b(Common::SeekableReadStream &twoda)
Interface for a seekable & readable data stream.
size_t headerToColumn(const Common::UString &header) const
Translate a column header to a column index.
TwoDARow(TwoDAFile &parent)
Class to hold the GFF'd two-dimensional array of a GDA file.
float getFloat(size_t column) const
Return the contents of a cell as a float.