rllib  1
Public Member Functions | Private Attributes | List of all members
rlSpreadsheetCell Class Reference

#include <rlspreadsheet.h>

Collaboration diagram for rlSpreadsheetCell:
Collaboration graph
[legend]

Public Member Functions

 rlSpreadsheetCell (const char *text=0)
 
virtual ~rlSpreadsheetCell ()
 
const char * text ()
 
void setText (const char *text)
 
int printf (const char *format,...)
 
void clear ()
 
void setNextCell (rlSpreadsheetCell *next)
 
rlSpreadsheetCellgetNextCell ()
 
int exists ()
 

Private Attributes

char * txt
 
rlSpreadsheetCellnextCell
 

Detailed Description

A cell of a spreadsheet.

Definition at line 24 of file rlspreadsheet.h.

Constructor & Destructor Documentation

◆ rlSpreadsheetCell()

rlSpreadsheetCell::rlSpreadsheetCell ( const char *  text = 0)

Definition at line 25 of file rlspreadsheet.cpp.

26 {
27  if(Text != NULL)
28  {
29  txt = new char[strlen(Text)+1];
30  strcpy(txt,Text);
31  }
32  else
33  {
34  txt = NULL;
35  }
36  nextCell = NULL;
37 }
rlSpreadsheetCell * nextCell
Definition: rlspreadsheet.h:38

◆ ~rlSpreadsheetCell()

rlSpreadsheetCell::~rlSpreadsheetCell ( )
virtual

Definition at line 39 of file rlspreadsheet.cpp.

40 {
41  if(txt != NULL) delete [] txt;
42 }

Member Function Documentation

◆ clear()

void rlSpreadsheetCell::clear ( )

Definition at line 75 of file rlspreadsheet.cpp.

76 {
77  if(txt != NULL) delete [] txt;
78  txt = NULL;
79 }

◆ exists()

int rlSpreadsheetCell::exists ( )

Definition at line 91 of file rlspreadsheet.cpp.

92 {
93  return 1;
94 }

◆ getNextCell()

rlSpreadsheetCell * rlSpreadsheetCell::getNextCell ( )

Definition at line 86 of file rlspreadsheet.cpp.

87 {
88  return nextCell;
89 }
rlSpreadsheetCell * nextCell
Definition: rlspreadsheet.h:38

◆ printf()

int rlSpreadsheetCell::printf ( const char *  format,
  ... 
)

Definition at line 62 of file rlspreadsheet.cpp.

63 {
64  int ret;
65  char buf[rl_PRINTF_LENGTH_SPREADSHEET]; // should be big enough
66 
67  va_list ap;
68  va_start(ap,format);
69  ret = rlvsnprintf(buf, rl_PRINTF_LENGTH_SPREADSHEET - 1, format, ap);
70  va_end(ap);
71  setText(buf);
72  return ret;
73 }
#define rl_PRINTF_LENGTH_SPREADSHEET
Definition: rldefine.h:72
int rlvsnprintf(char *text, int len, const char *format, va_list ap)
Definition: rlcutil.cpp:197
void setText(const char *text)

◆ setNextCell()

void rlSpreadsheetCell::setNextCell ( rlSpreadsheetCell next)

Definition at line 81 of file rlspreadsheet.cpp.

82 {
83  nextCell = next;
84 }
rlSpreadsheetCell * nextCell
Definition: rlspreadsheet.h:38

◆ setText()

void rlSpreadsheetCell::setText ( const char *  text)

Definition at line 50 of file rlspreadsheet.cpp.

51 {
52  if(txt != NULL) delete [] txt;
53  if(Text == NULL)
54  {
55  txt = NULL;
56  return;
57  }
58  txt = new char[strlen(Text)+1];
59  strcpy(txt,Text);
60 }

◆ text()

const char * rlSpreadsheetCell::text ( )

Definition at line 44 of file rlspreadsheet.cpp.

45 {
46  if(txt == NULL) return null_string;
47  return txt;
48 }
static const char null_string[]

Member Data Documentation

◆ nextCell

rlSpreadsheetCell* rlSpreadsheetCell::nextCell
private

Definition at line 38 of file rlspreadsheet.h.

◆ txt

char* rlSpreadsheetCell::txt
private

Definition at line 37 of file rlspreadsheet.h.


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