NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
#include <BasicExcel.hpp>
Public Types | |
enum | { UNDEFINED , INT , DOUBLE , STRING , WSTRING } |
Public Member Functions | |
BasicExcelCell () | |
int | Type () const |
Get type of value stored in current Excel cell. Returns one of the above enums. More... | |
bool | Get (int &val) const |
Get an integer value. Returns false if cell does not contain an integer or a double. More... | |
bool | Get (double &val) const |
Get a double value. Returns false if cell does not contain a double or an integer. More... | |
bool | Get (char *str) const |
Get an ANSI string. Returns false if cell does not contain an ANSI string. More... | |
bool | Get (wchar_t *str) const |
Get an Unicode string. Returns false if cell does not contain an Unicode string. More... | |
size_t | GetStringLength () const |
Return length of ANSI or Unicode string (excluding null character). More... | |
int | GetInteger () const |
Get an integer value. Returns 0 if cell does not contain an integer. More... | |
double | GetDouble () const |
Get a double value. Returns 0.0 if cell does not contain a double. More... | |
const char * | GetString () const |
Get an ANSI string. Returns 0 if cell does not contain an ANSI string. More... | |
const wchar_t * | GetWString () const |
Get an Unicode string. Returns 0 if cell does not contain an Unicode string. More... | |
void | Set (int val) |
Set content of current Excel cell to an integer. More... | |
void | Set (double val) |
Set content of current Excel cell to a double. More... | |
void | Set (const char *str) |
Set content of current Excel cell to an ANSI string. More... | |
void | Set (const wchar_t *str) |
Set content of current Excel cell to an Unicode string. More... | |
void | SetInteger (int val) |
Set content of current Excel cell to an integer. More... | |
void | SetDouble (double val) |
Set content of current Excel cell to a double. More... | |
void | SetString (const char *str) |
Set content of current Excel cell to an ANSI string. More... | |
void | SetWString (const wchar_t *str) |
Set content of current Excel cell to an Unicode string. More... | |
void | EraseContents () |
Erase the content of current Excel cell. Set type to UNDEFINED. More... | |
Private Attributes | |
int | type_ |
Type of value stored in current Excel cell. Contains one of the above enums. More... | |
int | ival_ |
Integer value stored in current Excel cell. More... | |
double | dval_ |
Double value stored in current Excel cell. More... | |
std::vector< char > | str_ |
ANSI string stored in current Excel cell. Include null character. More... | |
std::vector< wchar_t > | wstr_ |
Unicode string stored in current Excel cell. Include null character. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const BasicExcelCell &cell) |
Print cell to output stream. Print a null character if cell is undefined. More... | |
Definition at line 1206 of file BasicExcel.hpp.
anonymous enum |
Enumerator | |
---|---|
UNDEFINED | |
INT | |
DOUBLE | |
STRING | |
WSTRING |
Definition at line 1212 of file BasicExcel.hpp.
YExcel::BasicExcelCell::BasicExcelCell | ( | ) |
Definition at line 5682 of file BasicExcel.cpp.
void YExcel::BasicExcelCell::EraseContents | ( | ) |
Erase the content of current Excel cell. Set type to UNDEFINED.
Print cell to output stream. Print a null character if cell is undefined.
Definition at line 5859 of file BasicExcel.cpp.
References str_, type_, UNDEFINED, and wstr_.
Referenced by SetString(), SetWString(), and NumeRe::XLSSpreadSheet::writeFile().
bool YExcel::BasicExcelCell::Get | ( | char * | str | ) | const |
Get an ANSI string. Returns false if cell does not contain an ANSI string.
Definition at line 5724 of file BasicExcel.cpp.
bool YExcel::BasicExcelCell::Get | ( | double & | val | ) | const |
bool YExcel::BasicExcelCell::Get | ( | int & | val | ) | const |
Get an integer value. Returns false if cell does not contain an integer or a double.
Definition at line 5690 of file BasicExcel.cpp.
References DOUBLE, dval_, INT, ival_, and type_.
Referenced by GetDouble(), GetInteger(), GetString(), GetWString(), YExcel::BasicExcelWorksheet::Print(), and YExcel::BasicExcel::UpdateWorksheets().
bool YExcel::BasicExcelCell::Get | ( | wchar_t * | str | ) | const |
Get an Unicode string. Returns false if cell does not contain an Unicode string.
Definition at line 5737 of file BasicExcel.cpp.
double YExcel::BasicExcelCell::GetDouble | ( | ) | const |
Get a double value. Returns 0.0 if cell does not contain a double.
Definition at line 5766 of file BasicExcel.cpp.
References Get().
Referenced by YExcel::BasicExcelWorksheet::Print(), NumeRe::XLSSpreadSheet::readFile(), and YExcel::BasicExcel::UpdateWorksheets().
int YExcel::BasicExcelCell::GetInteger | ( | ) | const |
Get an integer value. Returns 0 if cell does not contain an integer.
Definition at line 5757 of file BasicExcel.cpp.
References Get().
Referenced by YExcel::BasicExcelWorksheet::Print(), NumeRe::XLSSpreadSheet::readFile(), and YExcel::BasicExcel::UpdateWorksheets().
const char * YExcel::BasicExcelCell::GetString | ( | ) | const |
Get an ANSI string. Returns 0 if cell does not contain an ANSI string.
Definition at line 5775 of file BasicExcel.cpp.
Referenced by YExcel::BasicExcelWorksheet::Print(), and NumeRe::XLSSpreadSheet::readFile().
size_t YExcel::BasicExcelCell::GetStringLength | ( | ) | const |
Return length of ANSI or Unicode string (excluding null character).
Definition at line 5749 of file BasicExcel.cpp.
References str_, STRING, type_, and wstr_.
Referenced by YExcel::BasicExcelWorksheet::Print(), and YExcel::BasicExcel::UpdateWorksheets().
const wchar_t * YExcel::BasicExcelCell::GetWString | ( | ) | const |
Get an Unicode string. Returns 0 if cell does not contain an Unicode string.
Definition at line 5784 of file BasicExcel.cpp.
Referenced by NumeRe::XLSSpreadSheet::readFile().
void YExcel::BasicExcelCell::Set | ( | const char * | str | ) |
Set content of current Excel cell to an ANSI string.
Definition at line 5804 of file BasicExcel.cpp.
References SetString().
void YExcel::BasicExcelCell::Set | ( | const wchar_t * | str | ) |
Set content of current Excel cell to an Unicode string.
Definition at line 5810 of file BasicExcel.cpp.
References SetWString().
void YExcel::BasicExcelCell::Set | ( | double | val | ) |
Set content of current Excel cell to a double.
Definition at line 5798 of file BasicExcel.cpp.
References SetDouble().
void YExcel::BasicExcelCell::Set | ( | int | val | ) |
Set content of current Excel cell to an integer.
Definition at line 5792 of file BasicExcel.cpp.
References SetInteger().
void YExcel::BasicExcelCell::SetDouble | ( | double | val | ) |
Set content of current Excel cell to a double.
Definition at line 5823 of file BasicExcel.cpp.
References DOUBLE, dval_, and type_.
Referenced by Set(), and NumeRe::XLSSpreadSheet::writeFile().
void YExcel::BasicExcelCell::SetInteger | ( | int | val | ) |
void YExcel::BasicExcelCell::SetString | ( | const char * | str | ) |
Set content of current Excel cell to an ANSI string.
Definition at line 5830 of file BasicExcel.cpp.
References EraseContents(), str_, STRING, type_, and wstr_.
Referenced by Set(), and NumeRe::XLSSpreadSheet::writeFile().
void YExcel::BasicExcelCell::SetWString | ( | const wchar_t * | str | ) |
Set content of current Excel cell to an Unicode string.
Definition at line 5844 of file BasicExcel.cpp.
References EraseContents(), str_, type_, wstr_, and WSTRING.
Referenced by Set().
int YExcel::BasicExcelCell::Type | ( | ) | const |
Get type of value stored in current Excel cell. Returns one of the above enums.
Definition at line 5686 of file BasicExcel.cpp.
References type_.
Referenced by YExcel::BasicExcelWorksheet::Print(), NumeRe::XLSSpreadSheet::readFile(), and YExcel::BasicExcel::UpdateWorksheets().
|
friend |
Print cell to output stream. Print a null character if cell is undefined.
Definition at line 5868 of file BasicExcel.cpp.
|
private |
Double value stored in current Excel cell.
Definition at line 1243 of file BasicExcel.hpp.
Referenced by Get(), and SetDouble().
|
private |
Integer value stored in current Excel cell.
Definition at line 1242 of file BasicExcel.hpp.
Referenced by Get(), and SetInteger().
|
private |
ANSI string stored in current Excel cell. Include null character.
Definition at line 1244 of file BasicExcel.hpp.
Referenced by EraseContents(), Get(), GetString(), GetStringLength(), SetString(), and SetWString().
|
private |
Type of value stored in current Excel cell. Contains one of the above enums.
Definition at line 1241 of file BasicExcel.hpp.
Referenced by EraseContents(), Get(), GetStringLength(), SetDouble(), SetInteger(), SetString(), SetWString(), and Type().
|
private |
Unicode string stored in current Excel cell. Include null character.
Definition at line 1245 of file BasicExcel.hpp.
Referenced by EraseContents(), Get(), GetStringLength(), GetWString(), SetString(), and SetWString().