27#include "CXMLSpreadsheet.h"
28#include "Serializable/CObjectSerializable.h"
42 std::vector<std::string> m_column;
84 return m_column[index].c_str();
93 return (u32)m_column.size();
102 return (u32)m_sheet->Rows.size();
147 u32
fetchData(std::vector<T*>& data, u32 fromRow,
int count)
149 std::vector<CXMLSpreadsheet::SRow*>::iterator i = m_sheet->Rows.begin(), end = m_sheet->Rows.end();
153 if (row->
Index < fromRow)
161 if (row->
Index >= fromRow + (u32)count)
167 if (objectSerizable == NULL)
180 return (u32)data.size();
Definition CObjectSerializable.h:36
u32 fetchData(std::vector< T * > &data, u32 fromRow, int count)
Create and fill typed serializable objects from sheet rows.
Definition CXMLTableData.h:147
void addColumn(const char *name)
Append a column mapping.
u32 fetchData(std::function< CObjectSerializable *()> creatorFunc, std::vector< CObjectSerializable * > &data, u32 fromRow, int count)
Create and fill serializable objects from sheet rows.
void freeData(std::vector< T * > &data)
Delete all pointers in a fetched data vector and clear it.
Definition CXMLTableData.h:128
virtual ~CXMLTableData()
Destroy the table adapter.
CXMLTableData(CXMLSpreadsheet::SSheet *sheet)
Construct a table adapter for a sheet.
u32 getNumColumn()
Get the number of mapped columns.
Definition CXMLTableData.h:91
const char * getColumn(u32 index)
Get a column mapping name.
Definition CXMLTableData.h:82
void insertColumn(const char *name, u32 position)
Insert a column mapping at a position.
void removeColumn(u32 index)
Remove a column mapping.
u32 getNumRow()
Get the number of rows in the source sheet.
Definition CXMLTableData.h:100
void copyRowToObject(CXMLSpreadsheet::SRow *row, CObjectSerializable *data)
Copy one spreadsheet row into a serializable object.
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29
One spreadsheet row that owns its cells.
Definition CXMLSpreadsheet.h:99
u32 Index
Row index from the source document.
Definition CXMLSpreadsheet.h:101
One spreadsheet sheet that owns its rows.
Definition CXMLSpreadsheet.h:122