29 txt =
new char[strlen(Text)+1];
41 if(
txt != NULL)
delete []
txt;
52 if(
txt != NULL)
delete []
txt;
58 txt =
new char[strlen(Text)+1];
77 if(
txt != NULL)
delete []
txt;
111 if(item != last)
delete last;
123 if(c == column)
return item->
text();
135 if(column < 1)
return;
191 unsigned char *celltext;
198 while(line[i] !=
'\0')
200 if(line[i] == delimitor || line[i] ==
'\n' || line[i] == 0x0d)
204 celltext =
new unsigned char[tab2-tab1+1];
207 strncpy((
char *) celltext,(
const char *) &line[tab1+1],tab2-tab1);
208 celltext[tab2-tab1-1] =
'\0';
214 setText(col++, (
char *) celltext);
226 if(fp == NULL)
return;
230 fprintf((FILE *) fp,
"%s",cell->
text());
232 if(cell != NULL) fprintf((FILE *) fp,
"%c", delimitor);
234 fprintf((FILE *) fp,
"\n");
246 if(c == column)
return 1;
269 if(item != last)
delete last;
281 if(r == row)
return item->
text(column);
298 if(r == row) { item->
setText(column,
text);
return; }
337 if(filename == NULL)
return -1;
345 if(item != last)
delete last;
349 fp = fopen(filename,
"r");
350 if(fp == NULL)
return -1;
351 line =
new unsigned char[256*256+1];
352 while(fgets((
char *) line,256*256,fp) != NULL)
376 if(filename == NULL)
return -1;
377 fp = fopen(filename,
"w");
378 if(fp == NULL)
return -1;
415 if(r == row)
return item->
exists(column);
442 if(item != last)
delete last;
454 if(p == page)
return item->
text(column, row);
471 if(p == page) { item->
setText(column, row,
text);
return; }
510 if(filename == NULL)
return -1;
518 if(item != last)
delete last;
522 fname =
new char[strlen(filename)+16];
525 strcpy(fname,filename);
526 sprintf(buf,
"%d.txt",p);
529 fp = fopen(fname,
"r");
530 if(fp == NULL)
break;
542 if(item->
read(fname) < 0)
break;
555 if(filename == NULL)
return -1;
558 fname =
new char[strlen(filename)+16];
561 strcpy(fname,filename);
562 sprintf(buf,
"%d.txt",p);
566 if(item == NULL)
break;
567 if(item->
write(fname) < 0)
break;
584 if(p == page)
return item->
exists(column,row);
const char * text(int column)
rlSpreadsheetRow * nextRow
const char * text(int column, int row)
void setText(int column, const char *text)
int read(const char *filename)
void setText(int column, int row, const char *text)
int printf(const char *format,...)
rlSpreadsheetCell * getFirstCell()
int write(const char *filename)
rlSpreadsheetRow()
column = 1...N
rlSpreadsheetCell * nextCell
rlSpreadsheetRow * firstRow
virtual ~rlSpreadsheetCell()
rlSpreadsheetRow * getNextRow()
static const char null_string[]
const char * text(int column, int row, int page)
int exists(int column, int row, int page)
void setDelimitor(char delimitor)
int printf(int column, int row, const char *format,...)
void setNextCell(rlSpreadsheetCell *next)
rlSpreadsheetCell * firstCell
rlSpreadsheetCell * getNextCell()
#define rl_PRINTF_LENGTH_SPREADSHEET
int rlvsnprintf(char *text, int len, const char *format, va_list ap)
rlSpreadsheetTable * getFirstTable()
void setDelimitor(char delimitor)
int read(const char *filename)
rlSpreadsheetTable * nextTable
void setText(const char *text)
void setNextTable(rlSpreadsheetTable *next)
void setNextRow(rlSpreadsheetRow *next)
int printf(int column, const char *format,...)
rlSpreadsheetTable * getNextTable()
rlSpreadsheetWorkbook(char delimitor='\t')
column = 1...N, row = 1...N, page = 1...N
rlSpreadsheetTable(char delimitor='\t')
column = 1...N, row = 1...N
virtual ~rlSpreadsheetTable()
void setText(int column, int row, int page, const char *text)
int write(const char *filename)
rlSpreadsheetRow * getFirstRow()
rlSpreadsheetCell(const char *text=0)
void readRow(const unsigned char *line, char delimitor='\t')
int printf(int column, int row, int page, const char *format,...)
rlSpreadsheetTable * firstTable
virtual ~rlSpreadsheetRow()
int exists(int column, int row)
void writeRow(void *fp, char delimitor='\t')
virtual ~rlSpreadsheetWorkbook()