NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
YExcel::BasicExcelCell Class Reference

#include <BasicExcel.hpp>

Collaboration diagram for YExcel::BasicExcelCell:

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...
 

Detailed Description

Definition at line 1206 of file BasicExcel.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
UNDEFINED 
INT 
DOUBLE 
STRING 
WSTRING 

Definition at line 1212 of file BasicExcel.hpp.

Constructor & Destructor Documentation

◆ BasicExcelCell()

YExcel::BasicExcelCell::BasicExcelCell ( )

Definition at line 5682 of file BasicExcel.cpp.

Member Function Documentation

◆ EraseContents()

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().

◆ Get() [1/4]

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.

References str_, STRING, and type_.

◆ Get() [2/4]

bool YExcel::BasicExcelCell::Get ( double &  val) const

Get a double value. Returns false if cell does not contain a double or an integer.

Definition at line 5707 of file BasicExcel.cpp.

References DOUBLE, dval_, INT, ival_, and type_.

◆ Get() [3/4]

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().

◆ Get() [4/4]

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.

References type_, wstr_, and WSTRING.

◆ GetDouble()

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().

Here is the call graph for this function:

◆ GetInteger()

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().

Here is the call graph for this function:

◆ GetString()

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.

References Get(), and str_.

Referenced by YExcel::BasicExcelWorksheet::Print(), and NumeRe::XLSSpreadSheet::readFile().

Here is the call graph for this function:

◆ GetStringLength()

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().

◆ GetWString()

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.

References Get(), and wstr_.

Referenced by NumeRe::XLSSpreadSheet::readFile().

Here is the call graph for this function:

◆ Set() [1/4]

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().

Here is the call graph for this function:

◆ Set() [2/4]

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().

Here is the call graph for this function:

◆ Set() [3/4]

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().

Here is the call graph for this function:

◆ Set() [4/4]

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().

Here is the call graph for this function:

◆ SetDouble()

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().

◆ SetInteger()

void YExcel::BasicExcelCell::SetInteger ( int  val)

Set content of current Excel cell to an integer.

Definition at line 5816 of file BasicExcel.cpp.

References INT, ival_, and type_.

Referenced by Set().

◆ SetString()

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().

Here is the call graph for this function:

◆ SetWString()

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().

Here is the call graph for this function:

◆ Type()

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().

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const BasicExcelCell cell 
)
friend

Print cell to output stream. Print a null character if cell is undefined.

Definition at line 5868 of file BasicExcel.cpp.

Member Data Documentation

◆ dval_

double YExcel::BasicExcelCell::dval_
private

Double value stored in current Excel cell.

Definition at line 1243 of file BasicExcel.hpp.

Referenced by Get(), and SetDouble().

◆ ival_

int YExcel::BasicExcelCell::ival_
private

Integer value stored in current Excel cell.

Definition at line 1242 of file BasicExcel.hpp.

Referenced by Get(), and SetInteger().

◆ str_

std::vector<char> YExcel::BasicExcelCell::str_
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().

◆ type_

int YExcel::BasicExcelCell::type_
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().

◆ wstr_

std::vector<wchar_t> YExcel::BasicExcelCell::wstr_
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().


The documentation for this class was generated from the following files: