NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
#include <BasicExcel.hpp>
Public Member Functions | |
BasicExcel () | |
BasicExcel (const char *filename) | |
~BasicExcel () | |
void | New (int sheets=3) |
Create a new Excel workbook with a given number of spreadsheets (Minimum 1). More... | |
bool | Load (const char *filename) |
Load an Excel workbook from a file. More... | |
bool | Save () |
Save current Excel workbook to opened file. More... | |
bool | SaveAs (const char *filename) |
Save current Excel workbook to a file. More... | |
size_t | GetTotalWorkSheets () |
Total number of Excel worksheets in current Excel workbook. More... | |
BasicExcelWorksheet * | GetWorksheet (size_t sheetIndex) |
Get a pointer to an Excel worksheet at the given index. Index starts from 0. Returns 0 if index is invalid. More... | |
BasicExcelWorksheet * | GetWorksheet (const char *name) |
Get a pointer to an Excel worksheet that has given ANSI name. Returns 0 if there is no Excel worksheet with the given name. More... | |
BasicExcelWorksheet * | GetWorksheet (const wchar_t *name) |
Get a pointer to an Excel worksheet that has given Unicode name. Returns 0 if there is no Excel worksheet with the given name. More... | |
BasicExcelWorksheet * | AddWorksheet (int sheetIndex=-1) |
Add a new Excel worksheet to the given index. Name given to worksheet is SheetX, where X is a number which starts from 1. Index starts from 0. Worksheet is added to the last position if sheetIndex == -1. Returns a pointer to the worksheet if successful, 0 if otherwise. More... | |
BasicExcelWorksheet * | AddWorksheet (const char *name, int sheetIndex=-1) |
Add a new Excel worksheet with given ANSI name to the given index. Index starts from 0. Worksheet is added to the last position if sheetIndex == -1. Returns a pointer to the worksheet if successful, 0 if otherwise. More... | |
BasicExcelWorksheet * | AddWorksheet (const wchar_t *name, int sheetIndex=-1) |
Add a new Excel worksheet with given Unicode name to the given index. Index starts from 0. Worksheet is added to the last position if sheetIndex == -1. Returns a pointer to the worksheet if successful, 0 if otherwise. More... | |
bool | DeleteWorksheet (size_t sheetIndex) |
Delete an Excel worksheet at the given index. Index starts from 0. Returns true if successful, false if otherwise. More... | |
bool | DeleteWorksheet (const char *name) |
Delete an Excel worksheet that has given ANSI name. Returns true if successful, false if otherwise. More... | |
bool | DeleteWorksheet (const wchar_t *name) |
Delete an Excel worksheet that has given Unicode name. Returns true if successful, false if otherwise. More... | |
char * | GetAnsiSheetName (size_t sheetIndex) |
Get the worksheet name at the given index. Index starts from 0. Returns 0 if name is in Unicode format. More... | |
wchar_t * | GetUnicodeSheetName (size_t sheetIndex) |
Get the worksheet name at the given index. Index starts from 0. Returns 0 if name is in Ansi format. More... | |
bool | GetSheetName (size_t sheetIndex, char *name) |
Get the worksheet name at the given index. Index starts from 0. Returns false if name is in Unicode format. More... | |
bool | GetSheetName (size_t sheetIndex, wchar_t *name) |
Get the worksheet name at the given index. Index starts from 0. Returns false if name is in Ansi format. More... | |
bool | RenameWorksheet (size_t sheetIndex, const char *to) |
Rename an Excel worksheet at the given index to the given ANSI name. Index starts from 0. Returns true if successful, false if otherwise. More... | |
bool | RenameWorksheet (size_t sheetIndex, const wchar_t *to) |
Rename an Excel worksheet at the given index to the given Unicode name. Index starts from 0. Returns true if successful, false if otherwise. More... | |
bool | RenameWorksheet (const char *from, const char *to) |
Rename an Excel worksheet that has given ANSI name to another ANSI name. Returns true if successful, false if otherwise. More... | |
bool | RenameWorksheet (const wchar_t *from, const wchar_t *to) |
Rename an Excel worksheet that has given Unicode name to another Unicode name. Returns true if successful, false if otherwise. More... | |
Public Attributes | |
CompoundFile | file_ |
Compound file handler. More... | |
Workbook | workbook_ |
Raw Workbook. More... | |
std::vector< Worksheet > | worksheets_ |
Raw Worksheets. More... | |
std::vector< BasicExcelWorksheet > | yesheets_ |
Parsed Worksheets. More... | |
Private Types | |
enum | { WORKBOOK_GLOBALS =0x0005 , VISUAL_BASIC_MODULE =0x0006 , WORKSHEET =0x0010 , CHART =0x0020 } |
Private Member Functions | |
size_t | Read (const char *data, size_t dataSize) |
size_t | Write (char *data) |
void | AdjustStreamPositions () |
void | AdjustBoundSheetBOFPositions () |
void | AdjustDBCellPositions () |
void | AdjustExtSSTPositions () |
void | UpdateYExcelWorksheet () |
Update yesheets_ using information from worksheets_. More... | |
void | UpdateWorksheets () |
Update worksheets_ using information from yesheets_. More... | |
Definition at line 1112 of file BasicExcel.hpp.
|
private |
Enumerator | |
---|---|
WORKBOOK_GLOBALS | |
VISUAL_BASIC_MODULE | |
WORKSHEET | |
CHART |
Definition at line 1158 of file BasicExcel.hpp.
YExcel::BasicExcel::BasicExcel | ( | ) |
Definition at line 4466 of file BasicExcel.cpp.
YExcel::BasicExcel::BasicExcel | ( | const char * | filename | ) |
Definition at line 4467 of file BasicExcel.cpp.
YExcel::BasicExcel::~BasicExcel | ( | ) |
Definition at line 4472 of file BasicExcel.cpp.
BasicExcelWorksheet * YExcel::BasicExcel::AddWorksheet | ( | const char * | name, |
int | sheetIndex = -1 |
||
) |
Add a new Excel worksheet with given ANSI name to the given index. Index starts from 0. Worksheet is added to the last position if sheetIndex == -1. Returns a pointer to the worksheet if successful, 0 if otherwise.
Definition at line 4612 of file BasicExcel.cpp.
References name, YExcel::Workbook::BoundSheet::name_, YExcel::Worksheet::Window2::options_, YExcel::BasicExcelWorksheet::sheetIndex_, YExcel::Worksheet::window2_, and YExcel::Worksheet::Worksheet().
BasicExcelWorksheet * YExcel::BasicExcel::AddWorksheet | ( | const wchar_t * | name, |
int | sheetIndex = -1 |
||
) |
Add a new Excel worksheet with given Unicode name to the given index. Index starts from 0. Worksheet is added to the last position if sheetIndex == -1. Returns a pointer to the worksheet if successful, 0 if otherwise.
Definition at line 4653 of file BasicExcel.cpp.
References name, YExcel::Workbook::BoundSheet::name_, YExcel::Worksheet::Window2::options_, YExcel::BasicExcelWorksheet::sheetIndex_, YExcel::Worksheet::window2_, and YExcel::Worksheet::Worksheet().
BasicExcelWorksheet * YExcel::BasicExcel::AddWorksheet | ( | int | sheetIndex = -1 | ) |
Add a new Excel worksheet to the given index. Name given to worksheet is SheetX, where X is a number which starts from 1. Index starts from 0. Worksheet is added to the last position if sheetIndex == -1. Returns a pointer to the worksheet if successful, 0 if otherwise.
Definition at line 4595 of file BasicExcel.cpp.
|
private |
Definition at line 4922 of file BasicExcel.cpp.
|
private |
Definition at line 4933 of file BasicExcel.cpp.
References YExcel::Worksheet::cellTable_, and YExcel::Worksheet::CellTable::rowBlocks_.
|
private |
Definition at line 4995 of file BasicExcel.cpp.
|
private |
Definition at line 4915 of file BasicExcel.cpp.
bool YExcel::BasicExcel::DeleteWorksheet | ( | const char * | name | ) |
Delete an Excel worksheet that has given ANSI name. Returns true if successful, false if otherwise.
Definition at line 4707 of file BasicExcel.cpp.
References name.
bool YExcel::BasicExcel::DeleteWorksheet | ( | const wchar_t * | name | ) |
Delete an Excel worksheet that has given Unicode name. Returns true if successful, false if otherwise.
Definition at line 4720 of file BasicExcel.cpp.
References name.
bool YExcel::BasicExcel::DeleteWorksheet | ( | size_t | sheetIndex | ) |
Delete an Excel worksheet at the given index. Index starts from 0. Returns true if successful, false if otherwise.
Definition at line 4693 of file BasicExcel.cpp.
char * YExcel::BasicExcel::GetAnsiSheetName | ( | size_t | sheetIndex | ) |
Get the worksheet name at the given index. Index starts from 0. Returns 0 if name is in Unicode format.
Definition at line 4734 of file BasicExcel.cpp.
bool YExcel::BasicExcel::GetSheetName | ( | size_t | sheetIndex, |
char * | name | ||
) |
Get the worksheet name at the given index. Index starts from 0. Returns false if name is in Unicode format.
Definition at line 4758 of file BasicExcel.cpp.
References name.
bool YExcel::BasicExcel::GetSheetName | ( | size_t | sheetIndex, |
wchar_t * | name | ||
) |
Get the worksheet name at the given index. Index starts from 0. Returns false if name is in Ansi format.
Definition at line 4771 of file BasicExcel.cpp.
References name.
size_t YExcel::BasicExcel::GetTotalWorkSheets | ( | ) |
Total number of Excel worksheets in current Excel workbook.
Definition at line 4551 of file BasicExcel.cpp.
Referenced by NumeRe::XLSSpreadSheet::readFile().
wchar_t * YExcel::BasicExcel::GetUnicodeSheetName | ( | size_t | sheetIndex | ) |
Get the worksheet name at the given index. Index starts from 0. Returns 0 if name is in Ansi format.
Definition at line 4746 of file BasicExcel.cpp.
BasicExcelWorksheet * YExcel::BasicExcel::GetWorksheet | ( | const char * | name | ) |
Get a pointer to an Excel worksheet that has given ANSI name. Returns 0 if there is no Excel worksheet with the given name.
Definition at line 4566 of file BasicExcel.cpp.
References name.
BasicExcelWorksheet * YExcel::BasicExcel::GetWorksheet | ( | const wchar_t * | name | ) |
Get a pointer to an Excel worksheet that has given Unicode name. Returns 0 if there is no Excel worksheet with the given name.
Definition at line 4579 of file BasicExcel.cpp.
References name.
BasicExcelWorksheet * YExcel::BasicExcel::GetWorksheet | ( | size_t | sheetIndex | ) |
Get a pointer to an Excel worksheet at the given index. Index starts from 0. Returns 0 if index is invalid.
Definition at line 4559 of file BasicExcel.cpp.
Referenced by NumeRe::XLSSpreadSheet::readFile(), and NumeRe::XLSSpreadSheet::writeFile().
bool YExcel::BasicExcel::Load | ( | const char * | filename | ) |
Load an Excel workbook from a file.
Definition at line 4494 of file BasicExcel.cpp.
References YExcel::Worksheet::Read().
Referenced by NumeRe::XLSSpreadSheet::readFile().
void YExcel::BasicExcel::New | ( | int | sheets = 3 | ) |
Create a new Excel workbook with a given number of spreadsheets (Minimum 1).
Definition at line 4478 of file BasicExcel.cpp.
Referenced by NumeRe::XLSSpreadSheet::writeFile().
|
private |
Definition at line 4863 of file BasicExcel.cpp.
References YExcel::CODE::BOF, YCompoundFiles::LittleEndian::Read(), YExcel::Record::Read(), YExcel::BOF::Read(), YExcel::BOF::type_, and YExcel::Worksheet::Worksheet().
bool YExcel::BasicExcel::RenameWorksheet | ( | const char * | from, |
const char * | to | ||
) |
Rename an Excel worksheet that has given ANSI name to another ANSI name. Returns true if successful, false if otherwise.
Definition at line 4821 of file BasicExcel.cpp.
bool YExcel::BasicExcel::RenameWorksheet | ( | const wchar_t * | from, |
const wchar_t * | to | ||
) |
Rename an Excel worksheet that has given Unicode name to another Unicode name. Returns true if successful, false if otherwise.
Definition at line 4843 of file BasicExcel.cpp.
bool YExcel::BasicExcel::RenameWorksheet | ( | size_t | sheetIndex, |
const char * | to | ||
) |
Rename an Excel worksheet at the given index to the given ANSI name. Index starts from 0. Returns true if successful, false if otherwise.
Definition at line 4784 of file BasicExcel.cpp.
Referenced by NumeRe::XLSSpreadSheet::writeFile().
bool YExcel::BasicExcel::RenameWorksheet | ( | size_t | sheetIndex, |
const wchar_t * | to | ||
) |
Rename an Excel worksheet at the given index to the given Unicode name. Index starts from 0. Returns true if successful, false if otherwise.
Definition at line 4803 of file BasicExcel.cpp.
bool YExcel::BasicExcel::Save | ( | ) |
Save current Excel workbook to opened file.
Definition at line 4512 of file BasicExcel.cpp.
References YCompoundFiles::CompoundFile::SUCCESS, and YExcel::Worksheet::Write().
bool YExcel::BasicExcel::SaveAs | ( | const char * | filename | ) |
Save current Excel workbook to a file.
Definition at line 4540 of file BasicExcel.cpp.
References YCompoundFiles::CompoundFile::SUCCESS.
Referenced by NumeRe::XLSSpreadSheet::writeFile().
|
private |
Update worksheets_ using information from yesheets_.
Definition at line 5095 of file BasicExcel.cpp.
References YExcel::CanStoreAsRKValue(), YExcel::Worksheet::CellTable::RowBlock::CellBlock::LabelSST::colIndex_, YExcel::Worksheet::CellTable::RowBlock::CellBlock::Number::colIndex_, YExcel::Worksheet::CellTable::RowBlock::CellBlock::RK::colIndex_, YExcel::Worksheet::CellTable::RowBlock::dbcell_, YExcel::Worksheet::dimensions_, YExcel::BasicExcelCell::DOUBLE, YExcel::Worksheet::CellTable::RowBlock::CellBlock::MulRK::firstColIndex_, YExcel::Worksheet::Index::firstUnusedRowIndex_, YExcel::Worksheet::Dimensions::firstUsedColIndex_, YExcel::Worksheet::Index::firstUsedRowIndex_, YExcel::BasicExcelCell::Get(), YExcel::BasicExcelCell::GetDouble(), YExcel::BasicExcelCell::GetInteger(), YExcel::GetRKValueFromDouble(), YExcel::GetRKValueFromInteger(), YExcel::BasicExcelCell::GetStringLength(), YExcel::Worksheet::index_, YExcel::BasicExcelCell::INT, YExcel::CODE::LABELSST, YExcel::Worksheet::CellTable::RowBlock::CellBlock::labelsst_, YExcel::Worksheet::CellTable::RowBlock::CellBlock::MulRK::lastColIndex_, YExcel::CODE::MULRK, YExcel::Worksheet::CellTable::RowBlock::CellBlock::mulrk_, YExcel::Worksheet::CellTable::RowBlock::CellBlock::normalType_, YExcel::CODE::NUMBER, YExcel::Worksheet::CellTable::RowBlock::CellBlock::number_, YExcel::Worksheet::CellTable::RowBlock::DBCell::offsets_, YExcel::CODE::RK, YExcel::Worksheet::CellTable::RowBlock::CellBlock::rk_, YExcel::Worksheet::CellTable::RowBlock::CellBlock::LabelSST::rowIndex_, YExcel::Worksheet::CellTable::RowBlock::CellBlock::MulRK::rowIndex_, YExcel::Worksheet::CellTable::RowBlock::CellBlock::Number::rowIndex_, YExcel::Worksheet::CellTable::RowBlock::CellBlock::RK::rowIndex_, YExcel::Worksheet::CellTable::RowBlock::rows_, YExcel::Worksheet::CellTable::RowBlock::CellBlock::LabelSST::SSTRecordIndex_, YExcel::BasicExcelCell::STRING, YExcel::BasicExcelCell::Type(), YExcel::Worksheet::CellTable::RowBlock::CellBlock::type_, YExcel::BasicExcelCell::UNDEFINED, YExcel::Worksheet::CellTable::RowBlock::CellBlock::Number::value_, YExcel::Worksheet::CellTable::RowBlock::CellBlock::RK::value_, YExcel::BasicExcelCell::WSTRING, and YExcel::Worksheet::CellTable::RowBlock::CellBlock::MulRK::XFRK_.
|
private |
Update yesheets_ using information from worksheets_.
Definition at line 5083 of file BasicExcel.cpp.
|
private |
Definition at line 4902 of file BasicExcel.cpp.
CompoundFile YExcel::BasicExcel::file_ |
Compound file handler.
Definition at line 1166 of file BasicExcel.hpp.
Workbook YExcel::BasicExcel::workbook_ |
Raw Workbook.
Definition at line 1167 of file BasicExcel.hpp.
Referenced by YExcel::BasicExcelWorksheet::GetAnsiSheetName(), YExcel::BasicExcelWorksheet::GetSheetName(), YExcel::BasicExcelWorksheet::GetUnicodeSheetName(), YExcel::BasicExcelWorksheet::Rename(), and YExcel::BasicExcelWorksheet::UpdateCells().
std::vector<Worksheet> YExcel::BasicExcel::worksheets_ |
Raw Worksheets.
Definition at line 1168 of file BasicExcel.hpp.
Referenced by YExcel::BasicExcelWorksheet::UpdateCells().
std::vector<BasicExcelWorksheet> YExcel::BasicExcel::yesheets_ |
Parsed Worksheets.
Definition at line 1169 of file BasicExcel.hpp.