#include <rlspreadsheet.h>
A row within a spreadsheet.
Definition at line 44 of file rlspreadsheet.h.
rlSpreadsheetRow::rlSpreadsheetRow |
( |
| ) |
|
rlSpreadsheetRow::~rlSpreadsheetRow |
( |
| ) |
|
|
virtual |
Definition at line 103 of file rlspreadsheet.cpp.
{
while(item != NULL)
{
last = item;
if(item != last) delete last;
}
}
void rlSpreadsheetRow::clear |
( |
| ) |
|
int rlSpreadsheetRow::exists |
( |
int |
column | ) |
|
Definition at line 237 of file rlspreadsheet.cpp.
{
int c;
c = 1;
while(item != NULL)
{
if(c == column) return 1;
c++;
}
return 0;
}
int rlSpreadsheetRow::printf |
( |
int |
column, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
Definition at line 148 of file rlspreadsheet.cpp.
{
int ret;
va_list ap;
va_start(ap,format);
va_end(ap);
return ret;
}
void rlSpreadsheetRow::readRow |
( |
const unsigned char * |
line, |
|
|
char |
delimitor = '\t' |
|
) |
| |
Definition at line 188 of file rlspreadsheet.cpp.
{
int i,tab1,tab2,col;
unsigned char *celltext;
tab1 = tab2 = -1;
col = 1;
i = 0;
while(line[i] != '\0')
{
if(line[i] == delimitor || line[i] == '\n' || line[i] == 0x0d)
{
tab1 = tab2;
tab2 = i;
celltext = new unsigned char[tab2-tab1+1];
if(tab2 > tab1)
{
strncpy((char *) celltext,(const char *) &line[tab1+1],tab2-tab1);
celltext[tab2-tab1-1] = '\0';
}
else
{
celltext[0] = '\0';
}
delete [] celltext;
}
i++;
}
return;
}
void rlSpreadsheetRow::setText |
( |
int |
column, |
|
|
const char * |
text |
|
) |
| |
Definition at line 130 of file rlspreadsheet.cpp.
{
int c = 1;
if(column < 1) return;
while(1)
{
c++;
}
}
const char * rlSpreadsheetRow::text |
( |
int |
column | ) |
|
Definition at line 115 of file rlspreadsheet.cpp.
{
int c = 1;
while(item != NULL)
{
if(c == column)
return item->
text();
c++;
}
}
void rlSpreadsheetRow::writeRow |
( |
void * |
fp, |
|
|
char |
delimitor = '\t' |
|
) |
| |
Definition at line 223 of file rlspreadsheet.cpp.
{
if(fp == NULL) return;
while(cell != NULL)
{
fprintf((FILE *) fp,
"%s",cell->
text());
if(cell != NULL) fprintf((FILE *) fp, "%c", delimitor);
}
fprintf((FILE *) fp,"\n");
}
The documentation for this class was generated from the following files: