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

#include <BasicExcel.hpp>

Collaboration diagram for YExcel::BasicExcelWorksheet:

Public Member Functions

 BasicExcelWorksheet (BasicExcel *excel, size_t sheetIndex)
 
char * GetAnsiSheetName ()
 Get the current worksheet name. Returns 0 if name is in Unicode format. More...
 
wchar_t * GetUnicodeSheetName ()
 Get the current worksheet name. Returns 0 if name is in Ansi format. More...
 
bool GetSheetName (char *name)
 Get the current worksheet name. Returns false if name is in Unicode format. More...
 
bool GetSheetName (wchar_t *name)
 Get the current worksheet name. Returns false if name is in Ansi format. More...
 
bool Rename (const char *to)
 Rename current Excel worksheet to another ANSI name. Returns true if successful, false if otherwise. More...
 
bool Rename (const wchar_t *to)
 Rename current Excel worksheet to another Unicode name. Returns true if successful, false if otherwise. More...
 
void Print (std::ostream &os, char delimiter=',', char textQualifier='\0')
 Print entire worksheet to an output stream, separating each column with the defined delimiter and enclosing text using the defined textQualifier. Leave out the textQualifier argument if do not wish to have any text qualifiers. More...
 
size_t GetTotalRows ()
 Total number of rows in current Excel worksheet. More...
 
size_t GetTotalCols ()
 Total number of columns in current Excel worksheet. More...
 
BasicExcelCellCell (size_t row, size_t col)
 Return a pointer to an Excel cell. row and col starts from 0. Returns 0 if row exceeds 65535 or col exceeds 255. More...
 
bool EraseCell (size_t row, size_t col)
 Erase content of a cell. row and col starts from 0. Returns true if successful, false if row or col exceeds range. More...
 

Private Member Functions

void UpdateCells ()
 Update cells using information from BasicExcel.worksheets_. More...
 

Private Attributes

BasicExcelexcel_
 Pointer to instance of BasicExcel. More...
 
size_t sheetIndex_
 Index of worksheet in workbook. More...
 
size_t maxRows_
 Total number of rows in worksheet. More...
 
size_t maxCols_
 Total number of columns in worksheet. More...
 
std::vector< std::vector< BasicExcelCell > > cells_
 Cells matrix. More...
 

Friends

class BasicExcel
 

Detailed Description

Definition at line 1172 of file BasicExcel.hpp.

Constructor & Destructor Documentation

◆ BasicExcelWorksheet()

YExcel::BasicExcelWorksheet::BasicExcelWorksheet ( BasicExcel excel,
size_t  sheetIndex 
)

Definition at line 5385 of file BasicExcel.cpp.

References UpdateCells().

Here is the call graph for this function:

Member Function Documentation

◆ Cell()

BasicExcelCell * YExcel::BasicExcelWorksheet::Cell ( size_t  row,
size_t  col 
)

Return a pointer to an Excel cell. row and col starts from 0. Returns 0 if row exceeds 65535 or col exceeds 255.

Definition at line 5541 of file BasicExcel.cpp.

References cells_, maxCols_, and maxRows_.

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

◆ EraseCell()

bool YExcel::BasicExcelWorksheet::EraseCell ( size_t  row,
size_t  col 
)

Erase content of a cell. row and col starts from 0. Returns true if successful, false if row or col exceeds range.

Definition at line 5565 of file BasicExcel.cpp.

References cells_, maxCols_, and maxRows_.

◆ GetAnsiSheetName()

char * YExcel::BasicExcelWorksheet::GetAnsiSheetName ( )

Get the current worksheet name. Returns 0 if name is in Unicode format.

Definition at line 5393 of file BasicExcel.cpp.

References YExcel::Workbook::boundSheets_, excel_, sheetIndex_, and YExcel::BasicExcel::workbook_.

◆ GetSheetName() [1/2]

bool YExcel::BasicExcelWorksheet::GetSheetName ( char *  name)

Get the current worksheet name. Returns false if name is in Unicode format.

Definition at line 5415 of file BasicExcel.cpp.

References YExcel::Workbook::boundSheets_, excel_, name, sheetIndex_, and YExcel::BasicExcel::workbook_.

◆ GetSheetName() [2/2]

bool YExcel::BasicExcelWorksheet::GetSheetName ( wchar_t *  name)

Get the current worksheet name. Returns false if name is in Ansi format.

Definition at line 5427 of file BasicExcel.cpp.

References YExcel::Workbook::boundSheets_, excel_, name, sheetIndex_, and YExcel::BasicExcel::workbook_.

