27#include "Serializable/CObjectSerializable.h"
156 std::vector<SSheet*> m_sheets;
181 bool open(io::IXMLReader* xmlReader);
196 return (u32)m_sheets.size();
245 std::list<SCell*>
getRange(
SSheet* sheet, u32 fromRow, u32 fromCol, u32 toRow, u32 toCol);
279 bool splitCsvLine(
const std::string& line,
char delimiter, std::vector<std::string>& cells);
287 bool combineLine(std::vector<std::string>& cols, std::vector<std::string>& cells);
virtual ~CXMLSpreadsheet()
Destroy the spreadsheet and all loaded data.
std::list< SCell * > getRange(SSheet *sheet, u32 fromRow, u32 fromCol, u32 toRow, u32 toCol)
Get all cells inside a rectangular range.
SCell * getCell(SSheet *sheet, const char *cellName)
Find a cell by spreadsheet cell name.
SSheet * operator[](int i)
Get a sheet by index.
Definition CXMLSpreadsheet.h:214
bool splitCsvLine(const std::string &line, char delimiter, std::vector< std::string > &cells)
Split one CSV line into cell strings.
void clear()
Clear all loaded sheets and data.
bool open(io::IXMLReader *xmlReader)
Load spreadsheet data from an existing XML reader.
SSheet * getSheet(int i)
Get a sheet by index.
Definition CXMLSpreadsheet.h:204
std::list< SCell * > getRange(SSheet *sheet, const char *from, const char *to)
Get all cells inside a named rectangular range.
bool convertCellName(const char *cellName, u32 &row, u32 &col)
Convert a spreadsheet cell name into row and column indexes.
SCell * getCell(SSheet *sheet, u32 row, u32 col)
Find a cell by row and column.
u32 getSheetCount()
Get the number of loaded sheets.
Definition CXMLSpreadsheet.h:194
bool open(const char *file)
Load spreadsheet data from an XML file.
CXMLSpreadsheet()
Construct an empty spreadsheet.
bool openCSV(const char *file)
Load spreadsheet data from a CSV file.
bool combineLine(std::vector< std::string > &cols, std::vector< std::string > &cells)
Combine parsed columns with continuation cells for multi-line CSV fields.
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29
One spreadsheet cell.
Definition CXMLSpreadsheet.h:45
u32 Col
One-based column index from the source document.
Definition CXMLSpreadsheet.h:49
u32 Row
One-based row index from the source document.
Definition CXMLSpreadsheet.h:47
int TimeMonth
Time month component.
Definition CXMLSpreadsheet.h:65
float NumberFloat
Floating-point numeric value.
Definition CXMLSpreadsheet.h:59
int NumberInt
Integer numeric value.
Definition CXMLSpreadsheet.h:57
int TimeDay
Time day component.
Definition CXMLSpreadsheet.h:67
EPropertyDataType Type
Serialized property type of this cell.
Definition CXMLSpreadsheet.h:51
int TimeYear
Time year component.
Definition CXMLSpreadsheet.h:63
long Time
Time value represented as seconds.
Definition CXMLSpreadsheet.h:61
SCell()
Construct an empty string cell.
Definition CXMLSpreadsheet.h:78
int TimeHour
Time hour component.
Definition CXMLSpreadsheet.h:69
std::string Value
Narrow string value.
Definition CXMLSpreadsheet.h:53
int TimeSec
Time second component.
Definition CXMLSpreadsheet.h:73
std::wstring UnicodeValue
Unicode string value.
Definition CXMLSpreadsheet.h:55
int TimeMin
Time minute component.
Definition CXMLSpreadsheet.h:71
One spreadsheet row that owns its cells.
Definition CXMLSpreadsheet.h:99
u32 Index
Row index from the source document.
Definition CXMLSpreadsheet.h:101
~SRow()
Destroy all cells in the row.
Definition CXMLSpreadsheet.h:108
std::vector< SCell * > Cells
Cells contained in this row.
Definition CXMLSpreadsheet.h:103
One spreadsheet sheet that owns its rows.
Definition CXMLSpreadsheet.h:122
int NumRow
Declared number of rows.
Definition CXMLSpreadsheet.h:124
int NumCol
Declared number of columns.
Definition CXMLSpreadsheet.h:126
std::string Name
Sheet name as narrow text.
Definition CXMLSpreadsheet.h:128
void clear()
Remove and delete all rows.
Definition CXMLSpreadsheet.h:145
std::wstring NameUnicode
Sheet name as Unicode text.
Definition CXMLSpreadsheet.h:130
~SSheet()
Destroy all rows in the sheet.
Definition CXMLSpreadsheet.h:137
std::vector< SRow * > Rows
Rows contained in the sheet.
Definition CXMLSpreadsheet.h:132