◆ GetTotalCols()

size_t YExcel::BasicExcelWorksheet::GetTotalCols ( )

Total number of columns in current Excel worksheet.

Definition at line 5533 of file BasicExcel.cpp.

References maxCols_.

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

◆ GetTotalRows()

size_t YExcel::BasicExcelWorksheet::GetTotalRows ( )

Total number of rows in current Excel worksheet.

Definition at line 5527 of file BasicExcel.cpp.

References maxRows_.

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

◆ GetUnicodeSheetName()

wchar_t * YExcel::BasicExcelWorksheet::GetUnicodeSheetName ( )

Get the current worksheet name. Returns 0 if name is in Ansi format.

Definition at line 5404 of file BasicExcel.cpp.

References YExcel::Workbook::boundSheets_, excel_, sheetIndex_, and YExcel::BasicExcel::workbook_.

◆ Print()

void YExcel::BasicExcelWorksheet::Print ( std::ostream &  os,
char  delimiter = ',',
char  textQualifier = '\0' 
)

Print entire worksheet to an output stream, separating each column with the defined delimiter and enclosing text using the defined textQualifier. Leave out the textQualifier argument if do not wish to have any text qualifiers.

Definition at line 5469 of file BasicExcel.cpp.

References Cell(), YExcel::BasicExcelCell::DOUBLE, YExcel::BasicExcelCell::Get(), YExcel::BasicExcelCell::GetDouble(), YExcel::BasicExcelCell::GetInteger(), YExcel::BasicExcelCell::GetString(), YExcel::BasicExcelCell::GetStringLength(), YExcel::BasicExcelCell::INT, maxCols_, maxRows_, YExcel::BasicExcelCell::STRING, YExcel::BasicExcelCell::Type(), YExcel::BasicExcelCell::UNDEFINED, and YExcel::BasicExcelCell::WSTRING.

Here is the call graph for this function:

◆ Rename() [1/2]

bool YExcel::BasicExcelWorksheet::Rename ( const char *  to)

Rename current Excel worksheet to another ANSI name. Returns true if successful, false if otherwise.

Definition at line 5439 of file BasicExcel.cpp.

References YExcel::Workbook::boundSheets_, excel_, sheetIndex_, and YExcel::BasicExcel::workbook_.

◆ Rename() [2/2]

bool YExcel::BasicExcelWorksheet::Rename ( const wchar_t *  to)

Rename current Excel worksheet to another Unicode name. Returns true if successful, false if otherwise.

Print entire worksheet to an output stream, separating each column with the defined delimiter and enclosing text using the defined textQualifier. Leave out the textQualifier argument if do not wish to have any text qualifiers.

Definition at line 5454 of file BasicExcel.cpp.

References YExcel::Workbook::boundSheets_, excel_, sheetIndex_, and YExcel::BasicExcel::workbook_.

◆ UpdateCells()

Friends And Related Function Documentation

◆ BasicExcel

friend class BasicExcel
friend

Definition at line 1174 of file BasicExcel.hpp.

Member Data Documentation

◆ cells_

std::vector<std::vector<BasicExcelCell> > YExcel::BasicExcelWorksheet::cells_
private

Cells matrix.

Definition at line 1203 of file BasicExcel.hpp.

Referenced by Cell(), EraseCell(), and UpdateCells().

◆ excel_

BasicExcel* YExcel::BasicExcelWorksheet::excel_
private

Pointer to instance of BasicExcel.

Definition at line 1199 of file BasicExcel.hpp.

Referenced by GetAnsiSheetName(), GetSheetName(), GetUnicodeSheetName(), Rename(), and UpdateCells().

◆ maxCols_

size_t YExcel::BasicExcelWorksheet::maxCols_
private

Total number of columns in worksheet.

Definition at line 1202 of file BasicExcel.hpp.

Referenced by Cell(), EraseCell(), GetTotalCols(), Print(), and UpdateCells().

◆ maxRows_

size_t YExcel::BasicExcelWorksheet::maxRows_
private

Total number of rows in worksheet.

Definition at line 1201 of file BasicExcel.hpp.

Referenced by Cell(), EraseCell(), GetTotalRows(), Print(), and UpdateCells().

◆ sheetIndex_

size_t YExcel::BasicExcelWorksheet::sheetIndex_
private

Index of worksheet in workbook.

Definition at line 1200 of file BasicExcel.hpp.

Referenced by YExcel::BasicExcel::AddWorksheet(), GetAnsiSheetName(), GetSheetName(), GetUnicodeSheetName(), Rename(), and UpdateCells().


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