Testing usvn

git-svn-id: svn://ultimatepp.org/upp/trunk@1342 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-06-28 08:21:16 +00:00
parent 7754397464
commit b287b3d34c
88 changed files with 18578 additions and 16 deletions

View file

@ -9,3 +9,4 @@ file
mainconfig
"" = "GUI ST";

4
uppdev/AccessKey/init Normal file
View file

@ -0,0 +1,4 @@
#ifndef _AccessKey_icpp_init_stub
#define _AccessKey_icpp_init_stub
#include "CtrlLib/init"
#endif

View file

@ -6,7 +6,7 @@ uses
file
app.tpp,
ArrayCtrl.h include_path,
ArrayCtrl.h,
main.cpp optimize_speed,
src.tpp,
srcimp.tpp;

View file

@ -0,0 +1,9 @@
uses
CtrlLib;
file
main.cpp;
mainconfig
"" = "GUI";

View file

@ -0,0 +1,10 @@
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
GUI_APP_MAIN
{
String chk0 = AsQTF(CreatePNGObject(CtrlImg::exclamation(), 400, 400));
PromptOK(chk0);
}

View file

@ -0,0 +1,9 @@
uses
CtrlLib;
file
main.cpp;
mainconfig
"" = "GUI";

15
uppdev/QTFHeight/main.cpp Normal file
View file

@ -0,0 +1,15 @@
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
GUI_APP_MAIN
{
TopWindow win;
RichTextCtrl rt;
String str = "[3A^test^ Graphical introduction]";
rt = str;
rt.SetFrame(BlackFrame());
rt.NoSb();
win.Add(rt.LeftPos(10, rt.GetWidth() + 2).TopPos(rt.GetHeight(INT_MAX) + 2));
win.Run();
}

9
uppdev/XLS/XLS.h Normal file
View file

@ -0,0 +1,9 @@
#ifndef _XLS_XLS_h
#define _XLS_XLS_h
#include <Core/Core.h>
#include <XLS/xlslib.h>
using namespace Upp;
#endif

40
uppdev/XLS/XLS.upp Normal file
View file

@ -0,0 +1,40 @@
description "U++ wrapper for XlsLib 1.2.0 (library for XLS spreadsheets, by David Hoerl)\377";
uses
Core;
file
binfile.cpp,
blank.cpp,
cbridge.cpp,
cell.cpp,
colinfo.cpp,
continue.cpp,
crc.cpp,
datast.cpp,
docsumminfo.cpp,
extformat.cpp,
font.cpp,
format.cpp,
globalrec.cpp,
index.cpp,
label.cpp,
merged.cpp,
number.cpp,
oledoc.cpp,
olefs.cpp,
oleprop.cpp,
overnew.cpp,
range.cpp,
recdef.cpp,
record.cpp,
row.cpp,
sheetrec.cpp,
summinfo.cpp,
unit.cpp,
workbook.cpp,
XLS.h;
mainconfig
"" = "";

68
uppdev/XLS/biffsection.h Normal file
View file

@ -0,0 +1,68 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/biffsection.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef BIFFSECTION_H
#define BIFFSECTION_H
#include <XLS/config.h>
#include <XLS/systype.h>
/*
******************************
CBiffSection class declaration
******************************
*/
class CBiffSection
{
protected:
public:
CBiffSection() {};
~CBiffSection() {};
};
#endif //BIFFSECTION_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: biffsection.h,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:43 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

278
uppdev/XLS/binfile.cpp Normal file
View file

@ -0,0 +1,278 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/oledoc/binfile.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/ole/binfile.h>
using namespace std;
using namespace xlslib_core;
/*
******************************
CBinFile class Implementation
******************************
*/
CBinFile::CBinFile()
// : is_stroke(false)
{
}
CBinFile::CBinFile(const string& name)
// : is_stroke(false)
{
Open(name);
}
CBinFile::~CBinFile ()
{
Close();
}
/*
******************************
******************************
*/
int CBinFile::Open(const string& file_name)
{
Close();
m_File.open(file_name.c_str(),ios_base::binary|ios_base::out);
return m_File.good()? NO_ERRORS: FILE_ERROR;
}
/*
******************************
******************************
*/
int CBinFile::Close ( )
{
if(m_File.is_open())
m_File.close();
return NO_ERRORS;
}
/*
******************************
******************************
*/
unsigned32_t CBinFile::Position ( )
{
unsigned32_t pt = 0;
if(m_File.is_open()) {
pt = (unsigned32_t)m_File.tellp();
}
return pt;
}
/*
******************************
******************************
*/
int CBinFile::Write ( unsigned8_t * data, unsigned32_t size )
{
int errcode = NO_ERRORS;
write_service((const char*)data, size);
return errcode;
}
/*
******************************
******************************
*/
int CBinFile::Write ( CUnit& data_unit )
{
int errcode = NO_ERRORS;
write_service((const char*)data_unit.GetBuffer(), data_unit.GetDataSize());
return errcode;
}
/*
******************************
******************************
*/
int CBinFile::WriteByte(unsigned8_t byte)
{
int errcode = NO_ERRORS;
write_service((const char*)&byte, 1);
return errcode;
}
/*
******************************
******************************
*/
int CBinFile::WriteUnsigned16(unsigned16_t data)
{
int errcode = NO_ERRORS;
WriteByte(BYTE_0(data));
WriteByte(BYTE_1(data));
return errcode;
}
/*
******************************
******************************
*/
int CBinFile::WriteUnsigned32(unsigned32_t data)
{
int errcode = NO_ERRORS;
WriteByte(BYTE_0(data));
WriteByte(BYTE_1(data));
WriteByte(BYTE_2(data));
WriteByte(BYTE_3(data));
return errcode;
}
/*
******************************
******************************
*/
int CBinFile::WriteSigned16(signed16_t data)
{
int errcode = NO_ERRORS;
WriteByte(BYTE_0(data));
WriteByte(BYTE_1(data));
return errcode;
}
/*
******************************
******************************
*/
int CBinFile::WriteSigned32(signed32_t data)
{
int errcode = NO_ERRORS;
WriteByte(BYTE_0(data));
WriteByte(BYTE_1(data));
WriteByte(BYTE_2(data));
WriteByte(BYTE_3(data));
return errcode;
}
int CBinFile::WriteByteArray(const unsigned8_t *data, size_t size)
{
int errcode = NO_ERRORS;
write_service((const char*)data, size);
return errcode;
}
/*
******************************
******************************
*/
int CBinFile::SerializeFixedArray(const unsigned8_t data, unsigned32_t size)
{
int errcode = NO_ERRORS;
for (unsigned32_t i = 0; i<size; i++)
WriteByte(data);
return errcode;
}
/*
******************************
******************************
*/
#ifdef XLS_PHP
const int CBinFile::STROKE_CHUNK_SIZE = 1024;
#endif
int CBinFile::write_service(const char *buffer, size_t size)
{
// if(!is_stroke)
{
if(m_File.is_open())
{
if(size > 1)
m_File.write((const char*)buffer, size);
else if(size == 1)
m_File.put(*buffer);
}
}
#ifdef XLS_PHP
int sent = 0;
else {
if (write_fptr != NULL)
{
do
{
if(size >= STROKE_CHUNK_SIZE)
{
sent = write_fptr(buffer, STROKE_CHUNK_SIZE);
size -= sent;
buffer += sent;
} else {
sent = write_fptr(buffer, size);
size -= sent;
buffer += sent;
}
} while(size != 0);
}
}
#endif
return 0;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: binfile.cpp,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:43 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

104
uppdev/XLS/blank.cpp Normal file
View file

@ -0,0 +1,104 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/blank.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/blank.h>
using namespace std;
using namespace xlslib_core;
CBlank::CBlank(unsigned16_t row,
unsigned16_t col,
xf_t* pxfval)
{
SetRecordType(RECTYPE_BLANK);
AddValue16(row);
AddValue16(col);
unsigned16_t xfindex;
pxfval != NULL?
xfindex = pxfval->GetIndex()
:xfindex = 0x000f;
AddValue16(xfindex);
SetRecordLength(GetDataSize()-4);
}
CBlank::CBlank(blank_t& blankdef)
{
SetRecordType(RECTYPE_BLANK); // DFH - was RECTYPE_LABEL, typo ??? (just like the number class)
AddValue16(blankdef.GetRow());
AddValue16(blankdef.GetCol());
AddValue16(blankdef.GetXFIndex());
SetRecordLength(GetDataSize()-4);
}
CBlank::~CBlank()
{
}
/*
*********************************
blank_t class implementation
*********************************
*/
blank_t::blank_t(unsigned16_t rowval,
unsigned16_t colval,
xf_t* pxfval)
{
row = rowval;
col = colval;
if(pxfval != NULL)
pxfval->MarkUsed();
pxf = pxfval;
}
CUnit* blank_t::GetData() {
CUnit* datablank =
(CUnit*)( new CBlank(row,col,pxf));
return datablank; // NOTE: this pointer HAS to be deleted elsewhere.
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: blank.cpp,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:54 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

92
uppdev/XLS/blank.h Normal file
View file

@ -0,0 +1,92 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/blank.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef BLANK_H
#define BLANK_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/cell.h>
#include <XLS/record.h>
#include <XLS/unit.h>
namespace xlslib_core
{
class blank_t;
class CBlank: public CRecord
{
private:
public:
CBlank(unsigned16_t row,
unsigned16_t col,
xf_t* pxfval = NULL);
CBlank(blank_t& blankdef);
~CBlank();
};
class blank_t: public cell_t
{
private:
public:
blank_t(unsigned16_t rowval,
unsigned16_t colval,
xf_t* pxfval = NULL);
~blank_t(){};
unsigned16_t GetSize() {return 10;};
CUnit* GetData();
};
}
#endif //BLANK_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: blank.h,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:49 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

228
uppdev/XLS/cbridge.cpp Normal file
View file

@ -0,0 +1,228 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/cbridge.cpp,v $
* $Revision: 1.1 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:44:32 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <sys/types.h>
#include <string>
#include <XLS/xlslib.h>
using namespace std;
//using namespace xlslib_core;
#if 0
EXTERN_TYPE worksheet *newWorksheet(CGlobalRecords *pglobalrec);
EXTERN_TYPE void deleteWorksheet(worksheet *w);
worksheet *newWorksheet(CGlobalRecords *pglobalrec) { return new worksheet(pglobalrec); }
void deleteWorksheet(worksheet *w) { delete w; }
#endif
extern "C" {
// Workbook
workbook *newWorkbook(void) { return new workbook; }
//workbook *newWorkbook_w_fptr(write_fptr_t w_fptr) { return new workbook(w_fptr); }
void deleteWorkbook(workbook *w) { delete w; }
worksheet *callWorkbookSheet(workbook *w, char *sheetname) {
std::string str = sheetname;
return w->sheet(str);
}
#if VERSION_BIFF == VERSION_BIFF8
worksheet *callWorkbookSheetW(workbook *w, uchar_t *sheetname) {
std::ustring str = sheetname;
return w->sheet(str);
}
#endif
worksheet *callWorkbookGetSheet(workbook *w, unsigned16_t sheetnum) { return w->GetSheet(sheetnum); }
font_t *callWorkbookFont(workbook *w, char *name) {
std::string str = name;
return w->font(str);
}
xf_t *callWorkbookxFormat(workbook *w) { return w->xformat(); }
xf_t *callWorkbookxFormatFont(workbook *w, font_t *font) { return w->xformat(font); }
int callWorkbookDump(workbook *w, char *filename) {
std::string str = filename;
return w->Dump(str);
}
#ifdef XLS_PHP
void callWorkbookDisposition(workbook *w, Stroke_Disposition_t disp) { return w->Disposition(disp); }
void callWorkbookStroke(workbook *w, char *filename) {
std::string str = filename;
return w->Stroke(str);
}
#endif
// Worksheet
cell_t *callWorksheetFindCell(worksheet *w, unsigned16_t row, unsigned16_t col) { return w->FindCell(row, col); }
// Cell operations
void callWorksheetMerge(worksheet *w, unsigned16_t first_row, unsigned16_t first_col, unsigned16_t last_row, unsigned16_t last_col)
{ return w->merge(first_row, first_col, last_row, last_col); }
void callWorksheetColwidth(worksheet *w, unsigned16_t col, unsigned16_t width)
{ return w->colwidth(col, width); }
void callWorksheetRowheight(worksheet *w, unsigned16_t row, unsigned16_t height)
{ return w->rowheight(row, height); }
// Ranges
range *callWorksheetRangegroup(worksheet *w, unsigned16_t row1, unsigned16_t col1, unsigned16_t row2, unsigned16_t col2)
{ return w->rangegroup(row1, col1, row2, col2); }
// Cells
cell_t *callWorksheetLabel(worksheet *w, unsigned16_t row, unsigned16_t col, char *strlabel, xf_t *pxformat)
{
std:string str = strlabel;
return w->label(row, col, strlabel, pxformat);
}
#if VERSION_BIFF == VERSION_BIFF8
cell_t *callWorksheetLabelW(worksheet *w, unsigned16_t row, unsigned16_t col, uchar_t *strlabel, xf_t *pxformat)
{
std:ustring str = strlabel;
return w->label(row, col, strlabel, pxformat);
}
#endif
cell_t *callWorksheetBlank(worksheet *w, unsigned16_t row, unsigned16_t col, xf_t *pxformat)
{ return w->blank(row, col, pxformat); }
cell_t *callWorksheetNumber(worksheet *w, unsigned16_t row, unsigned16_t col, double numval, format_number_t fmtval, xf_t *pxformat)
{ return w->number(row, col, numval, fmtval, pxformat); }
// Cells
// xf_i interface
void callCellFont(cell_t *c, font_t *fontidx) { return c->font(fontidx); }
void callCellFormat(cell_t *c, format_number_t formatidx) { return c->format(formatidx); }
void callCellHalign(cell_t *c, halign_option_t ha_option) { return c->halign(ha_option); }
void callCellValign(cell_t *c, valign_option_t va_option) { return c->valign(va_option); }
void callCellOrientation(cell_t *c, txtori_option_t ori_option) { return c->orientation(ori_option); }
void callCellFillfgcolor(cell_t *c, color_name_t color) { return c->fillfgcolor(color); }
void callCellFillbgcolor(cell_t *c, color_name_t color) { return c->fillbgcolor(color); }
void callCellFillstyle(cell_t *c, fill_option_t fill) { return c->fillstyle(fill); }
void callCellLocked(cell_t *c, bool locked_opt) { return c->locked(locked_opt); }
void callCellHidden(cell_t *c, bool hidden_opt) { return c->hidden(hidden_opt); }
void callCellWrap(cell_t *c, bool wrap_opt) { return c->wrap(wrap_opt); }
void callCellBorderstyle(cell_t *c, border_side_t side, border_style_t style, color_name_t color)
{ return c->borderstyle(side, style, color); }
//font_i interface
void callCellFontname(cell_t *c, char *fntname) {
std::string str = fntname;
return c->fontname(str);
}
void callCellFontheight(cell_t *c, unsigned16_t fntheight) { return c->fontheight(fntheight); }
void callCellFontbold(cell_t *c, boldness_option_t fntboldness) { return c->fontbold(fntboldness); }
void callCellFontunderline(cell_t *c, underline_option_t fntunderline) { return c->fontunderline(fntunderline); }
void callCellFontscript(cell_t *c, script_option_t fntscript) { return c->fontscript(fntscript); }
void callCellFontcolor(cell_t *c, color_name_t fntcolor) { return c->fontcolor(fntcolor); }
void callCellFontattr(cell_t *c, unsigned16_t attr) { return c->fontattr(attr); }
void callCellFontitalic(cell_t *c, bool italic) { return c->fontitalic(italic); }
void callCellFontstrikeout(cell_t *c, bool so) { return c->fontstrikeout(so); }
void callCellFontoutline(cell_t *c, bool ol) { return c->fontoutline(ol); }
void callCellFontshadow(cell_t *c, bool sh) { return c->fontshadow(sh); }
unsigned16_t callCellGetRow(cell_t *c) { return c->GetRow(); }
unsigned16_t callCellGetCol(cell_t *c) { return c->GetCol(); }
unsigned16_t callCellGetXFIndex(cell_t *c) { return c->GetXFIndex(); }
void callCellSetXF(cell_t *c, xf_t *pxfval) { return c->SetXF(pxfval); }
// range
void callRangeCellcolor(range *r, color_name_t color) { return r->cellcolor(color); }
// xformat
void callXformatSetFont(xf_t *x, font_t* fontidx) { return x->SetFont(fontidx); }
unsigned16_t callXformatGetFontIndex(xf_t *x) { return x->GetFontIndex(); }
font_t* callXformatGetFont(xf_t *x) { return x->GetFont(); }
/* Format Index wrappers*/
void callXformatSetFormat(xf_t *x, format_number_t formatidx) { return x->SetFormat(formatidx); }
unsigned16_t callXformatGetFormatIndex(xf_t *x) { return x->GetFormatIndex(); }
format_number_t callXformatGetFormat(xf_t *x) { return x->GetFormat(); }
/* Horizontal Align option wrappers*/
void callXformatSetHAlign(xf_t *x, halign_option_t ha_option) { return x->SetHAlign(ha_option); }
unsigned8_t callXformatGetHAlign(xf_t *x) { return x->GetHAlign(); }
/* Vertical Align option wrappers*/
void callXformatSetVAlign(xf_t *x, valign_option_t va_option) { return x->SetVAlign(va_option); }
unsigned8_t callXformatGetVAlign(xf_t *x) { return x->GetVAlign(); }
/* Text orientation option wrappers*/
void callXformatSetTxtOrientation(xf_t *x, txtori_option_t ori_option) { return x->SetTxtOrientation(ori_option); }
unsigned8_t callXformatGetTxtOrientation(xf_t *x) { return x->GetTxtOrientation(); }
/* Fill Foreground color option wrappers*/
void callXformatSetFillFGColor(xf_t *x, color_name_t color) { return x->SetFillFGColor(color); }
unsigned8_t callXformatGetFillFGColor(xf_t *x) { return x->GetFillFGColor(); }
/* Fill Background color option wrappers*/
void callXformatSetFillBGColor(xf_t *x, color_name_t color) { return x->SetFillBGColor(color); }
unsigned8_t callXformatGetFillBGColor(xf_t *x) { return x->GetFillBGColor(); }
/* Fill Style option wrappers*/
void callXformatSetFillStyle(xf_t *x, fill_option_t fill) { return x->SetFillStyle(fill); }
unsigned8_t callXformatGetFillStyle(xf_t *x) { return x->GetFillStyle(); }
/* Locked option wrappers*/
void callXformatSetLocked(xf_t *x, bool locked_opt) { return x->SetLocked(locked_opt); }
bool callXformatIsLocked(xf_t *x) { return x->IsLocked(); }
/* Hidden option wrappers*/
void callXformatSetHidden(xf_t *x, bool hidden_opt) { return x->SetHidden(hidden_opt); }
bool callXformatIsHidden(xf_t *x) { return x->IsHidden(); }
/* Wrap option wrappers*/
void callXformatSetWrap(xf_t *x, bool wrap_opt) { return x->SetWrap(wrap_opt); }
bool callXformatIsWrap(xf_t *x) { return x->IsWrap(); }
/* Cell option wrappers*/
void callXformatSetCellMode(xf_t *x, bool cellmode) { return x->SetCellMode(cellmode); }
bool callXformatIsCell(xf_t *x) { return x->IsCell(); }
/* Cell option wrappers*/
void callXformatSetBorderStyle(xf_t *x, border_side_t side, border_style_t style, color_name_t color)
{ return x->SetBorderStyle(side, style, color); }
unsigned8_t callXformatGetBorderStyle(xf_t *x, border_side_t side) { return x->GetBorderStyle(side); }
unsigned8_t callXformatGetBorderColor(xf_t *x, border_side_t side) { return x->GetBorderColor(side); }
unsigned32_t callXformatGetSignature(xf_t *x) { return x->GetSignature(); }
// Font
void callFontSetName(font_t *f, char *fntname) {
std::string str = fntname;
f->SetName(str);
return;
}
char *callFontGetName(font_t *f, char *fntname) { return strcpy(fntname, (f->GetName()).c_str() ); }
/* FONT height wrappers*/
void callFontSetHeight(font_t *f, unsigned16_t fntheight) { return f->SetHeight(fntheight); }
unsigned16_t callFontGetHeight(font_t *f) { return f->GetHeight(); }
/* FONT boldstyle wrappers*/
void callFontSetBoldStyle(font_t *f, boldness_option_t fntboldness) { return f->SetBoldStyle(fntboldness); }
unsigned16_t callFontGetBoldStyle(font_t *f) { return f->GetBoldStyle(); }
/* FONT underline wrappers*/
void callFontSetUnderlineStyle(font_t *f, underline_option_t fntunderline) { return f->SetUnderlineStyle(fntunderline); }
unsigned8_t callFontGetUnderlineStyle(font_t *f) { return f->GetUnderlineStyle(); }
/* FONT script wrappers*/
void callFontSetScriptStyle(font_t *f, script_option_t fntscript) { return f->SetScriptStyle(fntscript); }
unsigned16_t callFontGetScriptStyle(font_t *f) { return f->GetScriptStyle(); }
/* FONT script wrappers*/
void callFontSetColor(font_t *f, color_name_t fntcolor) { return f->SetColor(fntcolor); }
unsigned16_t callFontGetColor(font_t *f) { return f->GetColor(); }
void callFontSetItalic(font_t *f, bool italic) { return f->SetItalic(italic); }
void callFontSetStrikeout(font_t *f, bool so) { return f->SetStrikeout(so); }
/* FONT attributes wrappers */
void callFontSetAttributes(font_t *f, unsigned16_t attr) { return f->SetAttributes(attr); }
unsigned16_t callFontGetAttributes(font_t *f) { return f->GetAttributes(); }
// Macintosh only
void callFontSetOutline(font_t *f, bool ol) { return f->SetOutline(ol); }
void callFontSetShadow(font_t *f, bool sh) { return f->SetShadow(sh); }
}

33
uppdev/XLS/cbridge.h Normal file
View file

@ -0,0 +1,33 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/cbridge.h,v $
* $Revision: 1.1 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:44:32 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

557
uppdev/XLS/cell.cpp Normal file
View file

@ -0,0 +1,557 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/cell.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/cell.h>
using namespace std;
using namespace xlslib_core;
cell_t::cell_t()
:m_pGlobalRecs(NULL)
{
}
cell_t::~cell_t()
{
}
unsigned16_t cell_t::GetXFIndex()
{
unsigned16_t xfindex;
#if 0
pxf != NULL?
xfindex = pxf->GetIndex()
:xfindex = 0x000f;
#endif
if(pxf != NULL)
xfindex = pxf->GetIndex();
else
xfindex = 0x000f;
return xfindex;
}
bool cell_t::operator==(const cell_t& right) const
{
return (row == right.row ? true : false);
}
bool cell_t::operator!=(const cell_t& right) const
{
return (row != right.row ? true : false);
}
/*
bool cell_t::operator<(const cell_t& right) const
{
return (row < right.row);
}
bool cell_t::operator>(const cell_t& right) const
{
return (row > right.row);
}
bool cell_t::operator%(const cell_t& right) const
{
return (row == right.row && col == right.col);
}
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Implementation of the XF record interface (xf_i pure virtual interface)
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define SET_XF_CELL_FUNCTION(function,value) \
{ \
xf_t* currentxf = pxf; \
if(pxf == NULL) \
currentxf = m_pGlobalRecs->GetDefaultXF(); \
\
xf_t* xfbackup = new xf_t; \
(*xfbackup) = (*currentxf); \
\
if(currentxf->Usage() > 1) \
{ \
xf_t* newxf = new xf_t(); \
(*newxf) = (*currentxf); \
newxf->function(value); \
newxf = m_pGlobalRecs->AddXFormat(newxf); \
pxf = newxf; \
pxf->MarkUsed(); \
\
} \
else \
{ \
xf_t* xfnew = new xf_t; \
(*xfnew) = (*currentxf); \
xfnew->function(value); \
xfnew->MarkUsed(); \
xfnew = m_pGlobalRecs->ReplaceXFormat(xfbackup, xfnew); \
pxf = xfnew; \
pxf->MarkUsed(); \
\
} \
delete xfbackup; \
}
void cell_t::borderstyle(border_side_t side,
border_style_t style,
color_name_t color)
{
xf_t* currentxf = pxf;
if(pxf == NULL)
currentxf = m_pGlobalRecs->GetDefaultXF();
xf_t* xfbackup = new xf_t;
(*xfbackup) = (*currentxf);
if(currentxf->Usage() > 1)
{
xf_t* newxf = new xf_t();
(*newxf) = (*currentxf);
newxf->SetBorderStyle(side, style, color);
newxf = m_pGlobalRecs->AddXFormat(newxf);
pxf = newxf;
pxf->MarkUsed();
}
else
{
xf_t* xfnew = new xf_t;
(*xfnew) = (*currentxf);
xfnew->SetBorderStyle(side, style, color);
xfnew->MarkUsed();
xfnew = m_pGlobalRecs->ReplaceXFormat(xfbackup, xfnew);
pxf = xfnew;
pxf->MarkUsed();
}
delete xfbackup;
}
void cell_t::font(font_t* fontidx)
{
SET_XF_CELL_FUNCTION(SetFont, fontidx);
/*
xf_t* currentxf = pxf;
if(pxf == NULL)
currentxf = m_pGlobalRecs->GetDefaultXF();
xf_t* xfbackup = new xf_t;
(*xfbackup) = (*currentxf);
if(currentxf->Usage() > 1)
{
xf_t* newxf = new xf_t();
(*newxf) = (*currentxf);
newxf->SetFont(fontidx);
newxf = m_pGlobalRecs->AddXFormat(newxf);
pxf = newxf;
pxf->MarkUsed();
}
else
{
xf_t* xfnew = new xf_t;
(*xfnew) = (*currentxf);
xfnew->SetFont(fontidx);
xfnew->MarkUsed();
xfnew = m_pGlobalRecs->ReplaceXFormat(xfbackup, xfnew);
pxf = xfnew;
}
delete xfbackup;
*/
}
void cell_t::format(format_number_t formatidx)
{
SET_XF_CELL_FUNCTION(SetFormat,formatidx);
}
void cell_t::halign(halign_option_t ha_option)
{
SET_XF_CELL_FUNCTION(SetHAlign,ha_option);
}
void cell_t::valign(valign_option_t va_option)
{
SET_XF_CELL_FUNCTION(SetVAlign,va_option);
}
void cell_t::indent(indent_option_t indent_option)
{
SET_XF_CELL_FUNCTION(SetIndent,indent_option);
}
void cell_t::orientation(txtori_option_t ori_option)
{
SET_XF_CELL_FUNCTION(SetTxtOrientation,ori_option);
}
void cell_t::fillfgcolor(color_name_t color)
{
SET_XF_CELL_FUNCTION(SetFillFGColor,color);
/*
xf_t* currentxf = pxf;
if(pxf == NULL)
currentxf = m_pGlobalRecs->GetDefaultXF();
xf_t* xfbackup = new xf_t;
(*xfbackup) = (*currentxf);
if(currentxf->Usage() > 1)
{
xf_t* newxf = new xf_t();
(*newxf) = (*currentxf);
newxf->SetFillFGColor(color);
newxf = m_pGlobalRecs->AddXFormat(newxf);
pxf = newxf;
pxf->MarkUsed();
}
else
{
xf_t* xfnew = new xf_t;
(*xfnew) = (*currentxf);
xfnew->SetFillFGColor(color);
xfnew->MarkUsed();
xfnew = m_pGlobalRecs->ReplaceXFormat(xfbackup, xfnew);
pxf = xfnew;
pxf->MarkUsed();
}
delete xfbackup;
*/
}
void cell_t::fillbgcolor(color_name_t color)
{
SET_XF_CELL_FUNCTION(SetFillBGColor,color);
}
void cell_t::fillstyle(fill_option_t fill)
{
SET_XF_CELL_FUNCTION(SetFillStyle,fill);
/*
xf_t* currentxf = pxf;
if(pxf == NULL)
currentxf = m_pGlobalRecs->GetDefaultXF();
xf_t* xfbackup = new xf_t;
(*xfbackup) = (*currentxf);
if(currentxf->Usage() > 1)
{
xf_t* newxf = new xf_t();
(*newxf) = (*currentxf);
newxf->SetFillStyle(fill);
newxf = m_pGlobalRecs->AddXFormat(newxf);
pxf = newxf;
pxf->MarkUsed();
}
else
{
xf_t* xfnew = new xf_t;
(*xfnew) = (*currentxf);
xfnew->SetFillStyle(fill);
xfnew = m_pGlobalRecs->ReplaceXFormat(xfbackup, xfnew);
pxf = xfnew;
pxf->MarkUsed();
}
delete xfbackup;
*/
}
void cell_t::locked(bool locked_opt)
{
SET_XF_CELL_FUNCTION(SetLocked,locked_opt);
}
void cell_t::hidden(bool hidden_opt)
{
SET_XF_CELL_FUNCTION(SetHidden,hidden_opt);
}
void cell_t::wrap(bool wrap_opt)
{
SET_XF_CELL_FUNCTION(SetWrap,wrap_opt);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Implementation of the FONT record interface (font_i pure virtual interface)
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define SET_CELL_FONT_FUNCTION(function,value) \
{ \
bool samexf = true; \
\
xf_t* currentxf = pxf; \
if(pxf == NULL) \
currentxf = m_pGlobalRecs->GetDefaultXF(); \
\
xf_t* xfbackup = new xf_t; \
(*xfbackup) = (*currentxf); \
\
xf_t* newxf = currentxf; \
if(currentxf->Usage() > 1) \
samexf = false; \
\
newxf = new xf_t(); \
(*newxf) = (*currentxf); \
\
font_t* currentfont = newxf->GetFont(); \
if(currentfont == NULL) \
currentfont = m_pGlobalRecs->GetDefaultFont(); \
if(currentfont->Usage() > 1) \
{ \
font_t* newfont = new font_t(); \
(*newfont) = (*currentfont); \
newfont->function(value); \
newfont = m_pGlobalRecs->AddFont(newfont); \
newxf->SetFont(newfont); \
} \
else \
{ \
font_t* fntnew = new font_t; \
(*fntnew) = (*currentfont); \
fntnew->function(value); \
fntnew = m_pGlobalRecs->ReplaceFont(currentfont, fntnew); \
newxf->SetFont(fntnew) ; \
} \
if(samexf) \
{ \
newxf = m_pGlobalRecs->ReplaceXFormat(xfbackup, newxf); \
pxf = newxf; \
pxf->MarkUsed(); \
} \
else \
{ \
newxf = m_pGlobalRecs->AddXFormat(newxf); \
pxf = newxf; \
pxf->MarkUsed(); \
} \
delete xfbackup; \
}
void cell_t::fontname(string fntname)
{
SET_CELL_FONT_FUNCTION(SetName, fntname);
/*
bool samexf = true;
xf_t* currentxf = pxf;
if(pxf == NULL)
currentxf = m_pGlobalRecs->GetDefaultXF();
xf_t* xfbackup = new xf_t;
(*xfbackup) = (*currentxf);
xf_t* newxf = currentxf;
if(currentxf->Usage() > 1)
samexf = false;
newxf = new xf_t();
(*newxf) = (*currentxf);
font_t* currentfont = newxf->GetFont();
if(currentfont == NULL)
currentfont = m_pGlobalRecs->GetDefaultFont();
if(currentfont->Usage() > 1)
{
font_t* newfont = new font_t();
(*newfont) = (*currentfont);
newfont->SetName(fntname);
newfont = m_pGlobalRecs->AddFont(newfont);
newxf->SetFont(newfont);
}
else
{
font_t* fntnew = new font_t;
(*fntnew) = (*currentfont);
fntnew->SetName(fntname);
fntnew = m_pGlobalRecs->ReplaceFont(currentfont, fntnew);
newxf->SetFont(fntnew) ;
}
if(samexf)
{
newxf = m_pGlobalRecs->ReplaceXFormat(xfbackup, newxf);
pxf = newxf;
pxf->MarkUsed();
}
else
{
newxf = m_pGlobalRecs->AddXFormat(newxf);
pxf = newxf;
pxf->MarkUsed();
}
delete xfbackup;
*/
}
void cell_t::fontheight(unsigned16_t fntheight)
{
SET_CELL_FONT_FUNCTION(SetHeight,fntheight);
}
void cell_t::fontbold(boldness_option_t fntboldness)
{
/*
bool samexf = true;
xf_t* currentxf = pxf;
if(pxf == NULL)
currentxf = m_pGlobalRecs->GetDefaultXF();
xf_t* xfbackup = new xf_t;
(*xfbackup) = (*currentxf);
xf_t* newxf = currentxf;
if(currentxf->Usage() > 1)
samexf = false;
newxf = new xf_t();
(*newxf) = (*currentxf);
font_t* currentfont = newxf->GetFont();
if(currentfont == NULL)
currentfont = m_pGlobalRecs->GetDefaultFont();
if(currentfont->Usage() > 1)
{
font_t* newfont = new font_t();
(*newfont) = (*currentfont);
newfont->SetBoldStyle(fntboldness);
newfont = m_pGlobalRecs->AddFont(newfont);
newxf->SetFont(newfont);
}
else
{
font_t* fntnew = new font_t;
(*fntnew) = (*currentfont);
fntnew->SetBoldStyle(fntboldness);
fntnew = m_pGlobalRecs->ReplaceFont(currentfont, fntnew);
newxf->SetFont(fntnew) ;
}
if(samexf)
{
newxf = m_pGlobalRecs->ReplaceXFormat(xfbackup, newxf);
pxf = newxf;
}
else
{
newxf = m_pGlobalRecs->AddXFormat(newxf);
pxf = newxf;
pxf->MarkUsed();
}
delete xfbackup;
*/
SET_CELL_FONT_FUNCTION(SetBoldStyle,fntboldness);
}
void cell_t::fontunderline(underline_option_t fntunderline)
{
SET_CELL_FONT_FUNCTION(SetUnderlineStyle,fntunderline);
}
void cell_t::fontscript(script_option_t fntscript)
{
SET_CELL_FONT_FUNCTION(SetScriptStyle,fntscript);
}
void cell_t::fontcolor(color_name_t fntcolor)
{
SET_CELL_FONT_FUNCTION(SetColor,fntcolor);
}
void cell_t::fontattr(unsigned16_t attr)
{
SET_CELL_FONT_FUNCTION(SetAttributes,attr);
}
void cell_t::fontitalic(bool italic)
{
SET_CELL_FONT_FUNCTION(SetItalic,italic);
}
void cell_t::fontstrikeout(bool so)
{
SET_CELL_FONT_FUNCTION(SetStrikeout,so);
}
void cell_t::fontoutline(bool ol)
{
SET_CELL_FONT_FUNCTION(SetOutline,ol);
}
void cell_t::fontshadow(bool sh)
{
SET_CELL_FONT_FUNCTION(SetShadow,sh);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: cell.cpp,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:54 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

174
uppdev/XLS/cell.h Normal file
View file

@ -0,0 +1,174 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/cell.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef CELL_H
#define CELL_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/unit.h>
#include <XLS/extformat.h>
#include <XLS/globalrec.h>
namespace xlslib_core
{
class cell_t
: public xf_i , public font_i
{
public:
cell_t();
virtual ~cell_t();
unsigned16_t GetXFIndex(void);
unsigned16_t GetRow(void){return row;};
unsigned16_t GetCol(void){return col;};
void SetXF(xf_t* pxfval){pxf = pxfval;};
xf_t* GetXF(void){return pxf;};
virtual unsigned16_t GetSize() = 0;
virtual CUnit* GetData() = 0;
/*
bool operator<(const cell_t& right) const;
bool operator>(const cell_t& right) const;
bool operator%(const cell_t& right) const;
*/
bool operator==(const cell_t& right) const;
bool operator!=(const cell_t& right) const;
void SetGlobalRecs(CGlobalRecords* pglobalr) {m_pGlobalRecs = pglobalr;};
private:
CGlobalRecords *m_pGlobalRecs;
protected:
unsigned16_t row;
unsigned16_t col;
xf_t* pxf;
public: // xf_i interface
void font(font_t* fontidx);
void format(format_number_t formatidx);
void halign(halign_option_t ha_option);
void valign(valign_option_t va_option);
void indent(indent_option_t indent_option);
void orientation(txtori_option_t ori_option);
void fillfgcolor(color_name_t color);
void fillbgcolor(color_name_t color);
void fillstyle(fill_option_t fill);
void locked(bool locked_opt);
void hidden(bool hidden_opt);
void wrap(bool wrap_opt);
void borderstyle(border_side_t side,
border_style_t style,
color_name_t color);
public: //font_i interface
void fontname(std::string fntname);
void fontheight(unsigned16_t fntheight);
void fontbold(boldness_option_t fntboldness);
void fontunderline(underline_option_t fntunderline);
void fontscript(script_option_t fntscript);
void fontcolor(color_name_t fntcolor);
void fontattr(unsigned16_t attr);
void fontitalic(bool italic);
void fontstrikeout(bool so);
void fontoutline(bool ol);
void fontshadow(bool sh);
};
// #ifdef WIN32
// A bug in the compiler doesn't allow to use the functor direcly
// with the list::sort() function
// template<>
// struct std::greater<cell_t*> : public binary_function<cell_t* ,cell_t*, bool>
// {
// public:
// bool operator()(cell_t* &a, cell_t* &b)
// {
// return (a->GetRow() < b->GetRow());
// };
// };
//
//
//
// struct rowsort: public greater<cell_t*>
// {
// public:
// bool operator()(cell_t* &a, cell_t* &b) const
// {
// return (a->GetRow() < b->GetRow());
// };
// };
// #endif
struct rowsort
{
public:
bool operator()(cell_t* &a, cell_t* &b) const
{
return (a->GetRow() < b->GetRow() ? true : false);
};
};
class insertsort
{
public:
bool operator()(cell_t* a, cell_t* b) const
{
unsigned32_t aval = 100000*(a->GetRow()) + a->GetCol();
unsigned32_t bval = 100000*(b->GetRow()) + b->GetCol();
return (aval < bval ? true : false);
};
};
typedef std::set<xlslib_core::cell_t*,insertsort XLSLIB_DFLT_ALLOCATOR> Cell_List_t;
typedef Cell_List_t::iterator Cell_List_Itor_t;
}
#endif // CELL_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: cell.h,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:47 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

74
uppdev/XLS/colinfo.cpp Normal file
View file

@ -0,0 +1,74 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/colinfo.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/colinfo.h>
using namespace std;
using namespace xlslib_core;
CColInfo::CColInfo(colinfo_t* newci)
{
SetRecordType(RECTYPE_COLINFO);
AddValue16(newci->colfirst);
AddValue16(newci->collast);
AddValue16(newci->width);
// TODO: Mark the XFormat as used
if(newci->xformat != NULL)
AddValue16(newci->xformat->GetIndex());
else
AddValue16(0x0000);
AddValue16(newci->flags);
SetRecordLength(GetDataSize()-4);
}
CColInfo::~CColInfo()
{
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: colinfo.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:49 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

87
uppdev/XLS/colinfo.h Normal file
View file

@ -0,0 +1,87 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/colinfo.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef COLINFO_H
#define COLINFO_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/record.h>
#include <XLS/extformat.h>
namespace xlslib_core
{
typedef struct
{
unsigned16_t colfirst;
unsigned16_t collast;
unsigned16_t width;
xf_t* xformat;
unsigned16_t flags;
} colinfo_t;
struct colinfosort
{
public:
bool operator()(colinfo_t* const &a, colinfo_t* const &b) const
{
return (a->colfirst < b->colfirst);
};
};
typedef std::set<xlslib_core::colinfo_t*, colinfosort XLSLIB_DFLT_ALLOCATOR> Colinfo_List_t;
typedef Colinfo_List_t::iterator Colinfo_List_Itor_t;
class CColInfo: public CRecord
{
public:
CColInfo(colinfo_t* newci);
~CColInfo();
};
}
#endif //COLINFO_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: colinfo.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:43 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

143
uppdev/XLS/colors.h Normal file
View file

@ -0,0 +1,143 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/colors.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/config.h>
#ifndef COLORS_H
#define COLORS_H
namespace xlslib_core
{
#define COLOR_CODE_BLACK (0x08)
#define COLOR_CODE_DARK_RED (0x10)
#define COLOR_CODE_RED (0x0a)
#define COLOR_CODE_FUCSIA (0x0e)
#define COLOR_CODE_COMBINED01 (0x2d)
#define COLOR_CODE_COMBINED02 (0x3c)
#define COLOR_CODE_COMBINED03 (0x35)
#define COLOR_CODE_COMBINED04 (0x34)
#define COLOR_CODE_COMBINED05 (0x33)
#define COLOR_CODE_COMBINED06 (0x2f)
#define COLOR_CODE_OLIVE (0x3b)
#define COLOR_CODE_DARK_YELLOW (0x13)
#define COLOR_CODE_COMBINED07 (0x32)
#define COLOR_CODE_YELLOW (0x0d)
#define COLOR_CODE_LIGHT_YELLOW (0x2b)
#define COLOR_CODE_DARK_GREEN (0x3a)
#define COLOR_CODE_GREEN (0x11)
#define COLOR_CODE_COMBINED08 (0x39)
#define COLOR_CODE_LIVING_GREEN (0x0b)
#define COLOR_CODE_LIGHT_GREEN (0x2a)
#define COLOR_CODE_COMBINED09 (0x38)
#define COLOR_CODE_BLUE_GREEN (0x15)
#define COLOR_CODE_AQUAMARINA (0x31)
#define COLOR_CODE_TURQOISE (0x0f)
#define COLOR_CODE_COMBINED10 (0x29)
#define COLOR_CODE_DARK_BLUE (0x12)
#define COLOR_CODE_BLUE (0x0c)
#define COLOR_CODE_LIGHT_BLUE (0x30)
#define COLOR_CODE_SKY_BLUE (0x28)
#define COLOR_CODE_COMBINED11 (0x2c)
#define COLOR_CODE_INDIGO (0x3e)
#define COLOR_CODE_BLUE_GRAY (0x36)
#define COLOR_CODE_VIOLET (0x14)
#define COLOR_CODE_PLUM (0x3d)
#define COLOR_CODE_LAVANDER (0x2e)
#define COLOR_CODE_COMBINED12 (0x3f)
#define COLOR_CODE_GRAY50 (0x17)
#define COLOR_CODE_GRAY40 (0x37)
#define COLOR_CODE_GRAY25 (0x16)
#define COLOR_CODE_WHITE (0x09)
typedef enum
{
COLOR_BLACK,
COLOR_DARK_RED,
COLOR_RED,
COLOR_FUCSIA,
COLOR_COMBINED01,
COLOR_COMBINED02,
COLOR_COMBINED03,
COLOR_COMBINED04,
COLOR_COMBINED05,
COLOR_COMBINED06,
COLOR_OLIVE,
COLOR_DARK_YELLOW,
COLOR_COMBINED07,
COLOR_YELLOW,
COLOR_LIGHT_YELLOW,
COLOR_DARK_GREEN,
COLOR_GREEN,
COLOR_COMBINED08,
COLOR_LIVING_GREEN,
COLOR_LIGHT_GREEN,
COLOR_COMBINED09,
COLOR_BLUE_GREEN,
COLOR_AQUAMARINA,
COLOR_TURQOISE,
COLOR_COMBINED10,
COLOR_DARK_BLUE,
COLOR_BLUE,
COLOR_LIGHT_BLUE,
COLOR_SKY_BLUE,
COLOR_COMBINED11,
COLOR_INDIGO,
COLOR_BLUE_GRAY,
COLOR_VIOLET,
COLOR_PLUM,
COLOR_LAVANDER,
COLOR_COMBINED12,
COLOR_GRAY50,
COLOR_GRAY40,
COLOR_GRAY25,
COLOR_WHITE
}color_name_t;
}
#endif //COLORS_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: colors.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:44 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

91
uppdev/XLS/common.h Normal file
View file

@ -0,0 +1,91 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/common.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef COMMON_H
#define COMMON_H
#include <list>
#include <vector>
#include <algorithm>
#include <string>
#include <XLS/systype.h>
#ifdef HAVE_ICONV
#include <iconv.h>
#endif
namespace xlslib_core
{
// Some typedefs used only by xlslib core
typedef struct
{
unsigned16_t first_row;
unsigned16_t last_row;
unsigned16_t first_col;
unsigned16_t last_col;
} range_t;
#if defined(_MSC_VER) && defined(WIN32)
typedef std::list<range_t* XLSLIB_DFLT_ALLOCATOR> Range_List_t;
typedef Range_List_t::iterator Range_List_Itor_t;
class range;
typedef std::list<range* XLSLIB_DFLT_ALLOCATOR> RangeObj_List_t;
typedef RangeObj_List_t::iterator RangeObj_List_Itor_t;
#else
typedef std::list<xlslib_core::range_t* XLSLIB_DFLT_ALLOCATOR> Range_List_t;
typedef Range_List_t::iterator Range_List_Itor_t;
class range;
typedef std::list<xlslib_core::range* XLSLIB_DFLT_ALLOCATOR> RangeObj_List_t;
typedef RangeObj_List_t::iterator RangeObj_List_Itor_t;
#endif
}
#endif //COMMON_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: common.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:57 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

98
uppdev/XLS/config.h Normal file
View file

@ -0,0 +1,98 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/common/config.h,v $
* $Revision: 1.3 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef CONFIG_H
#define CONFIG_H
#ifdef HAVE_CONFIG_H
#include <XLS/xlconfig.h>
#define CFG_TRUE 1
#define CFG_FALSE 0
#define ALLOCATOR_STL 0
#define ALLOCATOR_BTI 1
#if defined(USE_BTI_ALLOC)
# define ALLOCATOR_DFLT ALLOCATOR_BTI
#elif defined(ALLOC_BTI)
# define ALLOCATOR_DFLT ALLOCATOR_STL
#else
# define ALLOCATOR_DFLT ALLOCATOR_STL
#endif
#else // HAVE_CONFIG_H
#if defined(_MSC_VER) && defined(WIN32)
// Fakes the inclusion of crtdbg.h to avoid duplicated symbols
// of (inlined) new() and delete() operators
#define _INC_CRTDBG
#else
#endif
#define CFG_TRUE 1
#define CFG_FALSE 0
#define ALLOCATOR_STL 0
#define ALLOCATOR_BTI 1
#if defined(ALLOC_STL)
# define ALLOCATOR_DFLT ALLOCATOR_STL
#elif defined(ALLOC_BTI)
# define ALLOCATOR_DFLT ALLOCATOR_BTI
#else
# define ALLOCATOR_DFLT ALLOCATOR_STL
#endif
#endif // HAVE_CONFIG_H
#endif //CONFIG_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: config.h,v $
* Revision 1.3 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.2 2004/09/01 00:47:04 darioglz
* + Modified to gain independence of target
*
* Revision 1.1.1.1 2004/08/27 16:32:05 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

68
uppdev/XLS/continue.cpp Normal file
View file

@ -0,0 +1,68 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/continue.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/continue.h>
/*
******************************
CContinue class implementation
******************************
*/
using namespace std;
using namespace xlslib_core;
CContinue::CContinue(unsigned8_t* data, unsigned32_t size)
{
SetRecordType(RECTYPE_CONTINUE );
AddDataArray(data,size);
SetRecordLength(GetDataSize()-4);
}
CContinue::~CContinue()
{}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: continue.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:53 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

72
uppdev/XLS/continue.h Normal file
View file

@ -0,0 +1,72 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/continue.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef CONTINUE_H
#define CONTINUE_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLs/record.h>
namespace xlslib_core
{
class CContinue: public CRecord
{
protected:
public:
CContinue(unsigned8_t* data, unsigned32_t size);
~CContinue();
};
}
#endif //CONTINUE_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: continue.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:49 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

254
uppdev/XLS/crc.cpp Normal file
View file

@ -0,0 +1,254 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/crc.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/crc.h>
using namespace std;
using namespace xlslib_core;
/*
* Derive parameters from the standard-specific parameters in crc.h.
*/
#define WIDTH (8 * sizeof(crc32_t))
#define TOPBIT (1 << (WIDTH - 1))
#if REFLECT_DATA == TRUE
#undef REFLECT_DATA
#define REFLECT_DATA(X) ((unsigned char) reflect((X), 8))
#else
#undef REFLECT_DATA
#define REFLECT_DATA(X) (X)
#endif
#if REFLECT_REMAINDER == TRUE
#undef REFLECT_REMAINDER
#define REFLECT_REMAINDER(X) ((crc32_t) reflect((X), WIDTH))
#else
#undef REFLECT_REMAINDER
#define REFLECT_REMAINDER(X) (X)
#endif
/*
const crc32_t crc::CRC_CCITT_TABLE[256] =
{
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0,
};
const crc32_t crc::CRC_16_TABLE[256] =
{
0x0000, 0x8005, 0x800f, 0x000a, 0x801b, 0x001e, 0x0014, 0x8011, 0x8033, 0x0036, 0x003c, 0x8039, 0x0028, 0x802d, 0x8027, 0x0022,
0x8063, 0x0066, 0x006c, 0x8069, 0x0078, 0x807d, 0x8077, 0x0072, 0x0050, 0x8055, 0x805f, 0x005a, 0x804b, 0x004e, 0x0044, 0x8041,
0x80c3, 0x00c6, 0x00cc, 0x80c9, 0x00d8, 0x80dd, 0x80d7, 0x00d2, 0x00f0, 0x80f5, 0x80ff, 0x00fa, 0x80eb, 0x00ee, 0x00e4, 0x80e1,
0x00a0, 0x80a5, 0x80af, 0x00aa, 0x80bb, 0x00be, 0x00b4, 0x80b1, 0x8093, 0x0096, 0x009c, 0x8099, 0x0088, 0x808d, 0x8087, 0x0082,
0x8183, 0x0186, 0x018c, 0x8189, 0x0198, 0x819d, 0x8197, 0x0192, 0x01b0, 0x81b5, 0x81bf, 0x01ba, 0x81ab, 0x01ae, 0x01a4, 0x81a1,
0x01e0, 0x81e5, 0x81ef, 0x01ea, 0x81fb, 0x01fe, 0x01f4, 0x81f1, 0x81d3, 0x01d6, 0x01dc, 0x81d9, 0x01c8, 0x81cd, 0x81c7, 0x01c2,
0x0140, 0x8145, 0x814f, 0x014a, 0x815b, 0x015e, 0x0154, 0x8151, 0x8173, 0x0176, 0x017c, 0x8179, 0x0168, 0x816d, 0x8167, 0x0162,
0x8123, 0x0126, 0x012c, 0x8129, 0x0138, 0x813d, 0x8137, 0x0132, 0x0110, 0x8115, 0x811f, 0x011a, 0x810b, 0x010e, 0x0104, 0x8101,
0x8303, 0x0306, 0x030c, 0x8309, 0x0318, 0x831d, 0x8317, 0x0312, 0x0330, 0x8335, 0x833f, 0x033a, 0x832b, 0x032e, 0x0324, 0x8321,
0x0360, 0x8365, 0x836f, 0x036a, 0x837b, 0x037e, 0x0374, 0x8371, 0x8353, 0x0356, 0x035c, 0x8359, 0x0348, 0x834d, 0x8347, 0x0342,
0x03c0, 0x83c5, 0x83cf, 0x03ca, 0x83db, 0x03de, 0x03d4, 0x83d1, 0x83f3, 0x03f6, 0x03fc, 0x83f9, 0x03e8, 0x83ed, 0x83e7, 0x03e2,
0x83a3, 0x03a6, 0x03ac, 0x83a9, 0x03b8, 0x83bd, 0x83b7, 0x03b2, 0x0390, 0x8395, 0x839f, 0x039a, 0x838b, 0x038e, 0x0384, 0x8381,
0x0280, 0x8285, 0x828f, 0x028a, 0x829b, 0x029e, 0x0294, 0x8291, 0x82b3, 0x02b6, 0x02bc, 0x82b9, 0x02a8, 0x82ad, 0x82a7, 0x02a2,
0x82e3, 0x02e6, 0x02ec, 0x82e9, 0x02f8, 0x82fd, 0x82f7, 0x02f2, 0x02d0, 0x82d5, 0x82df, 0x02da, 0x82cb, 0x02ce, 0x02c4, 0x82c1,
0x8243, 0x0246, 0x024c, 0x8249, 0x0258, 0x825d, 0x8257, 0x0252, 0x0270, 0x8275, 0x827f, 0x027a, 0x826b, 0x026e, 0x0264, 0x8261,
0x0220, 0x8225, 0x822f, 0x022a, 0x823b, 0x023e, 0x0234, 0x8231, 0x8213, 0x0216, 0x021c, 0x8219, 0x0208, 0x820d, 0x8207, 0x0202,
};
*/
const crc32_t crc::CRC_32_TABLE[256] =
{
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
};
crc::~crc()
{
}
/*********************************************************************
*
* Function: reflect()
*
* Description: Reorder the bits of a binary sequence, by reflecting
* them about the middle position.
*
* Notes: No checking is done that nBits <= 32.
*
* Returns: The reflection of the original data.
*
*********************************************************************/
unsigned32_t
crc::reflect(unsigned32_t data, unsigned char nBits)
{
unsigned32_t reflection = 0x00000000;
unsigned char bit;
/*
* Reflect the data about the center bit.
*/
for (bit = 0; bit < nBits; ++bit)
{
/*
* If the LSB bit is set, set the reflection of it.
*/
if (data & 0x01)
{
reflection |= (1 << ((nBits - 1) - bit));
}
data = (data >> 1);
}
return (reflection);
} /* reflect() */
/*********************************************************************
*
* Function: crcInit()
*
* Description: Populate the partial CRC lookup table.
*
* Notes: This function must be rerun any time the CRC standard
* is changed. If desired, it can be run "offline" and
* the table results stored in an embedded system's ROM.
*
* Returns: None defined.
*
*********************************************************************/
crc::crc()
{
} /* crcInit() */
/*********************************************************************
*
* Function: crcFast()
*
* Description: Compute the CRC of a given message.
*
* Notes: crcInit() must be called first.
*
* Returns: The CRC of the message.
*
*********************************************************************/
crc32_t
crc::get(string& message)
{
unsigned char data;
size_t byte;
crc32_t remainder = INITIAL_REMAINDER;
/*
* Divide the message by the polynomial, a byte at a time.
*/
size_t nBytes = message.size();
for (byte = 0; byte < nBytes; ++byte)
{
data = (unsigned char)(REFLECT_DATA(message[byte]) ^ (remainder >> (WIDTH - 8)));
remainder = crc::CRC_32_TABLE[data] ^ (remainder << 8);
}
/*
* The final remainder is the CRC.
*/
return (REFLECT_REMAINDER(remainder) ^ FINAL_XOR_VALUE);
} /* crcFast() */
crc32_t
crc::get()
{
return get(m_data);
}
string& crc::getdata()
{
return m_data;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: crc.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:53 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

104
uppdev/XLS/crc.h Normal file
View file

@ -0,0 +1,104 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/crc.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef _crc_h
#define _crc_h
#include <string>
#include <XLS/config.h>
#include <XLS/systype.h>
#include <XLS/tostr.h>
#define FALSE 0
#define TRUE !FALSE
/*
* Select the CRC standard from the list that follows.
*/
#define CRC32
#define CRC_NAME "CRC-32"
#define POLYNOMIAL 0x04C11DB7
#define INITIAL_REMAINDER 0xFFFFFFFF
#define FINAL_XOR_VALUE 0xFFFFFFFF
#define REFLECT_DATA TRUE
#define REFLECT_REMAINDER TRUE
#define CHECK_VALUE 0xCBF43926
namespace xlslib_core
{
typedef unsigned32_t crc32_t;
class crc
{
public:
crc();
~crc();
crc32_t get(std::string& message);
crc32_t get();
void operator<<(std::string newstr) { m_data += newstr; }
void operator<<(unsigned32_t newdata) { m_data += str_stream(newdata); }
void operator<<(unsigned64_t newdata) { m_data += str_stream(newdata); }
void operator<<(unsigned char newdata) { m_data += str_stream(newdata); }
void operator<<(unsigned short newdata) { m_data += str_stream(newdata); }
void operator<<(bool newdata) { m_data += str_stream(newdata); }
void operator<<(double newdata) { m_data += str_stream(newdata); }
std::string& getdata();
private:
std::string m_data;
static const crc32_t CRC_32_TABLE[256];
unsigned32_t reflect(unsigned32_t data, unsigned char nBits);
};
}
#endif /* _crc_h */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: crc.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:46 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

314
uppdev/XLS/data/data3.h Normal file
View file

@ -0,0 +1,314 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/data/data3.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef DATA3_H
#define DATA3_H
// 4096 of the first bytes
const unsigned8_t xlslib_core::CSummaryInfo::summ_info_data[] = {
0xfe, 0xff, 0x00, 0x00, 0x05, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe0, 0x85, 0x9f, 0xf2,
0xf9, 0x4f, 0x68, 0x10, 0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9, 0x30, 0x00, 0x00, 0x00,
0xfc, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00,
0x12, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00,
0x0d, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0xe4, 0x04, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x58, 0x4c, 0x53, 0x4c, 0x49, 0x42, 0x20, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x00, 0x73, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x58, 0x4c, 0x53, 0x4c, 0x69, 0x62, 0x20, 0x76,
0x58, 0x2e, 0x58, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x59, 0x65, 0x69, 0x63,
0x6f, 0x20, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x0d, 0x0a, 0x77, 0x77, 0x77, 0x2e,
0x79, 0x65, 0x69, 0x63, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x0d, 0x0a, 0x00, 0x1e, 0x00, 0x00, 0x00,
0x0f, 0x00, 0x00, 0x00, 0x44, 0x61, 0x72, 0x69, 0x6f, 0x20, 0x47, 0x6f, 0x6e, 0x7a, 0x61, 0x6c,
0x65, 0x7a, 0x00, 0x0a, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x4d, 0x69, 0x63, 0x72,
0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x45, 0x78, 0x63, 0x65, 0x6c, 0x00, 0x40, 0x00, 0x00, 0x00,
0x80, 0x7f, 0x5b, 0x0d, 0xb9, 0xa0, 0xc3, 0x01, 0x40, 0x00, 0x00, 0x00, 0x80, 0xd2, 0xc0, 0xa4,
0xb9, 0xa0, 0xc3, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// Master blocks
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
#endif //DATA3_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: data3.h,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:59 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

315
uppdev/XLS/data/data4.h Normal file
View file

@ -0,0 +1,315 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/data/data4.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef DATA4_H
#define DATA4_H
////////////////////////////////////////////////////////////////////////
const unsigned8_t xlslib_core::CDocSummaryInfo::doc_summ_info_data[] = {
0xfe, 0xff, 0x00, 0x00, 0x05, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0xd5, 0xcd, 0xd5,
0x9c, 0x2e, 0x1b, 0x10, 0x93, 0x97, 0x08, 0x00, 0x2b, 0x2c, 0xf9, 0xae, 0x30, 0x00, 0x00, 0x00,
0x98, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00,
0x0f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xe4, 0x04, 0x00, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x69, 0x63, 0x72, 0x0b, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x10, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x48, 0x6f, 0x6a, 0x61, 0x31, 0x00, 0x0c, 0x10,
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x48, 0x6f,
0x6a, 0x61, 0x73, 0x20, 0x64, 0x65, 0x20, 0x63, 0xe1, 0x6c, 0x63, 0x75, 0x6c, 0x6f, 0x00, 0x03,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
#endif //DATA4_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: data4.h,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:59 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

89
uppdev/XLS/datast.cpp Normal file
View file

@ -0,0 +1,89 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/datast.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/datast.h>
namespace xlslib_core
{
/*
***********************************
CDataStorage class Implementation
***********************************
*/
CDataStorage::CDataStorage()
:m_DataSize(0)
{
}
CDataStorage::~CDataStorage()
{
// Delete all the data. (Only if it exists)
if(!empty())
{
do
{
delete front();
pop_front();
}while(!empty());
}
}
void CDataStorage::operator+=(CUnit* from)
{
push_back(from);
m_DataSize += from->GetDataSize();
}
unsigned32_t CDataStorage::GetDataSize()
{
return m_DataSize;
}
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: datast.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:46 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

84
uppdev/XLS/datast.h Normal file
View file

@ -0,0 +1,84 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/datast.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef DATAST_H
#define DATAST_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/unit.h>
/*
******************************
COleFile class declaration
******************************
*/
namespace xlslib_core
{
typedef std::list<xlslib_core::CUnit* XLSLIB_DFLT_ALLOCATOR> DataList_t;
typedef DataList_t::iterator DataList_Itor_t;
class CDataStorage: public DataList_t
{
private:
unsigned32_t m_DataSize;
protected:
public:
CDataStorage ( );
~CDataStorage ( );
void operator+=(CUnit* from);
unsigned32_t GetDataSize();
};
}
#endif //DATAST_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: datast.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:54 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

View file

@ -0,0 +1,85 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/docsumminfo.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/docsumminfo.h>
#include <XLS/data/data4.h> // Temporarilly used to add data for summary info
using namespace std;
using namespace xlslib_core;
/*
**********************************************************************
CDocSummaryInfo class implementation
**********************************************************************
*/
CDocSummaryInfo::CDocSummaryInfo()
{
XTRACE("WRITE_DOC_SUMMARY");
CUnit* ptraildata = new CUnit;
ptraildata->AddDataArray(CDocSummaryInfo::doc_summ_info_data, sizeof(CDocSummaryInfo::doc_summ_info_data));
(*this) += ptraildata;
}
CDocSummaryInfo::~CDocSummaryInfo()
{
}
/*
***********************************
***********************************
*/
CUnit* CDocSummaryInfo::DumpData(void)
{
XTRACE("CDocSummaryInfo::DumpData");
return (CUnit*)this;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: docsumminfo.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:43 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

78
uppdev/XLS/docsumminfo.h Normal file
View file

@ -0,0 +1,78 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright (C) Yeico S. A. de C. V.
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/docsumminfo.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef DOCSUMMARYINFO_H
#define DOCSUMMARYINFO_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/datast.h>
namespace xlslib_core
{
/*
********************************
CDocSummaryInfo class declaration
********************************
*/
class CDocSummaryInfo: public CDataStorage
{
private:
static const unsigned8_t doc_summ_info_data[];
protected:
public:
CDocSummaryInfo();
~CDocSummaryInfo();
CUnit* DumpData();
};
}
#endif //DOCSUMMARYINFO_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: docsumminfo.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:54 darioglz
* Initial Import.
*
* Revision 1.6 2004/04/06 22:35:43 dgonzalez
* + Added namespace xlslib_core to isolate the core xlslib library names.
*
* Revision 1.5 2004/01/29 03:18:55 dgonzalez
* + Using the config.h file
*
* Revision 1.4 2003/12/05 00:30:06 dgonzalez
* + Common include files were placed in common.h (and this file was
* included instead.
*
* Revision 1.3 2003/11/26 16:49:26 dgonzalez
* + Indented and untabified
*
* Revision 1.2 2003/10/24 23:24:32 dgonzalez
* + Added CVS-Keyword substitution.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

1363
uppdev/XLS/extformat.cpp Normal file

File diff suppressed because it is too large Load diff

696
uppdev/XLS/extformat.h Normal file
View file

@ -0,0 +1,696 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/extformat.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef EXTFORMAT_H
#define EXTFORMAT_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/rectypes.h>
#include <XLS/record.h>
#include <XLS/colors.h>
#include <XLS/font.h>
#include <XLS/format.h>
namespace xlslib_core
{
// COMMON
// The Cell Properties bit or-masks:
#define XF_PROP_SHIFTPOS_PARENT (4)
#define XF_PROP_LOCKED ((unsigned16_t)0x0001)
#define XF_PROP_HIDDEN ((unsigned16_t)0x0002)
#define XF_PROP_STYLE ((unsigned16_t)0x0004)
#define XF_PROP_123PREFIX ((unsigned16_t)0x0008)
#define XF_PROP_XFPARENT ((unsigned16_t)0xFFF0)
// The Alignment field bit or-masks:
#define XF_ALIGN_HORIZONTAL ((unsigned16_t)0x0007)
#define XF_ALIGN_WRAP ((unsigned16_t)0x0008)
#define XF_ALIGN_VERTICAL ((unsigned16_t)0x0070)
#define XF_ALIGN_JUSTLAST ((unsigned32_t)0x0080) /* BIFF8: Used only in far-east versions of excel */
#define XF_ALIGN_ORIENTATION ((unsigned16_t)0x0300)
// Geometric Align options
#define XF_ALIGN_SHIFTPOS_HALIGN (0)
#define XF_ALIGN_SHIFTPOS_VALIGN (4)
// XF_USED_ATTRIB
#define XF_ALIGN_ATRNUM ((unsigned16_t)0x0400)
#define XF_ALIGN_ATRFONT ((unsigned16_t)0x0800)
#define XF_ALIGN_ATRALC ((unsigned16_t)0x1000)
#define XF_ALIGN_ATRBDR ((unsigned16_t)0x2000)
#define XF_ALIGN_ATRPAT ((unsigned16_t)0x4000)
#define XF_ALIGN_ATRPROT ((unsigned16_t)0x8000)
// Style options
#define XF_FILL_NONE ((unsigned8_t)0x00)
#define XF_FILL_SOLID ((unsigned8_t)0x01)
#define XF_FILL_ATEN75 ((unsigned8_t)0x03)
#define XF_FILL_ATEN50 ((unsigned8_t)0x02)
#define XF_FILL_ATEN25 ((unsigned8_t)0x04)
#define XF_FILL_ATEN12 ((unsigned8_t)0x11)
#define XF_FILL_ATEN06 ((unsigned8_t)0x12)
#define XF_FILL_HORIZ_LIN ((unsigned8_t)0x05)
#define XF_FILL_VERTICAL_LIN ((unsigned8_t)0x06)
#define XF_FILL_DIAG ((unsigned8_t)0x07)
#define XF_FILL_INV_DIAG ((unsigned8_t)0x08)
#define XF_FILL_INTER_DIAG ((unsigned8_t)0x09)
#define XF_FILL_DIAG_THICK_INTER ((unsigned8_t)0x0a)
#define XF_FILL_HORIZ_LINES_THIN ((unsigned8_t)0x0b)
#define XF_FILL_VERTICAL_LINES_THIN ((unsigned8_t)0x0c)
#define XF_FILL_DIAG_THIN ((unsigned8_t)0x0d)
#define XF_FILL_INV_DIAG_THIN ((unsigned8_t)0x0e)
#define XF_FILL_HORIZ_INT_THIN ((unsigned8_t)0x0f)
#define XF_FILL_HORIZ_INTER_THICK ((unsigned8_t)0x10)
typedef enum
{
FILL_NONE = 0,
FILL_SOLID,
FILL_ATEN75,
FILL_ATEN50,
FILL_ATEN25,
FILL_ATEN12,
FILL_ATEN06,
FILL_HORIZ_LIN,
FILL_VERTICAL_LIN,
FILL_DIAG,
FILL_INV_DIAG,
FILL_INTER_DIAG,
FILL_DIAG_THICK_INTER,
FILL_HORIZ_LINES_THIN,
FILL_VERTICAL_LINES_THIN,
FILL_DIAG_THIN,
FILL_INV_DIAG_THIN,
FILL_HORIZ_INT_THIN,
FILL_HORIZ_INTER_THICK
} fill_option_t;
// Border Options
#define XF_BRDOPTION_NONE ((unsigned8_t)0x00)
#define XF_BRDOPTION_THIN ((unsigned8_t)0x01)
#define XF_BRDOPTION_MEDIUM ((unsigned8_t)0x02)
#define XF_BRDOPTION_DASHED ((unsigned8_t)0x03)
#define XF_BRDOPTION_DOTTED ((unsigned8_t)0x04)
#define XF_BRDOPTION_THICK ((unsigned8_t)0x05)
#define XF_BRDOPTION_DOUBLE ((unsigned8_t)0x06)
#define XF_BRDOPTION_HAIR ((unsigned8_t)0x07)
typedef enum
{
BORDER_NONE = 0,
BORDER_THIN,
BORDER_MEDIUM,
BORDER_DASHED,
BORDER_DOTTED,
BORDER_THICK,
BORDER_DOUBLE,
BORDER_HAIR
} border_style_t;
// Border options
#define XF_BORDER_BOTTOM ((unsigned8_t)0)
#define XF_BORDER_TOP ((unsigned8_t)1)
#define XF_BORDER_LEFT ((unsigned8_t)2)
#define XF_BORDER_RIGHT ((unsigned8_t)3)
typedef enum
{
BORDER_BOTTOM = 0,
BORDER_TOP,
BORDER_LEFT,
BORDER_RIGHT,
DIAGONALS // BIFF8
} border_side_t;
// Horizontal Align options
#define XF_HALIGN_GENERAL ((unsigned8_t)0)
#define XF_HALIGN_LEFT ((unsigned8_t)1)
#define XF_HALIGN_CENTER ((unsigned8_t)2)
#define XF_HALIGN_RIGHT ((unsigned8_t)3)
#define XF_HALIGN_FILL ((unsigned8_t)4)
#define XF_HALIGN_JUSTIFY ((unsigned8_t)5)
#define XF_HALIGN_CENTERACCROSS ((unsigned8_t)6)
typedef enum
{
HALIGN_GENERAL = 0,
HALIGN_LEFT,
HALIGN_CENTER,
HALIGN_RIGHT,
HALIGN_FILL,
HALIGN_JUSTIFY,
HALIGN_CENTERACCROSS
} halign_option_t;
// Vertical Align options
#define XF_VALIGN_TOP ((unsigned8_t)0)
#define XF_VALIGN_CENTER ((unsigned8_t)1)
#define XF_VALIGN_BOTTOM ((unsigned8_t)2)
#define XF_VALIGN_JUSTIFY ((unsigned8_t)3)
typedef enum
{
VALIGN_TOP = 0,
VALIGN_CENTER,
VALIGN_BOTTOM,
VALIGN_JUSTIFY
} valign_option_t;
#define XF_COLOR_CODE_BLACK ((unsigned8_t)(COLOR_CODE_BLACK))
#define XF_COLOR_CODE_DARK_RED ((unsigned8_t)(COLOR_CODE_DARK_RED))
#define XF_COLOR_CODE_RED ((unsigned8_t)(COLOR_CODE_RED))
#define XF_COLOR_CODE_FUCSIA ((unsigned8_t)(COLOR_CODE_FUCSIA))
#define XF_COLOR_CODE_COMBINED01 ((unsigned8_t)(COLOR_CODE_COMBINED01))
#define XF_COLOR_CODE_COMBINED02 ((unsigned8_t)(COLOR_CODE_COMBINED02))
#define XF_COLOR_CODE_COMBINED03 ((unsigned8_t)(COLOR_CODE_COMBINED03))
#define XF_COLOR_CODE_COMBINED04 ((unsigned8_t)(COLOR_CODE_COMBINED04))
#define XF_COLOR_CODE_COMBINED05 ((unsigned8_t)(COLOR_CODE_COMBINED05))
#define XF_COLOR_CODE_COMBINED06 ((unsigned8_t)(COLOR_CODE_COMBINED06))
#define XF_COLOR_CODE_OLIVE ((unsigned8_t)(COLOR_CODE_OLIVE))
#define XF_COLOR_CODE_DARK_YELLOW ((unsigned8_t)(COLOR_CODE_DARK_YELLOW))
#define XF_COLOR_CODE_COMBINED07 ((unsigned8_t)(COLOR_CODE_COMBINED07))
#define XF_COLOR_CODE_YELLOW ((unsigned8_t)(COLOR_CODE_YELLOW))
#define XF_COLOR_CODE_LIGHT_YELLOW ((unsigned8_t)(COLOR_CODE_LIGHT_YELLOW))
#define XF_COLOR_CODE_DARK_GREEN ((unsigned8_t)(COLOR_CODE_DARK_GREEN))
#define XF_COLOR_CODE_GREEN ((unsigned8_t)(COLOR_CODE_GREEN))
#define XF_COLOR_CODE_COMBINED08 ((unsigned8_t)(COLOR_CODE_COMBINED08))
#define XF_COLOR_CODE_LIVING_GREEN ((unsigned8_t)(COLOR_CODE_LIVING_GREEN))
#define XF_COLOR_CODE_LIGHT_GREEN ((unsigned8_t)(COLOR_CODE_LIGHT_GREEN))
#define XF_COLOR_CODE_COMBINED09 ((unsigned8_t)(COLOR_CODE_COMBINED09))
#define XF_COLOR_CODE_BLUE_GREEN ((unsigned8_t)(COLOR_CODE_BLUE_GREEN))
#define XF_COLOR_CODE_AQUAMARINA ((unsigned8_t)(COLOR_CODE_AQUAMARINA))
#define XF_COLOR_CODE_TURQOISE ((unsigned8_t)(COLOR_CODE_TURQOISE))
#define XF_COLOR_CODE_COMBINED10 ((unsigned8_t)(COLOR_CODE_COMBINED10))
#define XF_COLOR_CODE_DARK_BLUE ((unsigned8_t)(COLOR_CODE_DARK_BLUE))
#define XF_COLOR_CODE_BLUE ((unsigned8_t)(COLOR_CODE_BLUE))
#define XF_COLOR_CODE_LIGHT_BLUE ((unsigned8_t)(COLOR_CODE_LIGHT_BLUE))
#define XF_COLOR_CODE_SKY_BLUE ((unsigned8_t)(COLOR_CODE_SKY_BLUE))
#define XF_COLOR_CODE_COMBINED11 ((unsigned8_t)(COLOR_CODE_COMBINED11))
#define XF_COLOR_CODE_INDIGO ((unsigned8_t)(COLOR_CODE_INDIGO))
#define XF_COLOR_CODE_BLUE_GRAY ((unsigned8_t)(COLOR_CODE_BLUE_GRAY))
#define XF_COLOR_CODE_VIOLET ((unsigned8_t)(COLOR_CODE_VIOLET))
#define XF_COLOR_CODE_PLUM ((unsigned8_t)(COLOR_CODE_PLUM))
#define XF_COLOR_CODE_LAVANDER ((unsigned8_t)(COLOR_CODE_LAVANDER))
#define XF_COLOR_CODE_COMBINED12 ((unsigned8_t)(COLOR_CODE_COMBINED12))
#define XF_COLOR_CODE_GRAY50 ((unsigned8_t)(COLOR_CODE_GRAY50))
#define XF_COLOR_CODE_GRAY40 ((unsigned8_t)(COLOR_CODE_GRAY40))
#define XF_COLOR_CODE_GRAY25 ((unsigned8_t)(COLOR_CODE_GRAY25))
#define XF_COLOR_CODE_WHITE ((unsigned8_t)(COLOR_CODE_WHITE))
#define XF_LOCKED true
#define XF_NO_LOCKED false
#define XF_HIDDEN true
#define XF_NO_HIDDEN false
#define XF_WRAPPED true
#define XF_NO_WRAPPED false
#define XF_IS_CELL true
#define XF_IS_STYLE false
// The XF-record field offsets:
#if VERSION_BIFF == VERSION_BIFF5
#define XF_OFFSET_FONT ((unsigned32_t) 4)
#define XF_OFFSET_FORMAT ((unsigned32_t) 6)
#define XF_OFFSET_PROP ((unsigned32_t) 8)
#define XF_OFFSET_ALIGN ((unsigned32_t)10) // 2 bytes
#define XF_OFFSET_COLOR ((unsigned32_t)12)
#define XF_OFFSET_BORDER0 ((unsigned32_t)14)
#define XF_OFFSET_BORDER1 ((unsigned32_t)16)
#define XF_OFFSET_BORDER2 ((unsigned32_t)18)
// Text Orientation Options
#define XF_ORI_SHIFTPOS (8)
#define XF_ORI_NONE ((unsigned8_t)0)
#define XF_ORI_TOPBOTTOMTXT ((unsigned8_t)1)
#define XF_ORI_90NOCLOCKTXT ((unsigned8_t)2)
#define XF_ORI_90CLOCKTXT ((unsigned8_t)3)
typedef enum
{
ORI_NONE = 0,
ORI_TOPBOTTOMTXT,
ORI_90NOCLOCKTXT,
ORI_90CLOCKTXT
} txtori_option_t;
// XF_USED_ATTRIB
#define XF_ATTRIB_SHIFTPOS (0)
// The Color field bit or-masks:
#define XF_COLOR_FOREGROUND ((unsigned16_t)0x007f)
#define XF_COLOR_BACKGROUND ((unsigned16_t)0x1f80)
#define XF_COLOR_SHIFTPOS_FG (0)
#define XF_COLOR_SHIFTPOS_BG (7)
// The Border0 field bit or-masks:
#define XF_STYLE_SHIFTPOS_BOTTOM (6)
#define XF_COLOR_SHIFTPOS_BOTTOM (9)
#define XF_BORDER_FILLPATTERN ((unsigned16_t)0x003f)
#define XF_BORDER_BOTTOMSTYLE ((unsigned16_t)0x01c0)
#define XF_BORDER_BOTTOMCOLOR ((unsigned16_t)0xfe00)
// The Border1 field bit or-masks:
#define XF_STYLE_SHIFTPOS_TOP (0)
#define XF_STYLE_SHIFTPOS_LEFT (3)
#define XF_STYLE_SHIFTPOS_RIGHT (6)
#define XF_COLOR_SHIFTPOS_TOP (9)
#define XF_BORDER_TOPSTYLE ((unsigned16_t)0x0007)
#define XF_BORDER_LEFTSTYLE ((unsigned16_t)0x0038)
#define XF_BORDER_RIGHTSTYLE ((unsigned16_t)0x01c0)
#define XF_BORDER_TOPCOLOR ((unsigned16_t)0xfe00)
// The Border2 field bit or-masks:
#define XF_COLOR_SHIFTPOS_LEFT (0)
#define XF_COLOR_SHIFTPOS_RIGHT (7)
#define XF_BORDER_LEFTCOLOR ((unsigned16_t)0x007f)
#define XF_BORDER_RIGHTCOLOR ((unsigned16_t)0x3f80)
//#define XF_BORDER2_RESERVED ((unsigned16_t)0xc000)
#else // VERSION_BIFF == VERSION_BIFF8
#define XF_OFFSET_FONT ((unsigned32_t) 4)
#define XF_OFFSET_FORMAT ((unsigned32_t) 6)
#define XF_OFFSET_PROP ((unsigned32_t) 8)
#define XF_OFFSET_ALIGN ((unsigned32_t)10) // 4 bytes
#define XF_OFFSET_BORDERA ((unsigned32_t)14) // 4 bytes
#define XF_OFFSET_BORDERB ((unsigned32_t)18) // 4 bytes
#define XF_OFFSET_COLOR ((unsigned32_t)22)
// Text Orientation Options
#define XF_ORI_SHIFTPOS (8)
#define XF_ORI_NONE ((unsigned8_t)0)
#define XF_ORI_90NOCLOCKTXT ((unsigned8_t)90)
#define XF_ORI_90CLOCKTXT ((unsigned8_t)180)
#define XF_ORI_TOPBOTTOMTXT ((unsigned8_t)255)
typedef enum
{
ORI_NONE = 0,
ORI_TOPBOTTOMTXT,
ORI_90NOCLOCKTXT,
ORI_90CLOCKTXT
} txtori_option_t;
// Indent field
#define XF_INDENT_SHIFTPOS (16)
#define XF_INDENT_LVL ((unsigned8_t)0x0F)
#define XF_INDENT_NONE ((unsigned8_t)0x00)
#define XF_INDENT_1 ((unsigned8_t)0x01)
#define XF_INDENT_2 ((unsigned8_t)0x02)
#define XF_INDENT_3 ((unsigned8_t)0x03)
#define XF_INDENT_4 ((unsigned8_t)0x04)
#define XF_INDENT_SHRINK2FIT ((unsigned8_t)0x10)
#define XF_INDENT_DIR ((unsigned8_t)0xC0)
#define XF_INDENT_CONTEXT ((unsigned8_t)0x00)
#define XF_INDENT_L2R ((unsigned8_t)0x40)
#define XF_INDENT_R2L ((unsigned8_t)0x80)
typedef enum
{
INDENT_NONE = 0,
INDENT_1,
INDENT_2,
INDENT_3,
INDENT_4,
INDENT_SHRINK2FIT,
INDENT_L2R,
INDENT_R2L
} indent_option_t;
// XF_USED_ATTRIB
#define XF_ATTRIB_SHIFTPOS (16) // bits shifted by 8 already
// The Border A field bit or-masks:
#define XF_STYLE_SHIFTPOS_LEFT (0)
#define XF_STYLE_SHIFTPOS_RIGHT (4)
#define XF_STYLE_SHIFTPOS_TOP (8)
#define XF_STYLE_SHIFTPOS_BOTTOM (12)
// The BorderA field bit or-masks:
#define XF_COLOR_SHIFTPOS_LEFT (16)
#define XF_COLOR_SHIFTPOS_RIGHT (23)
#define XF_BORDER_LEFTSTYLE ((unsigned32_t)0x0000000F)
#define XF_BORDER_RIGHTSTYLE ((unsigned32_t)0x000000F0)
#define XF_BORDER_TOPSTYLE ((unsigned32_t)0x00000F00)
#define XF_BORDER_BOTTOMSTYLE ((unsigned32_t)0x0000F000)
#define XF_BORDER_LEFTCOLOR ((unsigned32_t)0x007f0000)
#define XF_BORDER_RIGHTCOLOR ((unsigned32_t)0x3f800000)
#define XF_DIAG_TL2BR ((unsigned32_t)0x40000000)
#define XF_DIAG_BL2TR ((unsigned32_t)0x80000000)
// BORDER B
#define XF_COLOR_SHIFTPOS_TOP (0)
#define XF_COLOR_SHIFTPOS_BOTTOM (7)
#define XF_COLOR_SHIFTPOS_DIAG (14)
#define XF_STYLE_SHIFTPOS_DIAG (21)
#define XF_SHIFTPOS_FILLPATTERN (26)
#define XF_BORDER_TOPCOLOR ((unsigned16_t)0x0000007f)
#define XF_BORDER_BOTTOMCOLOR ((unsigned16_t)0x00003f80)
#define XF_BORDER_DIAGCOLOR ((unsigned16_t)0x001fc000)
#define XF_BORDER_DIAGSTYLE ((unsigned16_t)0x01e00000)
#define XF_BORDER_FILLPATTERN ((unsigned32_t)0xFC000000)
//#define XF_STYLE_SHIFTPOS_LEFT (3)
//#define XF_STYLE_SHIFTPOS_RIGHT (6)
//#define XF_COLOR_SHIFTPOS_TOP (9)
//#define XF_BORDER1_TOPSTYLE ((unsigned16_t)0x0007)
//#define XF_BORDER1_LEFTSTYLE ((unsigned16_t)0x0038)
//#define XF_BORDER1_RIGHTSTYLE ((unsigned16_t)0x01c0)
// The Color field bit or-masks:
#define XF_COLOR_SHIFTPOS_FG (0)
#define XF_COLOR_SHIFTPOS_BG (7)
#define XF_COLOR_FOREGROUND ((unsigned16_t)0x007f)
#define XF_COLOR_BACKGROUND ((unsigned16_t)0x3f80)
#define XF_COLOR_DIAG ((unsigned16_t)0xc000)
#endif
/*
******************************
CExtFormat class declaration
******************************
*/
typedef struct
{
unsigned16_t index;
font_t* font;
format_number_t format;
halign_option_t halign;
valign_option_t valign;
indent_option_t indent;
txtori_option_t txtorientation;
color_name_t fill_fgcolor;
color_name_t fill_bgcolor;
fill_option_t fillstyle;
bool locked;
bool hidden;
bool wrap;
bool is_cell;
border_style_t top_border_style;
color_name_t top_border_color;
border_style_t bottom_border_style;
color_name_t bottom_border_color;
border_style_t left_border_style;
color_name_t left_border_color;
border_style_t right_border_style;
color_name_t right_border_color;
} xf_init_t;
struct xf_i
{
virtual void font(font_t* fontidx) = 0;
virtual void format(format_number_t format) = 0;
virtual void halign(halign_option_t ha_option) = 0;
virtual void valign(valign_option_t va_option) = 0;
virtual void indent(indent_option_t indent_opt) = 0;
virtual void orientation(txtori_option_t ori_option) = 0;
virtual void fillfgcolor(color_name_t color) = 0;
virtual void fillbgcolor(color_name_t color) = 0;
virtual void fillstyle(fill_option_t fill) = 0;
virtual void locked(bool locked_opt) = 0;
virtual void hidden(bool hidden_opt) = 0;
virtual void wrap(bool wrap_opt) = 0;
virtual void borderstyle(border_side_t side,
border_style_t style,
color_name_t color) = 0;
};
class xf_t
{
public:
xf_t();
xf_t(const xf_init_t& xfinit);
xf_t(unsigned16_t index, font_t* font, format_number_t format, halign_option_t halign,
valign_option_t valign, indent_option_t indent, txtori_option_t txtorientation, color_name_t fill_fgcolor,
color_name_t fill_bgcolor, fill_option_t fillstyle, bool locked, bool hidden,
bool wrap, bool is_cell, border_style_t top_border_style, color_name_t top_border_color,
border_style_t bottom_border_style, color_name_t bottom_border_color, border_style_t left_border_style,
color_name_t left_border_color, border_style_t right_border_style, color_name_t right_border_color);
virtual ~xf_t();
void MarkUsed(void);
bool IsUsed(void);
unsigned16_t Usage(){return m_usage_counter;};
/* XF Index wrappers*/
void SetIndex(unsigned16_t xfidx){index = xfidx;};
unsigned16_t GetIndex(void){return index;};
/* Font Index wrappers*/
void SetFont(font_t* fontidx);
unsigned16_t GetFontIndex(void);
font_t* GetFont(void);
/* Format Index wrappers*/
void SetFormat(format_number_t formatidx);
unsigned16_t GetFormatIndex(void);
format_number_t GetFormat(void);
/* Horizontal Align option wrappers*/
void SetHAlign(halign_option_t ha_option);
unsigned8_t GetHAlign(void);
/* Vertical Align option wrappers*/
void SetVAlign(valign_option_t va_option);
unsigned8_t GetVAlign(void);
/* Vertical Align option wrappers*/
void SetIndent(indent_option_t indent_option);
unsigned8_t GetIndent(void);
/* Text orientation option wrappers*/
void SetTxtOrientation(txtori_option_t ori_option);
unsigned8_t GetTxtOrientation(void);
/* Fill Foreground color option wrappers*/
void SetFillFGColor(color_name_t color);
unsigned8_t GetFillFGColor(void);
/* Fill Background color option wrappers*/
void SetFillBGColor(color_name_t color);
unsigned8_t GetFillBGColor(void);
/* Fill Style option wrappers*/
void SetFillStyle(fill_option_t fill);
unsigned8_t GetFillStyle(void);
/* Locked option wrappers*/
void SetLocked(bool locked_opt);
bool IsLocked(void);
/* Hidden option wrappers*/
void SetHidden(bool hidden_opt);
bool IsHidden(void);
/* Wrap option wrappers*/
void SetWrap(bool wrap_opt);
bool IsWrap(void);
/* Cell option wrappers*/
void SetCellMode(bool cellmode);
bool IsCell(void);
/* Cell option wrappers*/
void SetBorderStyle(border_side_t side,
border_style_t style,
color_name_t color);
unsigned8_t GetBorderStyle(border_side_t side);
unsigned8_t GetBorderColor(border_side_t side);
unsigned32_t GetSignature();
void operator=(xf_t& right) ;
private:
// Lookup tables for options
static const unsigned8_t HALIGN_OPTIONS_TABLE[];
static const unsigned8_t VALIGN_OPTIONS_TABLE[];
static const unsigned8_t INDENT_OPTIONS_TABLE[];
static const unsigned8_t TXTORI_OPTIONS_TABLE[];
static const unsigned8_t COLOR_OPTIONS_TABLE[];
static const unsigned8_t FILL_OPTIONS_TABLE[];
static const unsigned8_t BORDERSTYLE_OPTIONS_TABLE[];
static const unsigned16_t FORMAT_NUM_OPTIONS_TABLE[];
void UpdateSignature();
private:
unsigned16_t m_usage_counter;
unsigned16_t index;
font_t* font;
format_number_t format;
unsigned8_t halign;
unsigned8_t valign;
unsigned8_t indent;
unsigned8_t txtorientation;
unsigned8_t fill_fgcolor;
unsigned8_t fill_bgcolor;
unsigned8_t fillstyle;
bool locked;
bool hidden;
bool wrap;
bool is_cell;
unsigned8_t top_border_style;
unsigned8_t top_border_color;
unsigned8_t bottom_border_style;
unsigned8_t bottom_border_color;
unsigned8_t left_border_style;
unsigned8_t left_border_color;
unsigned8_t right_border_style;
unsigned8_t right_border_color;
unsigned32_t m_signature;
bool m_sigchanged;
};
class xfbysig
{
public:
bool operator()(xf_t* a, xf_t* b) const
{
return (a->GetSignature() < b->GetSignature() ? true : false ); // DFH
};
};
typedef std::set<xlslib_core::xf_t*, xfbysig XLSLIB_DFLT_ALLOCATOR> XF_Set_t;
typedef XF_Set_t::iterator XF_Set_Itor_t;
typedef std::list<xlslib_core::xf_t* XLSLIB_DFLT_ALLOCATOR> XF_List_t;
typedef XF_List_t::iterator XF_List_Itor_t;
class CExtFormat: public CRecord
{
private:
void SetFlag(unsigned16_t flag);
void ClearFlag(unsigned16_t flag);
void InitDummy(bool is_cell);
public:
CExtFormat(bool is_cell = false);
CExtFormat(xf_t* xfdef);
~CExtFormat();
bool IsCell();
int SetFontIndex(unsigned16_t fontindex);
unsigned16_t GetFontIndex(void);
int SetFormatIndex(unsigned16_t formatindex);
unsigned16_t GetFormatIndex(void);
void SetLocked();
void SetHidden();
void SetHorizAlign(unsigned8_t alignval);
void SetWrap();
#if VERSION_BIFF == VERSION_BIFF8
void SetIndent(unsigned8_t indentval);
#endif
void SetVertAlign(unsigned8_t alignval);
void SetTxtOrientation(unsigned8_t alignval);
void SetFGColorIndex(unsigned8_t color);
void SetBGColorIndex(unsigned8_t color);
void SetFillPattern(unsigned8_t color);
void SetBorder(border_side_t border, unsigned16_t style, unsigned16_t color);
void SetXFParent(unsigned16_t parent);
};
}
#endif //EXTFORMAT_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: extformat.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:46 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

667
uppdev/XLS/font.cpp Normal file
View file

@ -0,0 +1,667 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/font.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/font.h>
#include <XLS/crc.h>
using namespace std;
using namespace xlslib_core;
/*
**********************************
CFont class implementation
**********************************
*/
CFont::CFont(string name,
unsigned16_t height,
unsigned16_t boldstyle,
unsigned8_t underline,
unsigned16_t script,
unsigned16_t color,
unsigned16_t attributes,
unsigned8_t family,
unsigned8_t charset)
{
SetRecordType(RECTYPE_FONT);
AddValue16(height);
AddValue16(attributes);
AddValue16(color);
AddValue16(boldstyle);
AddValue16(script);
AddValue8(underline);
AddValue8(family);
AddValue8(charset);
AddValue8(FONT_RESERVED);
#if VERSION_BIFF == VERSION_BIFF5
AddValue8((unsigned8_t)name.size());
AddDataArray((const unsigned8_t*)name.c_str(), name.size());
#else
AddUnicodeStrlen((unsigned8_t)name.size());
AddUnicodeString((const unsigned8_t*)name.c_str(), name.size());
#endif
SetRecordLength(GetDataSize()-4);
}
CFont::CFont(font_t* fontdef)
{
SetRecordType(RECTYPE_FONT);
AddValue16(fontdef->GetHeight());
AddValue16(fontdef->GetAttributes());
AddValue16(fontdef->GetColor());
AddValue16(fontdef->GetBoldStyle());
AddValue16(fontdef->GetScriptStyle());
AddValue8(fontdef->GetUnderlineStyle());
AddValue8(fontdef->GetFamily());
AddValue8(fontdef->GetCharset());
AddValue8(FONT_RESERVED);
#if VERSION_BIFF == VERSION_BIFF5
AddValue8((unsigned8_t)((fontdef->GetName()).size()));
AddDataArray((const unsigned8_t*)((fontdef->GetName()).c_str()),
(fontdef->GetName()).size());
#else
AddUnicodeStrlen((unsigned8_t)((fontdef->GetName()).size()));
AddUnicodeString((const unsigned8_t*)((fontdef->GetName()).c_str()),
(fontdef->GetName()).size());
#endif
SetRecordLength(GetDataSize()-4);
}
CFont::~CFont()
{
}
/*
**********************************
**********************************
*/
int CFont::SetName(string& name)
{
int errcode = NO_ERRORS;
name = name;
/*
NOTE: Unimplemented.
Temporarilly this function won't set the name
*/
return errcode;
}
/*
**********************************
**********************************
*/
int CFont::GetName(string& name)
{
int errcode = NO_ERRORS;
signed16_t namesize;
GetValue16From(&namesize, FONT_OFFSET_NAMELENGTH);
name = "";
for(int i=0; i<namesize; i++)
name += operator[](FONT_OFFSET_NAME+i);
return errcode;
}
/*
**********************************
**********************************
*/
int CFont::SetBoldValue(unsigned16_t boldstyle)
{
return (SetValueAt((signed16_t)boldstyle, FONT_OFFSET_BOLDSTYLE));
}
/*
**********************************
**********************************
*/
unsigned16_t CFont::GetBoldValue(void)
{
unsigned16_t boldstyleval;
GetValue16From((signed16_t*)&boldstyleval, FONT_OFFSET_BOLDSTYLE);
return(boldstyleval);
}
/*
**********************************
**********************************
*/
int CFont::SetUnderlineStyle(unsigned8_t ul)
{
return (SetAt(ul, FONT_OFFSET_UNDERLINE));
}
/*
**********************************
**********************************
*/
unsigned8_t CFont::GetUnderlineStyle(void)
{
unsigned8_t ulval;
GetAt((signed8_t*)&ulval, FONT_OFFSET_UNDERLINE);
return(ulval);
}
/*
**********************************
**********************************
*/
int CFont::SetScriptStyle(unsigned16_t script)
{
return (SetValueAt((signed16_t)script, FONT_OFFSET_SCRIPT));
}
/*
**********************************
**********************************
*/
unsigned16_t CFont::GetScriptStyle(void)
{
unsigned16_t scriptval;
GetValue16From((signed16_t*)&scriptval, FONT_OFFSET_SCRIPT);
return(scriptval);
}
/*
**********************************
**********************************
*/
int CFont::SetColorIndex(unsigned16_t color)
{
return (SetValueAt((signed16_t)color, FONT_OFFSET_PALETTE));
}
/*
**********************************
**********************************
*/
unsigned16_t CFont::GetColorIndex(void)
{
unsigned16_t colorval;
GetValue16From((signed16_t*)&colorval, FONT_OFFSET_PALETTE);
return(colorval);
}
/*
**********************************
**********************************
*/
int CFont::SetAttributes(unsigned16_t attr)
{
return (SetValueAt((signed16_t)attr, FONT_OFFSET_ATTRIBUTES));
}
/*
**********************************
**********************************
*/
unsigned16_t CFont::GetAttributes(void)
{
unsigned16_t attrval;
GetValue16From((signed16_t*)&attrval, FONT_OFFSET_ATTRIBUTES);
return(attrval);
}
/*
**********************************
**********************************
*/
int CFont::SetFamily(unsigned8_t family)
{
return (SetAt(family, FONT_OFFSET_FAMILY));
}
/*
**********************************
**********************************
*/
unsigned8_t CFont::GetFamily(void)
{
unsigned8_t familyval;
GetAt((signed8_t*)&
familyval, FONT_OFFSET_FAMILY);
return(familyval);
}
/*
**********************************
**********************************
*/
int CFont::SetCharSet(unsigned8_t charset)
{
return (SetAt(charset, FONT_OFFSET_CHARSET));
}
/*
**********************************
**********************************
*/
unsigned8_t CFont::GetCharSet(void)
{
unsigned8_t charsetval;
GetAt((signed8_t*)&charsetval, FONT_OFFSET_CHARSET);
return(charsetval);
}
/*
**********************************
font_t class implementation
**********************************
*/
const unsigned16_t font_t::BOLD_OPTION_TABLE[] = {
FONT_BOLDNESS_BOLD,
FONT_BOLDNESS_HALF,
FONT_BOLDNESS_NORMAL,
FONT_BOLDNESS_DOUBLE
};
const unsigned16_t font_t::SCRIPT_OPTION_TABLE[] = {
FONT_SCRIPT_NONE,
FONT_SCRIPT_SUPER,
FONT_SCRIPT_SUB
};
const unsigned8_t font_t::UNDERLINE_OPTION_TABLE[] = {
FONT_UNDERLINE_NONE,
FONT_UNDERLINE_SINGLE,
FONT_UNDERLINE_DOUBLE,
FONT_UNDERLINE_SINGLEACC,
FONT_UNDERLINE_DOUBLEACC
};
const unsigned16_t font_t::COLOR_OPTION_TABLE[] = {
FONT_COLOR_CODE_BLACK,
FONT_COLOR_CODE_DARK_RED,
FONT_COLOR_CODE_RED,
FONT_COLOR_CODE_FUCSIA,
FONT_COLOR_CODE_COMBINED01,
FONT_COLOR_CODE_COMBINED02,
FONT_COLOR_CODE_COMBINED03,
FONT_COLOR_CODE_COMBINED04,
FONT_COLOR_CODE_COMBINED05,
FONT_COLOR_CODE_COMBINED06,
FONT_COLOR_CODE_OLIVE,
FONT_COLOR_CODE_DARK_YELLOW,
FONT_COLOR_CODE_COMBINED07,
FONT_COLOR_CODE_YELLOW,
FONT_COLOR_CODE_LIGHT_YELLOW,
FONT_COLOR_CODE_DARK_GREEN,
FONT_COLOR_CODE_GREEN,
FONT_COLOR_CODE_COMBINED08,
FONT_COLOR_CODE_LIVING_GREEN,
FONT_COLOR_CODE_LIGHT_GREEN,
FONT_COLOR_CODE_COMBINED09,
FONT_COLOR_CODE_BLUE_GREEN,
FONT_COLOR_CODE_AQUAMARINA,
FONT_COLOR_CODE_TURQOISE,
FONT_COLOR_CODE_COMBINED10,
FONT_COLOR_CODE_DARK_BLUE,
FONT_COLOR_CODE_BLUE,
FONT_COLOR_CODE_LIGHT_BLUE,
FONT_COLOR_CODE_SKY_BLUE,
FONT_COLOR_CODE_COMBINED11,
FONT_COLOR_CODE_INDIGO,
FONT_COLOR_CODE_BLUE_GRAY,
FONT_COLOR_CODE_VIOLET,
FONT_COLOR_CODE_PLUM,
FONT_COLOR_CODE_LAVANDER,
FONT_COLOR_CODE_COMBINED12,
FONT_COLOR_CODE_GRAY50,
FONT_COLOR_CODE_GRAY40,
FONT_COLOR_CODE_GRAY25,
FONT_COLOR_CODE_WHITE
};
font_t::font_t() :
index(0x0000),
name(FONT_DFLT_FONTNAME),
height(FONT_DFLT_HEIGHT),
boldstyle(FONT_BOLDNESS_NORMAL),
underline(FONT_UNDERLINE_NONE),
script(FONT_SCRIPT_NONE),
color(FONT_DFLT_PALETTE),
attributes(FONT_DFLT_ATTRIBUTES),
family(FONT_DFLT_FAMILY),
charset(FONT_DFLT_CHARSET),
m_usage_counter(0)
{
UpdateSignature();
}
font_t::font_t(unsigned16_t index,
string name,
unsigned16_t height,
boldness_option_t boldstyle,
underline_option_t underline,
script_option_t script,
color_name_t color,
unsigned16_t attributes,
unsigned8_t family,
unsigned8_t charset)
: m_usage_counter(0)
{
SetIndex(index);
SetName(name);
SetHeight(height);
SetBoldStyle(boldstyle);
SetUnderlineStyle(underline);
SetScriptStyle(script);
SetColor(color);
SetAttributes(attributes);
SetFamily(family);
SetCharset(charset);
UpdateSignature();
}
font_t::font_t(const font_init_t& fontinit)
: m_usage_counter(0)
{
SetIndex(fontinit.index);
SetName(fontinit.name);
SetHeight(fontinit.height);
SetBoldStyle(fontinit.boldstyle);
SetUnderlineStyle(fontinit.underline);
SetScriptStyle(fontinit.script);
SetColor(fontinit.color);
SetAttributes(fontinit.attributes);
SetFamily(fontinit.family);
SetCharset(fontinit.charset);
UpdateSignature();
}
void font_t::operator=(font_t& right)
{
index = 0x0000;
name = right.name ;
height = right.height ;
boldstyle = right.boldstyle ;
underline = right.underline ;
script = right.script ;
color = right.color ;
attributes = right.attributes;
family = right.family ;
charset = right.charset ;
m_sigchanged = true;
}
void font_t::UpdateSignature()
{
crc xfcrc;
xfcrc<<index;
xfcrc<<name;
xfcrc<<height;
xfcrc<<boldstyle;
xfcrc<<underline;
xfcrc<<script;
xfcrc<<color;
xfcrc<<attributes;
xfcrc<<family;
xfcrc<<charset;
m_signature = xfcrc.get();
m_sigchanged = false;
}
unsigned32_t font_t::GetSignature()
{
if(m_sigchanged)
{
UpdateSignature();
m_sigchanged = false;
}
return m_signature;
}
void font_t::MarkUsed()
{
m_usage_counter++;
}
bool font_t::IsUsed()
{
return(m_usage_counter != 0);
}
void font_t::SetItalic(bool italic) {
if(italic)
attributes |= FONT_ATTR_ITALIC;
else
attributes &= (~FONT_ATTR_ITALIC);
m_sigchanged = true;
}
void font_t::SetStrikeout(bool so) {
if(so)
attributes |= FONT_ATTR_STRIKEOUT;
else
attributes &= (~FONT_ATTR_STRIKEOUT);
m_sigchanged = true;
}
// Machintoch only
void font_t::SetOutline(bool ol) {
if(ol)
attributes |= FONT_ATTR_OUTLINEMACH;
else
attributes &= (~FONT_ATTR_OUTLINEMACH);
m_sigchanged = true;
}
// OSX (Mac) only
void font_t::SetShadow(bool sh) {
if(sh)
attributes |= FONT_ATTR_SHADOWMACH;
else
attributes &= (~FONT_ATTR_SHADOWMACH);
m_sigchanged = true;
}
/* FONT Index wrappers*/
void font_t::SetIndex(unsigned16_t fntidx)
{
index = fntidx;
m_sigchanged = true;
}
unsigned16_t font_t::GetIndex(void)
{
return index;
}
/* FONT Index wrappers*/
void font_t::SetName(string fntname)
{
name = fntname;
m_sigchanged = true;
}
string font_t::GetName(void)
{
return name;
}
/* FONT height wrappers*/
void font_t::SetHeight(unsigned16_t fntheight)
{
height = fntheight;
m_sigchanged = true;
}
unsigned16_t font_t::GetHeight(void)
{
return height;
}
/* FONT boldstyle wrappers*/
void font_t::SetBoldStyle(boldness_option_t fntboldness)
{
boldstyle = font_t::BOLD_OPTION_TABLE[fntboldness];
m_sigchanged = true;
}
unsigned16_t font_t::GetBoldStyle(void)
{
return boldstyle;
}
/* FONT underline wrappers*/
void font_t::SetUnderlineStyle(underline_option_t fntunderline)
{
underline = font_t::UNDERLINE_OPTION_TABLE[fntunderline];
m_sigchanged = true;
}
unsigned8_t font_t::GetUnderlineStyle(void)
{
return underline;
}
/* FONT script wrappers*/
void font_t::SetScriptStyle(script_option_t fntscript)
{
script = font_t::SCRIPT_OPTION_TABLE[fntscript];
m_sigchanged = true;
}
unsigned16_t font_t::GetScriptStyle(void)
{
return script;
}
/* FONT script wrappers*/
void font_t::SetColor(color_name_t fntcolor)
{
color = font_t::COLOR_OPTION_TABLE[fntcolor];
m_sigchanged = true;
}
unsigned16_t font_t::GetColor(void)
{
return color;
}
/* FONT attributes wrappers */
void font_t::SetAttributes(unsigned16_t attr)
{
attributes = attr;
m_sigchanged = true;
}
unsigned16_t font_t::GetAttributes(void)
{
return attributes;
}
// Miscellaneous;
void font_t::SetFamily(unsigned8_t fam)
{
family = fam;
m_sigchanged = true;
}
unsigned8_t font_t::GetFamily(void)
{
return family;
}
void font_t::SetCharset(unsigned8_t chrset)
{
charset = chrset;
m_sigchanged = true;
}
unsigned8_t font_t::GetCharset(void)
{
return charset;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: font.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:52 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

441
uppdev/XLS/font.h Normal file
View file

@ -0,0 +1,441 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/font.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef FONT_H
#define FONT_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/rectypes.h>
#include <XLS/record.h>
#include <XLS/colors.h>
namespace xlslib_core
{
// Bold style most used values
// (it can be a number of some range. See Documentation for details):
#define FONT_BOLDNESS_BOLD ((unsigned16_t)0x02bc)
#define FONT_BOLDNESS_HALF ((unsigned16_t)0x0226)
#define FONT_BOLDNESS_NORMAL ((unsigned16_t)0x0190)
#define FONT_BOLDNESS_DOUBLE ((unsigned16_t)0x0320)
typedef enum
{
BOLDNESS_BOLD = 0,
BOLDNESS_HALF,
BOLDNESS_NORMAL,
BOLDNESS_DOUBLE
} boldness_option_t;
// Super/subscript field option values
#define FONT_SCRIPT_NONE ((unsigned16_t)0x0000)
#define FONT_SCRIPT_SUPER ((unsigned16_t)0x0001)
#define FONT_SCRIPT_SUB ((unsigned16_t)0x0002)
typedef enum
{
SCRIPT_NONE = 0,
SCRIPT_SUPER,
SCRIPT_SUB
} script_option_t;
// Underline field option values:
#define FONT_UNDERLINE_NONE ((unsigned8_t)0x00)
#define FONT_UNDERLINE_SINGLE ((unsigned8_t)0x01)
#define FONT_UNDERLINE_DOUBLE ((unsigned8_t)0x02)
#define FONT_UNDERLINE_SINGLEACC ((unsigned8_t)0x21)
#define FONT_UNDERLINE_DOUBLEACC ((unsigned8_t)0x22)
typedef enum
{
UNDERLINE_NONE = 0,
UNDERLINE_SINGLE,
UNDERLINE_DOUBLE,
UNDERLINE_SINGLEACC,
UNDERLINE_DOUBLEACC
} underline_option_t;
// The following are default values used when the font's
// constructor is called without args:
#define FONT_DFLT_FAMILY ((unsigned8_t)0x00)
#define FONT_DFLT_CHARSET ((unsigned8_t)0x00)
#define FONT_DFLT_HEIGHT ((unsigned16_t)0x00c8)
#define FONT_DFLT_ATTRIBUTES ((unsigned16_t)0x0000)
#define FONT_DFLT_PALETTE ((unsigned16_t)0x7fff)
#define FONT_DFLT_FONTNAME ((std::string)"Arial")
#define FONT_RESERVED ((unsigned8_t)0x00)
// The font-record field offsets:
#define FONT_OFFSET_HEIGHT ((unsigned32_t) 4)
#define FONT_OFFSET_ATTRIBUTES ((unsigned32_t) 6)
#define FONT_OFFSET_PALETTE ((unsigned32_t) 8)
#define FONT_OFFSET_BOLDSTYLE ((unsigned32_t)10)
#define FONT_OFFSET_SCRIPT ((unsigned32_t)12)
#define FONT_OFFSET_UNDERLINE ((unsigned32_t)14)
#define FONT_OFFSET_FAMILY ((unsigned32_t)15)
#define FONT_OFFSET_CHARSET ((unsigned32_t)16)
#define FONT_OFFSET_NAMELENGTH ((unsigned32_t)18)
#define FONT_OFFSET_NAME ((unsigned32_t)19)
// The attribute bit or-masks:
#define FONT_ATTR_RESERVED0 ((unsigned16_t)0x0001)
#define FONT_ATTR_ITALIC ((unsigned16_t)0x0002)
#define FONT_ATTR_RESERVED1 ((unsigned16_t)0x0004)
#define FONT_ATTR_STRIKEOUT ((unsigned16_t)0x0008)
#define FONT_ATTR_OUTLINEMACH ((unsigned16_t)0x0010)
#define FONT_ATTR_SHADOWMACH ((unsigned16_t)0x0020)
#define FONT_ATTR_RESERVED2 ((unsigned16_t)0x00c0)
#define FONT_ATTR_UNUSED ((unsigned16_t)0xff00)
// Font colors
#define FONT_COLOR_CODE_BLACK ((unsigned16_t)(COLOR_CODE_BLACK))
#define FONT_COLOR_CODE_DARK_RED ((unsigned16_t)(COLOR_CODE_DARK_RED))
#define FONT_COLOR_CODE_RED ((unsigned16_t)(COLOR_CODE_RED))
#define FONT_COLOR_CODE_FUCSIA ((unsigned16_t)(COLOR_CODE_FUCSIA))
#define FONT_COLOR_CODE_COMBINED01 ((unsigned16_t)(COLOR_CODE_COMBINED01))
#define FONT_COLOR_CODE_COMBINED02 ((unsigned16_t)(COLOR_CODE_COMBINED02))
#define FONT_COLOR_CODE_COMBINED03 ((unsigned16_t)(COLOR_CODE_COMBINED03))
#define FONT_COLOR_CODE_COMBINED04 ((unsigned16_t)(COLOR_CODE_COMBINED04))
#define FONT_COLOR_CODE_COMBINED05 ((unsigned16_t)(COLOR_CODE_COMBINED05))
#define FONT_COLOR_CODE_COMBINED06 ((unsigned16_t)(COLOR_CODE_COMBINED06))
#define FONT_COLOR_CODE_OLIVE ((unsigned16_t)(COLOR_CODE_OLIVE))
#define FONT_COLOR_CODE_DARK_YELLOW ((unsigned16_t)(COLOR_CODE_DARK_YELLOW))
#define FONT_COLOR_CODE_COMBINED07 ((unsigned16_t)(COLOR_CODE_COMBINED07))
#define FONT_COLOR_CODE_YELLOW ((unsigned16_t)(COLOR_CODE_YELLOW))
#define FONT_COLOR_CODE_LIGHT_YELLOW ((unsigned16_t)(COLOR_CODE_LIGHT_YELLOW))
#define FONT_COLOR_CODE_DARK_GREEN ((unsigned16_t)(COLOR_CODE_DARK_GREEN))
#define FONT_COLOR_CODE_GREEN ((unsigned16_t)(COLOR_CODE_GREEN))
#define FONT_COLOR_CODE_COMBINED08 ((unsigned16_t)(COLOR_CODE_COMBINED08))
#define FONT_COLOR_CODE_LIVING_GREEN ((unsigned16_t)(COLOR_CODE_LIVING_GREEN))
#define FONT_COLOR_CODE_LIGHT_GREEN ((unsigned16_t)(COLOR_CODE_LIGHT_GREEN))
#define FONT_COLOR_CODE_COMBINED09 ((unsigned16_t)(COLOR_CODE_COMBINED09))
#define FONT_COLOR_CODE_BLUE_GREEN ((unsigned16_t)(COLOR_CODE_BLUE_GREEN))
#define FONT_COLOR_CODE_AQUAMARINA ((unsigned16_t)(COLOR_CODE_AQUAMARINA))
#define FONT_COLOR_CODE_TURQOISE ((unsigned16_t)(COLOR_CODE_TURQOISE))
#define FONT_COLOR_CODE_COMBINED10 ((unsigned16_t)(COLOR_CODE_COMBINED10))
#define FONT_COLOR_CODE_DARK_BLUE ((unsigned16_t)(COLOR_CODE_DARK_BLUE))
#define FONT_COLOR_CODE_BLUE ((unsigned16_t)(COLOR_CODE_BLUE))
#define FONT_COLOR_CODE_LIGHT_BLUE ((unsigned16_t)(COLOR_CODE_LIGHT_BLUE))
#define FONT_COLOR_CODE_SKY_BLUE ((unsigned16_t)(COLOR_CODE_SKY_BLUE))
#define FONT_COLOR_CODE_COMBINED11 ((unsigned16_t)(COLOR_CODE_COMBINED11))
#define FONT_COLOR_CODE_INDIGO ((unsigned16_t)(COLOR_CODE_INDIGO))
#define FONT_COLOR_CODE_BLUE_GRAY ((unsigned16_t)(COLOR_CODE_BLUE_GRAY))
#define FONT_COLOR_CODE_VIOLET ((unsigned16_t)(COLOR_CODE_VIOLET))
#define FONT_COLOR_CODE_PLUM ((unsigned16_t)(COLOR_CODE_PLUM))
#define FONT_COLOR_CODE_LAVANDER ((unsigned16_t)(COLOR_CODE_LAVANDER))
#define FONT_COLOR_CODE_COMBINED12 ((unsigned16_t)(COLOR_CODE_COMBINED12))
#define FONT_COLOR_CODE_GRAY50 ((unsigned16_t)(COLOR_CODE_GRAY50))
#define FONT_COLOR_CODE_GRAY40 ((unsigned16_t)(COLOR_CODE_GRAY40))
#define FONT_COLOR_CODE_GRAY25 ((unsigned16_t)(COLOR_CODE_GRAY25))
#define FONT_COLOR_CODE_WHITE ((unsigned16_t)(COLOR_CODE_WHITE))
/*
******************************
CFont class declaration
******************************
*/
typedef struct
{
unsigned16_t index;
std::string name;
unsigned16_t height;
boldness_option_t boldstyle;
underline_option_t underline;
script_option_t script;
color_name_t color;
unsigned16_t attributes;
unsigned8_t family;
unsigned8_t charset;
} font_init_t;
struct font_i
{
virtual void fontname(std::string fntname) = 0;
virtual void fontheight(unsigned16_t fntheight) = 0;
virtual void fontbold(boldness_option_t fntboldness) = 0;
virtual void fontunderline(underline_option_t fntunderline) = 0;
virtual void fontscript(script_option_t fntscript) = 0;
virtual void fontcolor(color_name_t fntcolor) = 0;
virtual void fontattr(unsigned16_t attr) = 0;
virtual void fontitalic(bool italic) = 0;
virtual void fontstrikeout(bool so) = 0;
virtual void fontoutline(bool ol) = 0;
virtual void fontshadow(bool sh) = 0;
};
class font_t
{
public:
font_t();
font_t(unsigned16_t index, std::string name,
unsigned16_t height, boldness_option_t boldstyle,
underline_option_t underline, script_option_t script,
color_name_t color, unsigned16_t attributes,
unsigned8_t family, unsigned8_t charset);
font_t(const font_init_t& fontinit);
virtual ~font_t() {};
void MarkUsed();
bool IsUsed();
unsigned16_t Usage(){return m_usage_counter;};
/* FONT Index wrappers*/
void SetIndex(unsigned16_t fntidx);
unsigned16_t GetIndex(void);
/* FONT Index wrappers*/
void SetName(std::string fntname);
std::string GetName(void);
/* FONT height wrappers*/
void SetHeight(unsigned16_t fntheight);
unsigned16_t GetHeight(void);
/* FONT boldstyle wrappers*/
void SetBoldStyle(boldness_option_t fntboldness);
unsigned16_t GetBoldStyle(void);
/* FONT underline wrappers*/
void SetUnderlineStyle(underline_option_t fntunderline);
unsigned8_t GetUnderlineStyle(void);
/* FONT script wrappers*/
void SetScriptStyle(script_option_t fntscript);
unsigned16_t GetScriptStyle(void);
/* FONT script wrappers*/
void SetColor(color_name_t fntcolor);
unsigned16_t GetColor(void);
void SetItalic(bool italic);
void SetStrikeout(bool so);
/* FONT attributes wrappers */
void SetAttributes(unsigned16_t attr);
unsigned16_t GetAttributes(void);
// OSX only
void SetOutline(bool ol);
void SetShadow(bool sh);
// Miscellaneous;
void SetFamily(unsigned8_t fam);
unsigned8_t GetFamily(void);
void SetCharset(unsigned8_t chrset);
unsigned8_t GetCharset(void);
unsigned32_t GetSignature();
void operator=(font_t& right);
private:
unsigned16_t index;
std::string name;
unsigned16_t height;
unsigned16_t boldstyle;
unsigned8_t underline;
unsigned16_t script;
unsigned16_t color;
unsigned16_t attributes;
unsigned8_t family;
unsigned8_t charset;
unsigned16_t m_usage_counter;
void UpdateSignature();
unsigned32_t m_signature;
bool m_sigchanged;
static const unsigned16_t BOLD_OPTION_TABLE[];
static const unsigned16_t SCRIPT_OPTION_TABLE[];
static const unsigned8_t UNDERLINE_OPTION_TABLE[];
static const unsigned16_t COLOR_OPTION_TABLE[];
};
class fontbysig
{
public:
bool operator()(font_t* a, font_t* b) const
{
return (a->GetSignature() < b->GetSignature() ? true : false );
};
};
typedef std::set<xlslib_core::font_t*,fontbysig XLSLIB_DFLT_ALLOCATOR> Font_Set_t;
typedef Font_Set_t::iterator Font_Set_Itor_t;
typedef std::list<xlslib_core::font_t* XLSLIB_DFLT_ALLOCATOR> Font_List_t;
typedef Font_List_t::iterator Font_List_Itor_t;
class CFont: public CRecord
{
protected:
public:
CFont(std::string name = FONT_DFLT_FONTNAME,
unsigned16_t height = FONT_DFLT_HEIGHT,
unsigned16_t boldstyle = FONT_BOLDNESS_NORMAL,
unsigned8_t underline = FONT_UNDERLINE_NONE,
unsigned16_t script = FONT_SCRIPT_NONE,
unsigned16_t color = FONT_DFLT_PALETTE,
unsigned16_t attributes = FONT_DFLT_ATTRIBUTES,
unsigned8_t family = FONT_DFLT_FAMILY,
unsigned8_t charset = FONT_DFLT_CHARSET );
CFont(font_t* fontdef);
~CFont();
int SetName(std::string& name);
int GetName(std::string& name);
int SetBoldValue(unsigned16_t boldstyle);
unsigned16_t GetBoldValue(void);
int SetUnderlineStyle(unsigned8_t ul);
unsigned8_t GetUnderlineStyle(void);
int SetScriptStyle(unsigned16_t script);
unsigned16_t GetScriptStyle(void);
int SetColorIndex(unsigned16_t color);
unsigned16_t GetColorIndex(void);
int SetAttributes(unsigned16_t attr);
unsigned16_t GetAttributes(void);
int SetFamily(unsigned8_t family);
unsigned8_t GetFamily(void);
int SetCharSet(unsigned8_t charset);
unsigned8_t GetCharSet(void);
};
}
#endif //FONT_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: font.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:46 darioglz
* Initial Import.
*
* Revision 1.17 2004/04/06 22:35:43 dgonzalez
* + Added namespace xlslib_core to isolate the core xlslib library names.
*
* Revision 1.16 2004/04/06 15:10:24 dgonzalez
* + Added keys to generate distributable headers
*
* Revision 1.15 2004/01/29 03:18:55 dgonzalez
* + Using the config.h file
*
* Revision 1.14 2004/01/15 17:17:31 dgonzalez
* + The memory allocator used by STL-containers is defined #conditionally.
*
* Revision 1.13 2003/12/09 19:04:21 dgonzalez
* + Not a real difference
*
* Revision 1.12 2003/12/05 01:18:27 dgonzalez
* + Common include files were placed in common.h (and this file was
* included instead.
* + The font_interface was redefined to something lighter. Due name
* clashing with xf_i when these interfaces were defined as parent of
* cell_t.
* + Signature was implemented to font_t. Any interface function that modi
* fies any data member of the class set a flag for later signature
* update. The signature is CRC based and is used to uniquify font_t
* instances inside an stl-set-container.
* + The fontbysig functor was added for being used in the set container
* as a sorting criteria. It is based on the signature.
* + The stl-set-container of pointers to font_t* typedef was defined here.
*
* Revision 1.11 2003/11/29 17:53:49 dgonzalez
* + The larger functions were uninlined.
* + The virtual pure interface font_i was defined
*
* Revision 1.10 2003/11/28 01:31:30 dgonzalez
* + The MarkUsed functionality was added (similar to xf_t)
*
* Revision 1.9 2003/11/26 16:49:26 dgonzalez
* + Indented and untabified
*
* Revision 1.8 2003/11/04 17:07:58 dgonzalez
* + Changed the initialization of CGlobalRecord's defaults for compatibility with
* MSVC++. The original code was left commented out for future use.
*
* Revision 1.7 2003/11/04 01:04:42 dgonzalez
* + All the list containers changed to manage pointers.
* + Valgrind utility reports 960 posible memory leaks. TODO: Verify it
*
* Revision 1.6 2003/11/03 16:58:56 dgonzalez
* + The following typedefed enums were added to improve typechecking in the font
* definition:
* - boldness_option_t
* - script_option_t
* - underline_option_t
* + Font colors were defined based in the color codes defined in the module colors.h.
* + font_t is now implemented as a class. A full set of wrapper functions were implemented
* inline for Get/Set font properties.
* + font_init_t struct was added for storing initialization values of default font of a
* document.
* + The following lookup tables were added to retrieve the field's options used for setting
* the font's values.
*
* Revision 1.5 2003/10/24 23:24:32 dgonzalez
* + Added CVS-Keyword substitution.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

141
uppdev/XLS/format.cpp Normal file
View file

@ -0,0 +1,141 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/format.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/format.h>
using namespace std;
using namespace xlslib_core;
/*
**********************************
CFormat class implementation
**********************************
*/
CFormat::CFormat(string& formatstr,
unsigned16_t index)
{
SetRecordType(RECTYPE_FORMAT);
AddValue16(index);
#if VERSION_BIFF == VERSION_BIFF5
AddValue8((unsigned8_t)formatstr.size());
AddDataArray((unsigned8_t*)formatstr.c_str(), formatstr.size());
#else
AddUnicodeStrlen((unsigned16_t)formatstr.size());
AddUnicodeString((unsigned8_t*)formatstr.c_str(), formatstr.size());
#endif
SetRecordLength(GetDataSize()-4);
}
CFormat::CFormat(format_t* formatdef)
{
SetRecordType(RECTYPE_FORMAT);
AddValue16(formatdef->GetIndex());
#if VERSION_BIFF == VERSION_BIFF5
AddValue8((unsigned8_t)((formatdef->GetFormatStr()).size()));
AddDataArray((unsigned8_t*)((formatdef->GetFormatStr()).c_str()),
(formatdef->GetFormatStr()).size());
#else
AddUnicodeStrlen((unsigned16_t)((formatdef->GetFormatStr()).size()));
AddUnicodeString((unsigned8_t*)((formatdef->GetFormatStr()).c_str()),
(formatdef->GetFormatStr()).size());
#endif
SetRecordLength(GetDataSize()-4);
}
CFormat::~CFormat()
{
}
/*
**********************************
**********************************
*/
/*
**********************************
**********************************
*/
int CFormat::GetFormatStr(string& formatstr)
{
int errcode = NO_ERRORS;
signed16_t formatsize;
GetValue16From(&formatsize, FORMAT_OFFSET_NAMELENGTH);
formatstr = "";
for(int i=0; i<formatsize; i++)
formatstr += operator[](FORMAT_OFFSET_NAME+i);
return errcode;
}
/*
**********************************
**********************************
*/
int CFormat::SetIndex(unsigned16_t index)
{
return (SetValueAt((signed16_t)index, FORMAT_OFFSET_INDEX));
}
/*
**********************************
**********************************
*/
unsigned16_t CFormat::GetIndex(void)
{
unsigned16_t indexval;
GetValue16From((signed16_t*)&indexval, FORMAT_OFFSET_INDEX);
return(indexval);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: format.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:48 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

202
uppdev/XLS/format.h Normal file
View file

@ -0,0 +1,202 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/format.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef FORMAT_H
#define FORMAT_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/rectypes.h>
#include <XLS/record.h>
namespace xlslib_core
{
// The font-record field offsets:
#define FORMAT_OFFSET_INDEX ((unsigned32_t) 4)
#define FORMAT_OFFSET_NAMELENGTH ((unsigned32_t) 6)
#define FORMAT_OFFSET_NAME ((unsigned32_t) 7)
#define FMTCODE_GENERAL ((unsigned16_t)0x0000)
#define FMTCODE_NUMBER1 ((unsigned16_t)0x0001)
#define FMTCODE_NUMBER2 ((unsigned16_t)0x0002)
#define FMTCODE_NUMBER3 ((unsigned16_t)0x0003)
#define FMTCODE_NUMBER4 ((unsigned16_t)0x0004)
#define FMTCODE_CURRENCY1 ((unsigned16_t)0x0005)
#define FMTCODE_CURRENCY2 ((unsigned16_t)0x0006)
#define FMTCODE_CURRENCY3 ((unsigned16_t)0x0007)
#define FMTCODE_CURRENCY4 ((unsigned16_t)0x0008)
#define FMTCODE_PERCENT1 ((unsigned16_t)0x0009)
#define FMTCODE_PERCENT2 ((unsigned16_t)0x000a)
#define FMTCODE_SCIENTIFIC1 ((unsigned16_t)0x000b)
#define FMTCODE_FRACTION1 ((unsigned16_t)0x000c)
#define FMTCODE_FRACTION2 ((unsigned16_t)0x000d)
#define FMTCODE_DATE1 ((unsigned16_t)0x000e)
#define FMTCODE_DATE2 ((unsigned16_t)0x000f)
#define FMTCODE_DATE3 ((unsigned16_t)0x0010)
#define FMTCODE_DATE4 ((unsigned16_t)0x0011)
#define FMTCODE_HOUR1 ((unsigned16_t)0x0012)
#define FMTCODE_HOUR2 ((unsigned16_t)0x0013)
#define FMTCODE_HOUR3 ((unsigned16_t)0x0014)
#define FMTCODE_HOUR4 ((unsigned16_t)0x0015)
#define FMTCODE_HOURDATE ((unsigned16_t)0x0016)
#define FMTCODE_NUMBER5 ((unsigned16_t)0x0025)
#define FMTCODE_NUMBER6 ((unsigned16_t)0x0026)
#define FMTCODE_NUMBER7 ((unsigned16_t)0x0027)
#define FMTCODE_NUMBER8 ((unsigned16_t)0x0028)
#define FMTCODE_ACCOUNTING1 ((unsigned16_t)0x0029)
#define FMTCODE_ACCOUNTING2 ((unsigned16_t)0x002a)
#define FMTCODE_ACCOUNTING3 ((unsigned16_t)0x002b)
#define FMTCODE_ACCOUNTING4 ((unsigned16_t)0x002c)
#define FMTCODE_HOUR5 ((unsigned16_t)0x002d)
#define FMTCODE_HOUR6 ((unsigned16_t)0x002e)
#define FMTCODE_HOUR7 ((unsigned16_t)0x002f)
#define FMTCODE_SCIENTIFIC2 ((unsigned16_t)0x0030)
#define FMTCODE_TEXT ((unsigned16_t)0x0031)
typedef enum
{
FMT_GENERAL = 0,
FMT_NUMBER1,
FMT_NUMBER2,
FMT_NUMBER3,
FMT_NUMBER4,
FMT_CURRENCY1,
FMT_CURRENCY2,
FMT_CURRENCY3,
FMT_CURRENCY4,
FMT_PERCENT1,
FMT_PERCENT2,
FMT_SCIENTIFIC1,
FMT_FRACTION1,
FMT_FRACTION2,
FMT_DATE1,
FMT_DATE2,
FMT_DATE3,
FMT_DATE4,
FMT_HOUR1,
FMT_HOUR2,
FMT_HOUR3,
FMT_HOUR4,
FMT_HOURDATE,
FMT_NUMBER5,
FMT_NUMBER6,
FMT_NUMBER7,
FMT_NUMBER8,
FMT_ACCOUNTING1,
FMT_ACCOUNTING2,
FMT_ACCOUNTING3,
FMT_ACCOUNTING4,
FMT_HOUR5,
FMT_HOUR6,
FMT_HOUR7,
FMT_SCIENTIFIC2,
FMT_TEXT
} format_number_t;
/*
******************************
CFormat class declaration
******************************
*/
class format_t
{
public:
format_t(unsigned16_t idx, std::string fmtstr)
: index(idx), formatstr(fmtstr), m_usage_counter(0)
{};
~format_t(){};
unsigned16_t GetIndex(){return index;};
void SetIndex(unsigned16_t idx){index = idx;};
std::string& GetFormatStr(void) {return formatstr;};
void SetFormatStr(std::string& fmtstr) {formatstr = fmtstr;};
void MarkUsed() {m_usage_counter++;};
bool IsUsed() {return(m_usage_counter != 0);};
private:
unsigned16_t index;
std::string formatstr;
unsigned16_t m_usage_counter;
};
typedef std::list<xlslib_core::format_t* XLSLIB_DFLT_ALLOCATOR> Format_List_t;
typedef Format_List_t::iterator Format_List_Itor_t;
class CFormat: public CRecord
{
protected:
public:
CFormat(std::string& formatstr, unsigned16_t index);
CFormat(format_t* formatdef);
~CFormat();
int SetFormatStr(std::string& formatstr);
int GetFormatStr(std::string& formatstr);
int SetIndex(unsigned16_t index);
unsigned16_t GetIndex(void);
// int SetName(std::string& formatstr);
};
}
#endif //FORMAT_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: format.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:57 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

240
uppdev/XLS/formtags.h Normal file
View file

@ -0,0 +1,240 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/formtags.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/config.h>
/*
sed -e 's/^\([A-Za-z0-9]*\)$/#define FT_\1 \\/' biff_formula_tags_norm.txt | sed -e 's/^ \([A-F0-9]*\)\h$/ ((unsigned char)0x\1)/' | sed -e "s/^ \([oc].*\)//" > formtags.h
*/
#define FT_ptgExp \
((unsigned char)0x01)
#define FT_ptgTbl \
((unsigned char)0x02)
#define FT_ptgAdd \
((unsigned char)0x03)
#define FT_ptgSub \
((unsigned char)0x04)
#define FT_ptgMul \
((unsigned char)0x05)
#define FT_ptgDiv \
((unsigned char)0x06)
#define FT_ptgPower \
((unsigned char)0x07)
#define FT_ptgConcat \
((unsigned char)0x08)
#define FT_ptgLT \
((unsigned char)0x09)
#define FT_ptgLE \
((unsigned char)0x0A)
#define FT_ptgEQ \
((unsigned char)0x0B)
#define FT_ptgGE \
((unsigned char)0x0C)
#define FT_ptgGT \
((unsigned char)0x0D)
#define FT_ptgNE \
((unsigned char)0x0E)
#define FT_ptgIsect \
((unsigned char)0x0F)
#define FT_ptgUnion \
((unsigned char)0x10)
#define FT_ptgRange \
((unsigned char)0x11)
#define FT_ptgUplus \
((unsigned char)0x12)
#define FT_ptgUminus \
((unsigned char)0x13)
#define FT_ptgPercent \
((unsigned char)0x14)
#define FT_ptgParen \
((unsigned char)0x15)
#define FT_ptgMissArg \
((unsigned char)0x16)
#define FT_ptgStr \
((unsigned char)0x17)
#define FT_ptgAttr \
((unsigned char)0x19)
#define FT_ptgSheet \
((unsigned char)0x1A)
#define FT_ptgEndSheet \
((unsigned char)0x1B)
#define FT_ptgErr \
((unsigned char)0x1C)
#define FT_ptgBool \
((unsigned char)0x1D)
#define FT_ptgInt \
((unsigned char)0x1E)
#define FT_ptgNum \
((unsigned char)0x1F)
#define FT_ptgArray \
((unsigned char)0x20)
#define FT_ptgFunc \
((unsigned char)0x21)
#define FT_ptgFuncVar \
((unsigned char)0x22)
#define FT_ptgName \
((unsigned char)0x23)
#define FT_ptgRef \
((unsigned char)0x24)
#define FT_ptgArea \
((unsigned char)0x25)
#define FT_ptgMemArea \
((unsigned char)0x26)
#define FT_ptgMemErr \
((unsigned char)0x27)
#define FT_ptgMemNoMem \
((unsigned char)0x28)
#define FT_ptgMemFunc \
((unsigned char)0x29)
#define FT_ptgRefErr \
((unsigned char)0x2A)
#define FT_ptgAreaErr \
((unsigned char)0x2B)
#define FT_ptgRefN \
((unsigned char)0x2C)
#define FT_ptgAreaN \
((unsigned char)0x2D)
#define FT_ptgMemAreaN \
((unsigned char)0x2E)
#define FT_ptgMemNoMemN \
((unsigned char)0x2F)
#define FT_ptgNameX \
((unsigned char)0x39)
#define FT_ptgRef3d \
((unsigned char)0x3A)
#define FT_ptgArea3d \
((unsigned char)0x3B)
#define FT_ptgRefErr3d \
((unsigned char)0x3C)
#define FT_ptgAreaErr3d \
((unsigned char)0x3D)
#define FT_ptgArrayV \
((unsigned char)0x40)
#define FT_ptgFuncV \
((unsigned char)0x41)
#define FT_ptgFuncVarV \
((unsigned char)0x42)
#define FT_ptgNameV \
((unsigned char)0x43)
#define FT_ptgRefV \
((unsigned char)0x44)
#define FT_ptgAreaV \
((unsigned char)0x45)
#define FT_ptgMemAreaV \
((unsigned char)0x46)
#define FT_ptgMemErrV \
((unsigned char)0x47)
#define FT_ptgMemNoMemV \
((unsigned char)0x48)
#define FT_ptgMemFuncV \
((unsigned char)0x49)
#define FT_ptgRefErrV \
((unsigned char)0x4A)
#define FT_ptgAreaErrV \
((unsigned char)0x4B)
#define FT_ptgRefNV \
((unsigned char)0x4C)
#define FT_ptgAreaNV \
((unsigned char)0x4D)
#define FT_ptgMemAreaNV \
((unsigned char)0x4E)
#define FT_ptgMemNoMemNV \
((unsigned char)0x4F)
#define FT_ptgFuncCEV \
((unsigned char)0x58)
#define FT_ptgNameXV \
((unsigned char)0x59)
#define FT_ptgRef3dV \
((unsigned char)0x5A)
#define FT_ptgArea3dV \
((unsigned char)0x5B)
#define FT_ptgRefErr3dV \
((unsigned char)0x5C)
#define FT_ptgAreaErr3dV \
((unsigned char)0x5D)
#define FT_ptgArrayA \
((unsigned char)0x60)
#define FT_ptgFuncA \
((unsigned char)0x61)
#define FT_ptgFuncVarA \
((unsigned char)0x62)
#define FT_ptgNameA \
((unsigned char)0x63)
#define FT_ptgRefA \
((unsigned char)0x64)
#define FT_ptgAreaA \
((unsigned char)0x65)
#define FT_ptgMemAreaA \
((unsigned char)0x66)
#define FT_ptgMemErrA \
((unsigned char)0x67)
#define FT_ptgMemNoMemA \
((unsigned char)0x68)
#define FT_ptgMemFuncA \
((unsigned char)0x69)
#define FT_ptgRefErrA \
((unsigned char)0x6A)
#define FT_ptgAreaErrA \
((unsigned char)0x6B)
#define FT_ptgRefNA \
((unsigned char)0x6C)
#define FT_ptgAreaNA \
((unsigned char)0x6D)
#define FT_ptgMemAreaNA \
((unsigned char)0x6E)
#define FT_ptgMemNoMemNA \
((unsigned char)0x6F)
#define FT_ptgFuncCEA \
((unsigned char)0x78)
#define FT_ptgNameXA \
((unsigned char)0x79)
#define FT_ptgRef3dA \
((unsigned char)0x7A)
#define FT_ptgArea3dA \
((unsigned char)0x7B)
#define FT_ptgRefErr3dA \
((unsigned char)0x7C)
#define FT_ptgAreaErr3dA \
((unsigned char)0x7D)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: formtags.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:46 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

1046
uppdev/XLS/globalrec.cpp Normal file

File diff suppressed because it is too large Load diff

179
uppdev/XLS/globalrec.h Normal file
View file

@ -0,0 +1,179 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/globalrec.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef GLOBALREC_H
#define GLOBALREC_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/biffsection.h>
#include <XLS/font.h>
#include <XLS/format.h>
#include <XLS/extformat.h>
#include <XLS/recdef.h>
#include <XLS/unit.h>
namespace xlslib_core
{
/*
***********************************
CGlobalRecords class declaration
***********************************
*/
#define GLOBAL_NUM_DEFAULT_FONT (5)
#define GLOBAL_NUM_DEFAULT_FORMATS (8)
#define GLOBAL_NUM_DEFAULT_XFS (16)
#define GLOBAL_NUM_DEFAULT_STYLES (6)
typedef enum
{
GLOBAL_INIT,
GLOBAL_BOF,
GLOBAL_CODEPAGE,
GLOBAL_WINDOW1,
GLOBAL_DATEMODE,
GLOBAL_DEFAULTFONTS,
GLOBAL_FONTS,
GLOBAL_FORMATS,
GLOBAL_DEFAULTXFS,
GLOBAL_XFS,
GLOBAL_STYLES,
GLOBAL_BOUNDSHEETS,
GLOBAL_EOF,
GLOBAL_FINISH
} GlobalRecordDumpState_t;
class CGlobalRecords: public CBiffSection
{
private:
Font_Set_t m_Fonts;
Font_List_t m_DefaultFonts;
Format_List_t m_Formats;
XF_Set_t m_XFs;
XF_List_t m_DefaultXFs;
Style_List_t m_Styles;
Boundsheet_List_t m_BoundSheets;
/*
static const font_init_t m_Default_Fonts [GLOBAL_NUM_DEFAULT_FONT ];
static const format_t m_Default_Formats[GLOBAL_NUM_DEFAULT_FORMATS ];
static const xf_init_t m_Default_XFs [GLOBAL_NUM_DEFAULT_XFS ];
static const style_t m_Default_Styles [GLOBAL_NUM_DEFAULT_STYLES ];
*/
// State Machine variables
GlobalRecordDumpState_t m_DumpState;
CUnit* m_pCurrentData;
public:
CGlobalRecords();
~CGlobalRecords();
void AddBoundingSheet(unsigned32_t streampos,
unsigned16_t attributes,
std::string& sheetname);
#if VERSION_BIFF == VERSION_BIFF8
void AddBoundingSheet(unsigned32_t streampos,
unsigned16_t attributes,
std::ustring& sheetname
#ifdef HAVE_ICONV
, std::string& iconv_code
#endif
);
#endif
void AddBoundingSheet(boundsheet_t* bsheetdef);
// TODO: Check if the font already exists (using CRC or raw comparison)
font_t* AddFont(font_t* newfont );
format_t* AddFormat(format_t*);
xf_t* AddXFormat(xf_t* xf);
xf_t* ReplaceXFormat(xf_t* xf, xf_t* xfnew);
font_t* ReplaceFont(font_t* fnt, font_t* fntnew);
void GetBoundingSheets(Boundsheet_List_Itor_t &bs);
// A Kind of state machine that will return
// a non-null pointer to the data unit until all data has been retrieved.
CUnit* DumpData(bool reset = false);
Boundsheet_List_Itor_t GetFirstBoundSheet();
Boundsheet_List_Itor_t GetEndBoundSheet();
unsigned32_t GetSize(void);
font_t* GetDefaultFont(void);
xf_t* GetDefaultXF(void);
private:
// Former static variiables
// ========================
// From DumpData
Font_Set_Itor_t font;
Font_List_Itor_t font_dflt;
Format_List_Itor_t format;
XF_Set_Itor_t xf;
XF_List_Itor_t xf_dflt;
unsigned16_t next_fontindex;
unsigned16_t next_xfindex;
unsigned16_t next_formatindex;
Style_List_Itor_t style;
Boundsheet_List_Itor_t bsheet;
};
}
#endif // GLOBALREC_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: globalrec.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:49 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

158
uppdev/XLS/index.cpp Normal file
View file

@ -0,0 +1,158 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/index.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/index.h>
using namespace std;
using namespace xlslib_core;
/*
******************************
CIndex class implementation
******************************
*/
CIndex::CIndex(unsigned32_t firstrow,
unsigned32_t lastrow)
{
SetRecordType((signed32_t)RECTYPE_INDEX);
AddValue32(INDEX_DFLT_RESERVED);
#if VERSION_BIFF == VERSION_BIFF5
AddValue16(firstrow);
AddValue16(lastrow+1);
#else
AddValue32(firstrow);
AddValue32(lastrow+1);
#endif
AddValue32(INDEX_DFLT_RESERVED);
// NOTE: This record is created with an empty array. It should work if the rest
// of the record is not completed later, since the record's size reflects the
// lack of such array
SetRecordLength(GetDataSize()-4);
}
CIndex::~CIndex()
{
}
/*
**********************************
**********************************
*/
void CIndex::AddDBCellOffset(unsigned32_t dboffset)
{
AddValue32(dboffset);
SetRecordLength(GetDataSize()-4); // Update record's length
}
/*
**********************************
**********************************
*/
void CIndex::SetRows(unsigned32_t firstrow,
unsigned32_t lastrow)
{
#if VERSION_BIFF == VERSION_BIFF5
SetValueAt((signed16_t)firstrow, INDEX_OFFSET_B7FIRSTROW);
SetValueAt((signed16_t)lastrow, INDEX_OFFSET_B7LASTROW);
#else
SetValueAt((signed32_t)firstrow, INDEX_OFFSET_B7FIRSTROW);
SetValueAt((signed32_t)lastrow, INDEX_OFFSET_B7LASTROW);
#endif
}
/*
**********************************
**********************************
*/
unsigned32_t CIndex::GetFirstRow(void)
{
unsigned32_t retval;
#if VERSION_BIFF == VERSION_BIFF5
signed16_t firstrow;
GetValue16From(&firstrow, INDEX_OFFSET_B7FIRSTROW);
retval = firstrow;
#else
signed32_t firstrow;
GetValue32From(&firstrow, INDEX_OFFSET_B7FIRSTROW);
retval = firstrow;
#endif
return retval;
}
/*
**********************************
**********************************
*/
unsigned32_t CIndex::GetLastRow(void)
{
unsigned32_t retval;
#if VERSION_BIFF == VERSION_BIFF5
signed16_t lastrow;
GetValue16From(&lastrow, INDEX_OFFSET_B7LASTROW);
retval = lastrow;
#else
signed32_t lastrow;
GetValue32From(&lastrow, INDEX_OFFSET_B7LASTROW);
retval = lastrow;
#endif
return retval;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: index.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:53 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

86
uppdev/XLS/index.h Normal file
View file

@ -0,0 +1,86 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/index.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef INDEX_H
#define INDEX_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/record.h>
namespace xlslib_core
{
/*
******************************
CIndex class declaration
******************************
*/
#define INDEX_DFLT_RESERVED ((unsigned32_t)0x00000000)
#define INDEX_OFFSET_B7FIRSTROW ((unsigned32_t)8)
#define INDEX_OFFSET_B7LASTROW ((unsigned32_t)10)
#define INDEX_OFFSET_B8FIRSTROW ((unsigned32_t)8)
#define INDEX_OFFSET_B8LASTROW ((unsigned32_t)12)
class CIndex: public CRecord
{
private:
public:
CIndex(unsigned32_t firstrow,
unsigned32_t lastrow);
~CIndex();
void AddDBCellOffset(unsigned32_t dbcoffset);
void SetRows(unsigned32_t firstrow, unsigned32_t lastrow);
unsigned32_t GetFirstRow(void);
unsigned32_t GetLastRow(void);
};
}
#endif //INDEX_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: index.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:46 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

4
uppdev/XLS/init Normal file
View file

@ -0,0 +1,4 @@
#ifndef _XLS_icpp_init_stub
#define _XLS_icpp_init_stub
#include "Core/init"
#endif

262
uppdev/XLS/label.cpp Normal file
View file

@ -0,0 +1,262 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/label.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/label.h>
using namespace std;
using namespace xlslib_core;
/*
******************************
CLabel class implementation
******************************
*/
CLabel::CLabel(unsigned16_t row,
unsigned16_t col,
string& strlabel,
xf_t* pxfval)
{
SetRecordType(RECTYPE_LABEL);
AddValue16(row);
AddValue16(col);
unsigned16_t xfindex;
if(pxfval != NULL)
xfindex = pxfval->GetIndex();
else
xfindex = 0x000f;
AddValue16(xfindex);
signed16_t labelsize = strlabel.size();
#if VERSION_BIFF == VERSION_BIFF5
AddValue16((unsigned16_t)labelsize);
AddDataArray((unsigned8_t*)strlabel.c_str(), strlabel.size());
#else
AddUnicodeStrlen((unsigned16_t)labelsize);
AddUnicodeString((unsigned8_t*)strlabel.c_str(), strlabel.size());
#endif
SetRecordLength(GetDataSize()-4);
}
#if VERSION_BIFF == VERSION_BIFF8
CLabel::CLabel(unsigned16_t row,
unsigned16_t col,
ustring& ustrlabel
#ifdef HAVE_ICONV
, string& iconv_code
#endif
, xf_t* pxfval)
{
unsigned16_t xfindex;
SetRecordType(RECTYPE_LABEL);
AddValue16(row);
AddValue16(col);
if(pxfval != NULL)
xfindex = pxfval->GetIndex();
else
xfindex = 0x000f;
AddValue16(xfindex);
#ifdef HAVE_ICONV
u16string u16sheetname;
Conv32to16(iconv_code, ustrlabel, u16sheetname);
// size_t outSize, resultSize;
// size_t iconv (iconv_t cd, char **restrict inbuf, size_t *restrict inbytesleft, char **restrict outbuf, size_t *restrict outbytesleft);
AddUnicodeStrlen((unsigned16_t)u16sheetname.size());
AddUnicodeString((unsigned16_t* )u16sheetname.c_str(), u16sheetname.size());
#else
AddUnicodeStrlen((unsigned16_t)ustrlabel.size());
AddUnicodeString((unsigned16_t*)ustrlabel.c_str(), ustrlabel.size());
#endif
SetRecordLength(GetDataSize()-4);
}
#endif
CLabel::CLabel(label_t& labeldef)
{
SetRecordType(RECTYPE_LABEL);
AddValue16(labeldef.GetRow());
AddValue16(labeldef.GetCol());
AddValue16(labeldef.GetXFIndex());
signed16_t labelsize = labeldef.GetStrLabelSize() ;
#if VERSION_BIFF == VERSION_BIFF5
AddValue16((unsigned16_t)labelsize);
AddDataArray(labeldef.GetStrLabelBuffer(), labelsize);
#else
if(labeldef.GetStrLabelSize()) {
AddUnicodeStrlen((unsigned16_t)labelsize);
AddUnicodeString(labeldef.GetStrLabelBuffer(), labelsize);
} else {
#ifdef HAVE_ICONV
u16string u16sheetname;
string iconvStr;
ustring label;
iconvStr = *labeldef.GetIconvCode();
label = *labeldef.GetUstrLabel();
Conv32to16(iconvStr, label, u16sheetname);
// size_t outSize, resultSize;
// size_t iconv (iconv_t cd, char **restrict inbuf, size_t *restrict inbytesleft, char **restrict outbuf, size_t *restrict outbytesleft);
AddUnicodeStrlen((unsigned16_t)u16sheetname.size());
AddUnicodeString((unsigned16_t* )u16sheetname.c_str(), u16sheetname.size());
#else
labelsize = labeldef.GetWStrLabelSize() ;
AddUnicodeStrlen((unsigned16_t)labelsize);
AddUnicodeString((unsigned16_t*)labeldef.GetWStrLabelBuffer(), labelsize);
#endif
}
#endif
SetRecordLength(GetDataSize()-4);
}
CLabel::~CLabel()
{
}
/*
******************************
label_t class implementation
******************************
*/
xlslib_core::label_t::label_t(unsigned16_t rowval, unsigned16_t colval,
string& labelstrval, xf_t* pxfval)
{
row = rowval;
col = colval;
if(pxfval != NULL)
pxfval->MarkUsed();
pxf = pxfval;
#if VERSION_BIFF == VERSION_BIFF5
if(labelstrval.size() > 255)
{
labelstrval.resize(255);
labelstrval[252] = '.';
labelstrval[253] = '.';
labelstrval[254] = '.';
}
#endif
aStrlabel = labelstrval;
}
#if VERSION_BIFF == VERSION_BIFF8
xlslib_core::label_t::label_t(unsigned16_t rowval, unsigned16_t colval,
ustring& labelstrval
#ifdef HAVE_ICONV
, string& code
#endif
, xf_t* pxfval)
{
row = rowval;
col = colval;
if(pxfval != NULL)
pxfval->MarkUsed();
pxf = pxfval;
uStrlabel = labelstrval;
#ifdef HAVE_ICONV
iconv_code = code;
#endif
}
#endif
/*
******************************
******************************
*/
unsigned16_t xlslib_core::label_t::GetSize()
{
unsigned16_t size = 0;
size += 12; // Minimal label's size
size += aStrlabel.size();
return size;
}
/*
******************************
******************************
*/
CUnit* xlslib_core::label_t::GetData()
{
CUnit* datalabel;
#if VERSION_BIFF == VERSION_BIFF5
datalabel = (CUnit*)( new CLabel(row,col,aStrlabel,pxf));
#else
if(aStrlabel.length() > 0) {
datalabel = (CUnit*)( new CLabel(row,col,aStrlabel,pxf));
} else {
#ifdef HAVE_ICONV
datalabel = (CUnit*)( new CLabel(row,col,uStrlabel,iconv_code, pxf));
#else
datalabel = (CUnit*)( new CLabel(row,col,uStrlabel, pxf));
#endif
}
#endif
return datalabel; // NOTE: this pointer HAS to be deleted elsewhere.
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: label.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:53 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

131
uppdev/XLS/label.h Normal file
View file

@ -0,0 +1,131 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/label.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef LABEL_H
#define LABEL_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/cell.h>
#include <XLS/record.h>
#include <XLS/unit.h>
#include <XLS/extformat.h>
namespace xlslib_core
{
#define LABEL_DFLT_XFINDEX ((unsigned16_t)0x000f)
#define LABEL_OFFSET_FIRSTCOL ((unsigned8_t)6)
#define LABEL_OFFSET_LASTCOL ((unsigned8_t)8)
class label_t;
class CLabel: public CRecord
{
private:
public:
CLabel(unsigned16_t row,
unsigned16_t col,
std::string& strlabel,
xf_t* pxfval = NULL);
#if VERSION_BIFF == VERSION_BIFF8
CLabel(unsigned16_t row,
unsigned16_t col,
std::ustring& strlabel
#ifdef HAVE_ICONV
, std::string& iconv_code
#endif
, xf_t* pxfval = NULL);
#endif
CLabel(label_t& labeldef);
~CLabel();
};
class label_t: public cell_t
{
private:
std::string aStrlabel;
#if VERSION_BIFF == VERSION_BIFF8
std::ustring uStrlabel;
#ifdef HAVE_ICONV
std::string iconv_code;
#endif
#endif
public:
label_t(unsigned16_t rowval,
unsigned16_t colval,
std::string& labelstrval,
xf_t* pxfval = NULL);
#if VERSION_BIFF == VERSION_BIFF8
label_t(unsigned16_t rowval,
unsigned16_t colval,
std::ustring& labelstrval
#ifdef HAVE_ICONV
, std::string& code
#endif
, xf_t* pxfval = NULL);
#endif
~label_t(){};
unsigned16_t GetStrLabelSize() {return aStrlabel.size();};
const unsigned8_t* GetStrLabelBuffer(){return (unsigned8_t*)aStrlabel.c_str();};
#if VERSION_BIFF == VERSION_BIFF8
unsigned16_t GetWStrLabelSize() {return uStrlabel.size();};
const uchar_t *GetWStrLabelBuffer(){return (uchar_t*)uStrlabel.c_str();};
std::ustring *GetUstrLabel() { return &uStrlabel; };
#ifdef HAVE_ICONV
std::string *GetIconvCode() { return &iconv_code; };
#endif
#endif
unsigned16_t GetSize();
CUnit* GetData();
};
}
#endif //LABEL_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: label.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:46 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

98
uppdev/XLS/merged.cpp Normal file
View file

@ -0,0 +1,98 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/merged.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/merged.h>
using namespace std;
using namespace xlslib_core;
/*
******************************
CMergedCells class implementation
******************************
*/
CMergedCells::CMergedCells()
{
SetRecordType(RECTYPE_MERGEDCELLS);
// By default the record is empty
AddValue16(0x00);
SetRecordLength(GetDataSize()-4);
}
CMergedCells::~CMergedCells()
{
}
/*
******************************
******************************
*/
void CMergedCells::AddRange(range_t* rng)
{
AddValue16(rng->first_row);
AddValue16(rng->last_row);
AddValue16(rng->first_col);
AddValue16(rng->last_col);
SetRecordLength(GetDataSize()-4);
}
/*
******************************
******************************
*/
void CMergedCells::SetNumRanges(unsigned16_t numranges)
{
SetValueAt((signed16_t)numranges, 0x04);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: merged.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:51 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

82
uppdev/XLS/merged.h Normal file
View file

@ -0,0 +1,82 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/merged.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef MERGED_H
#define MERGED_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/rectypes.h>
#include <XLS/record.h>
namespace xlslib_core
{
/*
******************************
CMergedCells class declaration
******************************
*/
class CMergedCells: public CRecord
{
protected:
public:
CMergedCells();
~CMergedCells();
void AddRange(range_t* rng);
void SetNumRanges(unsigned16_t numranges);
};
}
#endif //MERGED_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: merged.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:44 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

121
uppdev/XLS/number.cpp Normal file
View file

@ -0,0 +1,121 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/number.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/number.h>
using namespace std;
using namespace xlslib_core;
CNumber::CNumber(unsigned16_t row,
unsigned16_t col,
double num,
xf_t* pxfval)
{
SetRecordType(RECTYPE_NUMBER);
AddValue16(row);
AddValue16(col);
unsigned16_t xfindex;
pxfval != NULL?
xfindex = pxfval->GetIndex()
:xfindex = 0x000f;
AddValue16(xfindex);
void* pnumieee = (void*) &num;
unsigned64_t numieee = *((unsigned64_t*)(pnumieee));
AddValue64(numieee);
SetRecordLength(GetDataSize()-4);
}
CNumber::CNumber(number_t& numdef)
{
SetRecordType(RECTYPE_NUMBER); // DFH was RECTYPE_LABEL, must have been a type ????
AddValue16(numdef.GetRow());
AddValue16(numdef.GetCol());
AddValue16(numdef.GetXFIndex());
double num = numdef.GetNumber();
void* pnumieee = (void*) &num;
unsigned64_t numieee = *((unsigned64_t*)(pnumieee));
AddValue64(numieee);
SetRecordLength(GetDataSize()-4);
}
CNumber::~CNumber()
{
}
/*
*********************************
number_t class implementation
*********************************
*/
number_t::number_t(unsigned16_t rowval,
unsigned16_t colval,
double numval,
xf_t* pxfval)
{
row = rowval;
col = colval;
number = numval;
if(pxfval != NULL)
pxfval->MarkUsed();
pxf = pxfval;
}
CUnit* number_t::GetData() {
CUnit* datanum =
(CUnit*)( new CNumber(row,col,number, pxf));
return datanum; // NOTE: this pointer HAS to be deleted elsewhere.
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: number.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:55 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

101
uppdev/XLS/number.h Normal file
View file

@ -0,0 +1,101 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/number.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef NUMBER_H
#define NUMBER_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/cell.h>
#include <XLS/record.h>
#include <XLS/unit.h>
namespace xlslib_core
{
class number_t;
class CNumber: public CRecord
{
private:
public:
CNumber(unsigned16_t row,
unsigned16_t col,
double num,
xf_t* pxfval = NULL);
CNumber(number_t& blankdef);
~CNumber();
};
class number_t: public cell_t
{
private:
double number;
public:
number_t(unsigned16_t rowval,
unsigned16_t colval,
double numval,
xf_t* pxfval = NULL);
~number_t(){};
unsigned16_t GetSize(){return 18;};
double GetNumber() {return number;};
CUnit* GetData();
};
}
#endif //NUMBER_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: number.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:49 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

116
uppdev/XLS/ole/binfile.h Normal file
View file

@ -0,0 +1,116 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/oledoc/binfile.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef BINFILE_H
#define BINFILE_H
#include <fstream>
#include <string>
#include <XLS/config.h>
#include <XLS/systype.h>
#include <XLS/unit.h>
namespace xlslib_core
{
/*
******************************
CBinFile class declaration
******************************
*/
#ifdef XLS_PHP
typedef int (*write_fptr_t)(const char *str, unsigned int str_length);
#endif
class CBinFile
{
private:
int write_service(const char *buffer, size_t size);
static const int STROKE_CHUNK_SIZE;
public:
CBinFile();
CBinFile(const std::string& name);
~CBinFile();
int Open(const std::string& name);
int Close(void);
int Write ( unsigned8_t * data, unsigned32_t size );
int Write (CUnit& data_unit );
int WriteByte(unsigned8_t byte);
int WriteUnsigned16(unsigned16_t data);
int WriteUnsigned32(unsigned32_t data);
int WriteSigned16(signed16_t data);
int WriteSigned32(signed32_t data);
int WriteByteArray(const unsigned8_t *data, size_t size);
int SerializeFixedArray(const unsigned8_t data, unsigned32_t size);
unsigned32_t Position(); // debugging, position of stream
#ifdef XLS_PHP
void SetStroke(){
is_stroke= true;
}
void UnSetStroke(){
is_stroke= false;
}
#endif
protected:
std::ofstream m_File;
#ifdef XLS_PHP
write_fptr_t write_fptr;
bool is_stroke;
#endif
};
}
#endif //BINFILE_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: binfile.h,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:43 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

172
uppdev/XLS/ole/oledoc.h Normal file
View file

@ -0,0 +1,172 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/oledoc/oledoc.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef OLEDOC_H
#define OLEDOC_H
#include <XLS/config.h>
#include <XLS/systype.h>
#include <XLS/ole/binfile.h>
#include <XLS/ole/olefs.h>
#include <XLS/datast.h>
namespace xlslib_core
{
#define HEADPOS_ID ((unsigned16_t)(0x00))
#define HEADPOS_UK1 ((unsigned16_t)(0x08))
#define HEADPOS_UK2 ((unsigned16_t)(0x0c))
#define HEADPOS_UK2b ((unsigned16_t)(0x10)) /* According to the Excel sample... but undocummented */
#define HEADPOS_UK3 ((unsigned16_t)(0x14))
#define HEADPOS_UK4 ((unsigned16_t)(0x18))
#define HEADPOS_UK5 ((unsigned16_t)(0x1a))
#define HEADPOS_UK6 ((unsigned16_t)(0x1c))
#define HEADPOS_LOG2_BIGBLOCK ((unsigned16_t)(0x1e))
#define HEADPOS_LOG2_SMALLBLOCK ((unsigned16_t)(0x20))
#define HEADPOS_UK7 ((unsigned16_t)(0x24))
#define HEADPOS_UK8 ((unsigned16_t)(0x28))
#define HEADPOS_BAT_COUNT ((unsigned16_t)(0x2c))
#define HEADPOS_PROPERTIES_SB ((unsigned16_t)(0x30))
#define HEADPOS_UK9 ((unsigned16_t)(0x34))
#define HEADPOS_UK10 ((unsigned16_t)(0x38))
#define HEADPOS_SBAT_COUNT ((unsigned16_t)(0x40))
#define HEADPOS_SBAT_START ((unsigned16_t)(0x3c))
#define HEADPOS_XBAT_START ((unsigned16_t)(0x44))
#define HEADPOS_XBAT_COUNT ((unsigned16_t)(0x48))
#define HEADPOS_BAT_ARRAY ((unsigned16_t)(0x4c))
#define HEADVAL_DFLT_NOTUSED ((unsigned8_t) (0xff) )
#define HEADVAL_DFLT_UK1 ((signed32_t) (0x00) )
#define HEADVAL_DFLT_UK2 ((signed32_t) (0x00) )
#define HEADVAL_DFLT_UK2b ((signed32_t) (0x00) )/* According to the Excel sample... but undocummented */
#define HEADVAL_DFLT_UK3 ((signed32_t) (0x00) )
#define HEADVAL_DFLT_UK4 ((signed16_t) (0x3e) )/*POIFS documentations says 0x3b... let's stick with the Excel sample ...*/
#define HEADVAL_DFLT_UK5 ((signed16_t) (0x03) )
#define HEADVAL_DFLT_UK6 ((signed16_t) (-2) )
#define HEADVAL_DFLT_UK7 ((signed32_t) (0x00) )
#define HEADVAL_DFLT_UK8 ((signed32_t) (0x00) )
#define HEADVAL_DFLT_UK9 ((signed32_t) (0x00) )
#define HEADVAL_DFLT_UK10 ((signed32_t) (0x1000))
#define HEADVAL_DFLT_LOG2_BIGBLOCK ((signed16_t)(9))
#define HEADVAL_DFLT_LOG2_SMALLBLOCK ((signed32_t)(6))
#define HEADVAL_DFLT_BATCOUNT ((signed32_t)(0) )
#define HEADVAL_DFLT_PROPERTIES_SB ((signed32_t)(-2) )
#define HEADVAL_DFLT_SBAT_START ((signed32_t)(-2) )
#define HEADVAL_DFLT_SBAT_COUNT ((signed32_t)(0) ) //POIFS says it should be 1 ... let's stick to M$
#define HEADVAL_DFLT_XBAT_START ((signed32_t)(-2) )
#define HEADVAL_DFLT_XBAT_COUNT ((signed32_t)(0) )
// #define HEADVAL_DFLT_BAT_ARRAY /* Cannot have a default value */
#define HEAD_SIZE BIG_BLOCK_SIZE
#define HEAD_ID_SZ (0x08)
#define BAT_NOT_USED_BYTE ((unsigned8_t)(0xff)) // could be char is not signed
#define BAT_NOT_USED ((signed32_t)(-1))
#define BAT_END_CHAIN ((signed32_t)(-2))
#define BAT_SELF_PLACE ((signed32_t)(-3))
#define BAT_MSAT_PLACE ((signed32_t)(-4))
#define BAT_ENTRIES_PER_BLOCK (BIG_BLOCK_SIZE/4) // BAT blocks are filled - no pointers
#define BAT_BLOCKS_PER_MSAT_BLOCK (BAT_ENTRIES_PER_BLOCK - 1) // pointer to next, or final terminator
#define HEADER_SAT_SIZE 109
/*
******************************
COleFile class declaration
******************************
*/
// Block allocation strategy. Within the OLE header are 109 slots for BAT Sectors.
// But, when the file gets big, you run out (127 sectors in each BAT Sector). So,
// the 110th BAT has to go into a special block dedicated to hold these. One additional
// block gets you 127 more BAT entries, and so forth.
//
typedef struct {
unsigned32_t bat_entries; // total number of entries
unsigned32_t _bat_entries; // debug - count'm
unsigned32_t bat_count; // total number of sectors used for real data
unsigned32_t _bat_count; // debug - count'm
unsigned32_t msat_count; // total number of additional Master Sector Allocations Blocks (each hold 127)
unsigned32_t header_bat_count; // first 109 used
unsigned32_t extra_bat_count; // in addition to first 109
unsigned32_t header_fill; // padding in main header only!
unsigned32_t extra_fill; // padding in last MSAT!
} blocks, *blocksP;
class COleDoc: public CBinFile, public COleFileSystem
{
private:
int DumpHeader(blocks bks, unsigned32_t total_data_size);
int DumpData(void);
int DumpDepots(blocks bks);
int DumpFileSystem(void);
signed16_t GetUnicodeName(const char* name, char** ppname_unicode);
int DumpNode(COleProp& node);
blocks GetBATCount();
static const unsigned8_t OLE_FILETYPE[];
protected:
public:
COleDoc();
//COleDoc(const string& file_name);
~COleDoc();
int DumpOleFile();
};
}
#endif //OLEDOC_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: oledoc.h,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:43 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

104
uppdev/XLS/ole/olefs.h Normal file
View file

@ -0,0 +1,104 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/oledoc/olefs.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef OLEFS_H
#define OLEFS_H
#include <XLS/config.h>
#include <XLS/systype.h>
#include <XLS/ole/oleprop.h>
#include <XLS/datast.h>
namespace xlslib_core
{
#define FS_NO_ERRORS ((int)0)
#define FS_INVALID_PATH ((int)-1)
#define FS_NODE_ALREADY_EXISTS ((int)-2)
#define FS_NODE_NOT_A_DIRECTORY ((int)-3)
/*
***********************************
COleFileSystem class declaration
***********************************
*/
class COleFileSystem
{
private:
public:
COleProp m_RootEntry; /// temporally public (for debugging)
int GetNode(std::string const &path, Tree_Level_Itor_t& node);
int AddDirectory(std::string const &dir_path);
int AddFile(std::string const &dir_path, CDataStorage* pdata);
int AddNode(COleProp* base_node, StringList_t& path_list);
int SearchNode(COleProp* base_node, StringList_t& path_list, Tree_Level_Itor_t& node_level);
void GetAllNodesList(NodeList_t& node_list, COleProp* base_node);
void GetAllNodes(NodeList_t& node_list);
void SortList(NodeList_t& node_list);
signed32_t m_nProperty_Count;
COleProp& GetRootEntry();
unsigned32_t GetTotalDataSize();
unsigned32_t GetNumDataFiles();
public:
COleFileSystem();
~COleFileSystem();
};
}
#endif //OLEFS_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: olefs.h,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:43 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

165
uppdev/XLS/ole/oleprop.h Normal file
View file

@ -0,0 +1,165 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/oledoc/oleprop.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef OLEPROP_H
#define OLEPROP_H
#include <list>
#include <string>
#include <XLS/config.h>
#include <XLS/systype.h>
#include <XLS/datast.h>
namespace xlslib_core
{
class COleProp;
typedef std::list<xlslib_core::COleProp* XLSLIB_DFLT_ALLOCATOR> Tree_Level_List_t;
typedef Tree_Level_List_t::iterator Tree_Level_Itor_t;
typedef std::list<xlslib_core::COleProp* XLSLIB_DFLT_ALLOCATOR> NodeList_t;
typedef NodeList_t::iterator NodeList_Itor_t;
/*
******************************
COleProp class declaration
******************************
*/
class COleProp
{
protected:
std::string m_sName;
unsigned16_t m_nNameSize;
unsigned8_t m_nPropType;
unsigned8_t m_nNodeColor;
signed32_t m_nPrevPropIndex;
signed32_t m_nNextPropIndex;
signed32_t m_nChildPropIndex;
signed32_t m_nTSCreatedSeconds;
signed32_t m_nTSCreatedDays;
signed32_t m_nTSModifiedSeconds;
signed32_t m_nTSModifiedDays;
signed32_t m_nStartBlock;
signed32_t m_nSize;
// The following set of attributes are not part of the definition of
// an OleDoc's property:
CDataStorage* m_pData;
signed32_t m_nIndex;
public:
Tree_Level_List_t m_Child_List;
COleProp();
COleProp(signed32_t node_index,
std::string name,
CDataStorage* data = NULL);
~COleProp();
int Init(signed32_t node_index,
std::string name,
CDataStorage* data = NULL);
int SetName(std::string name);
std::string GetName(void);
int SetIndex(signed32_t newindex);
signed32_t GetIndex(void);
int SetSize(signed32_t size);
signed32_t GetSize(void);
int SetType(unsigned8_t newtype);
unsigned8_t GetType(void);
int SetColor(unsigned8_t newcolor);
unsigned8_t GetColor(void);
int SetPreviousIndex(signed32_t prev);
signed32_t GetPreviousIndex(void);
int SetNextIndex(signed32_t next);
signed32_t GetNextIndex(void);
int SetChildIndex(signed32_t child);
signed32_t GetChildIndex(void);
int SetStartBlock(signed32_t sb);
signed32_t GetStartBlock(void);
void SetDataPointer(CDataStorage* pdata);
CDataStorage* GetDataPointer(void);
void SetCreatedSecs(signed32_t sec1);
signed32_t GetCreatedSecs(void);
void SetCreatedDays(signed32_t day1);
signed32_t GetCreatedDays(void);
void SetModifiedSecs(signed32_t sec2);
signed32_t GetModifiedSecs(void);
void SetModifiedDays(signed32_t day2);
signed32_t GetModifiedDays(void);
};
}
#endif //OLEPROP_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: oleprop.h,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:43 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

547
uppdev/XLS/oledoc.cpp Normal file
View file

@ -0,0 +1,547 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/oledoc/oledoc.cpp,v $
* $Revision: 1.3 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/ole/oledoc.h>
#include <XLS/timespan.h>
using namespace std;
using namespace xlslib_core;
/*
***********************************
COleDoc class implementation
***********************************
*/
const unsigned8_t COleDoc::OLE_FILETYPE[] =
{ 0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1};
COleDoc::COleDoc()
{
}
/*
COleDoc::COleDoc(const string& file_name)
{
Open(file_name);
}
*/
COleDoc::~COleDoc()
{
}
/*
***********************************
***********************************
*/
int COleDoc::DumpHeader(blocks bks, unsigned32_t total_data_size)
{
unsigned32_t i, total_data_blocks, sectorID, msatID;
int errcode = NO_ERRORS;
total_data_blocks = total_data_size/BIG_BLOCK_SIZE;
#if OLE_DEBUG
fprintf(stderr, "dataBlocks=%u\n", total_data_blocks), fflush(stderr);
#endif
// [00]FILETYPE
WriteByteArray(COleDoc::OLE_FILETYPE, /*(unsigned32_t)*/sizeof(COleDoc::OLE_FILETYPE));
// [08]UK1
WriteSigned32(HEADVAL_DFLT_UK1);
// [0c]UK2
WriteSigned32(HEADVAL_DFLT_UK2);
// [10]UK2b
WriteSigned32(HEADVAL_DFLT_UK2b);
// [14]UK3
WriteSigned32(HEADVAL_DFLT_UK3);
// [18]UK4
WriteSigned16(HEADVAL_DFLT_UK4);
// [1a]UK5
WriteSigned16(HEADVAL_DFLT_UK5);
// [1c]UK6
WriteSigned16(HEADVAL_DFLT_UK6);
// [1e]LOG_2_BIG_BLOCK
WriteSigned16(HEADVAL_DFLT_LOG2_BIGBLOCK);
// [20]LOG_2_SMALL_BLOCK
WriteSigned32(HEADVAL_DFLT_LOG2_SMALLBLOCK);
// [24]UK7
WriteSigned32(HEADVAL_DFLT_UK7);
// [28]UK8
WriteSigned32(HEADVAL_DFLT_UK8);
// [2c] BAT_COUNT (BBDEPOT NUM BLOCKS)
WriteUnsigned32(bks.bat_count);
//[30] PROPERTIES_START_BLOCK
// Since the big block depot will go immediately after the data, I need
// to know the size of the data and the size of the BAT in blocks (prev)
WriteUnsigned32(bks.msat_count+total_data_blocks+bks.bat_count);
#if OLE_DEBUG
fprintf(stderr, "HEADER says directory at %d\n", bks.msat_count+total_data_blocks+bks.bat_count);
#endif
// [34] UK9
WriteSigned32(HEADVAL_DFLT_UK9);
// [38] UK10
WriteSigned32(HEADVAL_DFLT_UK10);
// [3c] SBAT_START
// No small blocks will be used, so this is set to the default empty value
WriteSigned32(HEADVAL_DFLT_SBAT_START);
// [40] SBAT_BLOCKCOUNT_NUMBER
// Use the default value
WriteSigned32(HEADVAL_DFLT_SBAT_COUNT);
// [44] XBAT_START
// we will use first and possibly additional blocks for large files
WriteSigned32(bks.msat_count ? 0 : HEADVAL_DFLT_XBAT_START);
#if OLE_DEBUG
fprintf(stderr, "xbatStart=%d\n", bks.msat_count ? 0 : HEADVAL_DFLT_XBAT_START), fflush(stderr);
#endif
// [48] XBAT_COUNT
WriteUnsigned32(bks.msat_count); // was HEADVAL_DFLT_XBAT_COUNT (0)
#if OLE_DEBUG
fprintf(stderr, "msat_count=%d\n", bks.msat_count), fflush(stderr);
#endif
// [4C] BAT_ARRAY
// The BAT_ARRAY shall be calculated from the number of BAT blocks and their position
// The additional blocks, if needed, are directly below the header block, so we can write
// them out contiguously. The special conditions are:
// * for each MSAT block, the last entry needs to be a pointer to the next block
// * the fill is -1 for all unused entries
// * if there are MSAT blocks, the very last entry in the last block is a special marker
// first sector ID
sectorID = bks.msat_count + total_data_blocks;
for(i=0; i<bks.header_bat_count; i++) {
#if OLE_DEBUG
// fprintf(stderr, "sectorID=%d\n", sectorID), fflush(stderr);
#endif
WriteUnsigned32(sectorID++);
}
#if OLE_DEBUG
fprintf(stderr, "Position=0x%lx\n", Position() );
// fprintf(stderr, "SEC_ID[%u]=%u\n", i, total_data_size/(BIG_BLOCK_SIZE) + i), fflush(stderr);
#endif
// if we don't fill the header table, zero out unused entries
for(i = 0; i<bks.header_fill; i++) {
WriteSigned32(BAT_NOT_USED);
}
#if OLE_DEBUG
fprintf(stderr, "Position=0x%lx\n", Position() );
#endif
// plow ahead, adding up to 127 entries per extra MSAT block
msatID = 1; // sector 0 is the first MSAT, if used
for(i=1; i<=bks.extra_bat_count; i++) {
WriteUnsigned32(sectorID++);
if((i % BAT_BLOCKS_PER_MSAT_BLOCK) == 0) {
if(i == bks.extra_bat_count) {
WriteSigned32(BAT_END_CHAIN); // pointer to next MSAT
} else {
WriteUnsigned32(msatID++); // pointer to next MSAT
}
}
}
if(bks.extra_fill) {
for(i = 0; i<bks.extra_fill; i++) {
WriteSigned32(BAT_NOT_USED);
}
WriteSigned32(BAT_END_CHAIN); // pointer to next MSAT
}
#if OLE_DEBUG
fprintf(stderr, "Position=0x%lx\n", Position() );
#endif
assert(Position() == (HEAD_SIZE + (bks.msat_count*BIG_BLOCK_SIZE)));
return errcode;
}
/*
***********************************
***********************************
*/
int COleDoc::DumpData(void)
{
int errcode = NO_ERRORS;
NodeList_t node_list;
GetAllNodes(node_list);
for(NodeList_Itor_t i = node_list.begin(); i != node_list.end(); i++)
{
if((*i)->GetType() == PTYPE_FILE)
{
for(DataList_Itor_t j = (*i)->GetDataPointer()->begin();
j != (*i)->GetDataPointer()->end(); j++)
{
WriteByteArray((*j)->GetBuffer(), (*j)->GetDataSize());
}
}
}
return errcode;
}
/*
***********************************
***********************************
*/
int COleDoc::DumpDepots(blocks bks)
{
int errcode = NO_ERRORS;
NodeList_t node_list;
GetAllNodes(node_list);
unsigned32_t bat_index;
bat_index = 0;
// tells Excel that these are used by the MSAT
for(unsigned32_t i=0; i<bks.msat_count; ++i) {
WriteSigned32(BAT_MSAT_PLACE);
++bat_index;
++bks._bat_entries;
}
#if OLE_DEBUG
int foo=0;
#endif
for(NodeList_Itor_t node = node_list.begin(); node != node_list.end(); node++)
{
unsigned32_t chain_len, data_size;
// The start block is set in the node.
(*node)->SetStartBlock(bat_index);
// Write the chain for this node element
data_size = (*node)->GetDataPointer()->GetDataSize();
chain_len = data_size/BIG_BLOCK_SIZE - 1;
#if OLE_DEBUG
fprintf(stderr, "NODE[%d]: start_block=%d data=%d Sectors= %d\n", foo, bat_index, chain_len + 1 /* directory_terminator */);
#endif
for(unsigned32_t i = 0; i < chain_len; i++)
{
WriteSigned32(++bat_index);
++bks._bat_entries;
}
// Set the terminator number
WriteSigned32(BAT_END_CHAIN);
++bat_index;
++bks._bat_entries;
}
#if OLE_DEBUG
fprintf(stderr, "BAT_SELF_PLACE=%d -> %d TOTAL=%d\n", bat_index+1, bat_index+1+bks.bat_count+1, bks.bat_count);
#endif
// Write the -3 number for every index in the BAT that references to some BAT block (uh!?)
for(unsigned32_t i=0; i<bks.bat_count;i++)
{
WriteSigned32(BAT_SELF_PLACE);
++bat_index;
++bks._bat_entries;
}
#if OLE_DEBUG
fprintf(stderr, "last write: left = %d\n", Position() % HEAD_SIZE);
#endif
// This is the entry for the directory chain, the very last block, saying directory is just one sector
WriteSigned32(BAT_END_CHAIN);
++bat_index;
++bks._bat_entries;
//Fill the rest of the _LAST_ BAT block, code appears to handle the 0 case
unsigned32_t num_indexes = bat_index;
unsigned32_t to_fill_size = BIG_BLOCK_SIZE - ((4*num_indexes) % BIG_BLOCK_SIZE);
SerializeFixedArray(BAT_NOT_USED_BYTE, to_fill_size);
#if OLE_DEBUG
fprintf(stderr, "last write: left = %d\n", Position() % HEAD_SIZE);
#endif
#if OLE_DEBUG
fprintf(stderr, "Position=0x%lx\n", Position() );
fprintf(stderr, "bat_entries=%d actual=%d\n", bks.bat_entries, bks._bat_entries );
#endif
assert(bks.bat_entries == bks._bat_entries);
return errcode;
}
/*
***********************************
***********************************
*/
int COleDoc::DumpFileSystem(void)
{
int errcode = NO_ERRORS;
NodeList_t node_list;
GetAllNodes(node_list);
#if OLE_DEBUG
fprintf(stderr, "FILESYSTEM directory at SecID=%d (remain=%d)\n", (Position() - HEAD_SIZE)/BIG_BLOCK_SIZE, Position() % BIG_BLOCK_SIZE);
#endif
DumpNode(GetRootEntry());
for(NodeList_Itor_t node = node_list.begin(); node != node_list.end(); node++)
DumpNode(*(*node));
return errcode;
}
/*
***********************************
***********************************
*/
int COleDoc::DumpOleFile(void)
{
blocks bks;
int errcode = NO_ERRORS;
bks = GetBATCount();
unsigned32_t total_data_size = GetTotalDataSize();
errcode |= DumpHeader(bks, total_data_size);
assert((Position() % 512) == 0 /*1*/);
errcode |= DumpData();
assert((Position() % 512) == 0 /*2*/);
errcode |= DumpDepots(bks);
assert((Position() % 512) == 0 /*3*/);
errcode |= DumpFileSystem();
assert((Position() % 512) == 0 /*3*/);
return errcode;
}
/***************************************************************
*****************************************************************/
blocks COleDoc::GetBATCount()
{
blocks bks;
unsigned32_t bat_num_entries, data_bat_entries, bat_num_blocks, dir_bat_entries, bat_blocks_needed, bat_block_capacity;
unsigned32_t extra_bats, msat_blocks, msat_bats, last_block_extras;
memset(&bks, 0, sizeof(bks));
data_bat_entries = GetTotalDataSize()/BIG_BLOCK_SIZE; // + GetNumDataFiles(); //terminator???
assert(GetTotalDataSize() == (data_bat_entries * BIG_BLOCK_SIZE) );
// Block allocation strategy. Within the OLE header are 109 slots for BAT Sectors.
// But, when the file gets big, you run out (127 sectors in each BAT Sector). So,
// the 110th BAT has to go into a special block dedicated to hold these. One additional
// block gets you 127 more BAT entries, and so forth.
dir_bat_entries = 1; // Last block is directory, this is the terminator that says dir uses only one sector
bat_num_blocks = 1; // seed to enter loop below
bat_block_capacity = 0;
msat_blocks = 0;
msat_bats = 0;
bat_num_entries = 0; // kch
bat_blocks_needed = data_bat_entries/BAT_ENTRIES_PER_BLOCK; // minimum
bat_blocks_needed += bat_blocks_needed/BAT_ENTRIES_PER_BLOCK; // for the BAT itself
// first loop assumes no MSATs involved
while(bat_num_blocks > bat_block_capacity || bat_num_blocks != bat_blocks_needed) {
bat_num_blocks = bat_blocks_needed;
if(bat_num_blocks > HEADER_SAT_SIZE) {
msat_bats = bat_num_blocks - HEADER_SAT_SIZE;
msat_blocks = msat_bats/BAT_BLOCKS_PER_MSAT_BLOCK;
if(msat_bats % BAT_BLOCKS_PER_MSAT_BLOCK) ++msat_blocks;
}
bat_num_entries = msat_blocks + data_bat_entries + bat_num_blocks + dir_bat_entries; // bat_bat_entries
// based on what we know now, this is what we need
bat_blocks_needed = bat_num_entries/BAT_ENTRIES_PER_BLOCK;
if(bat_num_entries % BAT_ENTRIES_PER_BLOCK) ++bat_blocks_needed;
// number of slots available
bat_block_capacity = HEADER_SAT_SIZE + BAT_BLOCKS_PER_MSAT_BLOCK*msat_blocks;
#if OLE_DEBUG
fprintf(stderr, "bat_blocks=%d capacity=%d needed=%d\n", bat_num_blocks, bat_block_capacity, bat_blocks_needed);
#endif
}
if(bat_num_blocks > HEADER_SAT_SIZE) {
extra_bats = bat_num_blocks - HEADER_SAT_SIZE;
bks.msat_count = msat_blocks;
bks.header_bat_count = HEADER_SAT_SIZE;
bks.extra_bat_count = extra_bats;
last_block_extras = extra_bats % BAT_BLOCKS_PER_MSAT_BLOCK;
if(last_block_extras) {
bks.extra_fill = BAT_BLOCKS_PER_MSAT_BLOCK - last_block_extras;
}
} else {
bks.header_bat_count = bat_num_blocks;
bks.header_fill = HEADER_SAT_SIZE - bat_num_blocks;
}
bks.bat_entries = bat_num_entries;
bks.bat_count = bat_num_blocks;
#if OLE_DEBUG
fprintf(stderr, "entries=%u bats=%d msats=%d headerBats=%d extraBats=%d headFill=%d extraFill=%d\n", bks.bat_entries,
bks.bat_count, bks.msat_count, bks.header_bat_count, bks.extra_bat_count, bks.header_fill, bks.extra_fill);
#endif
return bks;
}
/*
***********************************
***********************************
*/
// NOTE: name_unicode has to be deleted after this function finishes.
// Ideally, this function should be implemented as part of a std::string
// derived class, so the array would be deleted automatically
signed16_t COleDoc::GetUnicodeName(const char* name, char** ppname_unicode)
{
unsigned16_t name_size = strlen(name);
if(name_size > PROPERTY_MAX_NAME_LENGTH)
name_size = PROPERTY_MAX_NAME_LENGTH;
unsigned8_t size_unicode = (name_size+1)*2;
if(*ppname_unicode != NULL) delete[] *ppname_unicode;
*ppname_unicode = (char*)new unsigned8_t[size_unicode];
memset(*ppname_unicode, 0x00, size_unicode);
for(int i=0; i<(size_unicode/2-1); i++)
(*ppname_unicode)[2*i] = name[i];
return size_unicode;
}
/*
***********************************
***********************************
*/
int COleDoc::DumpNode(COleProp& node)
{
int errcode = NO_ERRORS;
char* name_unicode = NULL;
// Get the unicode name and its size
signed16_t size_name = GetUnicodeName(node.GetName().c_str(), &name_unicode);
// [00] PROPERTY_NAME
WriteByteArray((const unsigned8_t*)name_unicode, size_name);
// Fill the rest of the name field with 0x00
SerializeFixedArray(PROPERTY_DFLT_NOTUSED, PPTPOS_NAMELENGTH - size_name);
// [40] NAME_SIZE
WriteSigned16(size_name);
// [42] PROPERTY_TYPE
WriteByte(node.GetType());
// [43] NODE_COLOR
WriteByte(node.GetColor());
// [44] PREVIOUS_PROP
WriteSigned32(node.GetPreviousIndex());
// [48] NEXT_PROP
WriteSigned32(node.GetNextIndex());
// [4c] CHILD_PROP
WriteSigned32(node.GetChildIndex());
// Fill empty block
SerializeFixedArray(PROPERTY_DFLT_NOTUSED, (PPTPOS_SECS1 - PPTPOS_UNUSED_EMPTY0));
//[64]...[70]
// SECONDS_1, DAYS_2, SECONDS_2, DAYS_2
WriteSigned32(node.GetCreatedSecs());
WriteSigned32(node.GetCreatedDays());
WriteSigned32(node.GetModifiedDays());
WriteSigned32(node.GetModifiedSecs());
// [74] START_BLOCK
#if OLE_DEBUG
fprintf(stderr, "START_BLOCK_1=%d\n", node.GetStartBlock() );
#endif
WriteSigned32(node.GetStartBlock());
// [78] SIZE
if(node.GetType() == PTYPE_FILE)
WriteSigned32(node.GetSize());
else
WriteSigned32(0);
// A unused space:
WriteSigned32(PROPERTY_DFLT_NOTUSED);
delete[] name_unicode;
name_unicode = NULL;
return errcode;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: oledoc.cpp,v $
* Revision 1.3 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.2 2004/09/01 00:47:04 darioglz
* + Modified to gain independence of target
*
* Revision 1.1.1.1 2004/08/27 16:31:43 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

523
uppdev/XLS/olefs.cpp Normal file
View file

@ -0,0 +1,523 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/oledoc/olefs.cpp,v $
* $Revision: 1.3 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <string>
#include <XLS/ole/olefs.h>
#include <XLS/stringtok.h>
using namespace std;
using namespace xlslib_core;
/*
***********************************
COleFileSystem class Implementation
***********************************
*/
COleFileSystem::COleFileSystem()
:m_RootEntry((signed32_t)0,string("Root Entry")),
m_nProperty_Count(0)
{
m_RootEntry.SetType(PTYPE_ROOT);
m_RootEntry.SetSize(0);
m_RootEntry.SetPreviousIndex( PLINK_EMPTY);
m_RootEntry.SetNextIndex( PLINK_EMPTY);
m_RootEntry.SetChildIndex( PLINK_EMPTY);
m_RootEntry.SetStartBlock( PBLOCK_END);
m_RootEntry.SetColor(PROPERTY_COLOR_NODE_BLACK);
m_RootEntry.SetDataPointer(NULL);
m_RootEntry.SetCreatedSecs(PPT_DFLT_SECS1);
m_RootEntry.SetCreatedDays(PPT_DFLT_DAYS1);
m_RootEntry.SetModifiedSecs(PPT_DFLT_SECS2);
m_RootEntry.SetModifiedDays(PPT_DFLT_DAYS2);
}
COleFileSystem::~COleFileSystem()
{
}
/*
***********************************
***********************************
*/
int COleFileSystem::GetNode(string const &path, Tree_Level_Itor_t& node)
{
StringList_t path_list;
stringtok(path_list, path, "/");
int retval = SearchNode(&m_RootEntry, path_list, node);
// Delete dinamically created strings of path_list
// anyway the list is deleted iside SearchNode...
for (StringListItor_t pl = path_list.begin(); pl != path_list.end(); pl++)
delete *pl;
return retval;
}
/*
***********************************
***********************************
*/
int COleFileSystem::SearchNode(COleProp* base_node, StringList_t& path_list, Tree_Level_Itor_t& node_level)
{
int errcode = FS_INVALID_PATH;
if(!((base_node->m_Child_List).empty()))
{
for (StringListItor_t node_name = path_list.begin(); node_name != path_list.end(); ++node_name)
for(node_level = (base_node->m_Child_List).begin(); node_level != (base_node->m_Child_List).end(); node_level++)
{
if (**node_name == (*node_level)->GetName())
{
delete path_list.front();
path_list.pop_front(); // Remove the found element from path
if(path_list.empty()) // If it was the last element return it
{
return FS_NO_ERRORS;
}
else
{ // Recursively continue the search
return SearchNode(*node_level, path_list, node_level);
}
}
}
}
return errcode;
}
/*
***********************************
***********************************
*/
int COleFileSystem::AddDirectory(string const &dir_path)
{
int errcode = NO_ERRORS;
StringList_t path_list;
stringtok(path_list, dir_path, "/");
errcode = AddNode(&m_RootEntry, path_list);
// Delete dinamically created strings of path_list
for (StringListItor_t pl = path_list.begin(); pl != path_list.end(); pl++)
delete *pl;
if(errcode == FS_NO_ERRORS)
{
Tree_Level_Itor_t newnode;
GetNode(dir_path, newnode);
(*newnode)->SetChildIndex(PLINK_EMPTY);
(*newnode)->SetType(PTYPE_DIRECTORY);
(*newnode)->SetSize(0);
(*newnode)->SetColor(PROPERTY_COLOR_NODE_BLACK);
(*newnode)->SetDataPointer(NULL);
(*newnode)->SetCreatedSecs(PPT_DFLT_SECS1);
(*newnode)->SetCreatedDays(PPT_DFLT_DAYS1);
(*newnode)->SetModifiedSecs(PPT_DFLT_SECS2);
(*newnode)->SetModifiedDays(PPT_DFLT_DAYS2);
}
return errcode;
}
/*
***********************************
***********************************
*/
#define MIN_DATA_SIZE (0x1000)
// TODO: Change the DataStorage pass-argument
int COleFileSystem::AddFile(string const &dir_path, CDataStorage* pdata)
{
int errcode = NO_ERRORS;
StringList_t path_list;
// NOTE: Token analysis can be done inside of AddNode:
stringtok(path_list, dir_path, "/");
errcode = AddNode(&m_RootEntry, path_list);
// Delete dinamically created strings of path_list
for (StringListItor_t pl = path_list.begin(); pl != path_list.end(); pl++)
delete *pl;
if(errcode == FS_NO_ERRORS)
{
Tree_Level_Itor_t newnode;
GetNode(dir_path, newnode);
(*newnode)->SetType(PTYPE_FILE);
(*newnode)->SetChildIndex(PLINK_EMPTY);
// Calculate the trail data size needed to complete a BIG_BLOCK
unsigned32_t trail_size = (pdata->GetDataSize() % BIG_BLOCK_SIZE)?
(BIG_BLOCK_SIZE - (pdata->GetDataSize() % BIG_BLOCK_SIZE)):0;
// This library won't use Small Blocks, so all data elements shall be >0x1000
if ((trail_size + pdata->GetDataSize()) < MIN_DATA_SIZE)
{
trail_size = MIN_DATA_SIZE - pdata->GetDataSize();
(*newnode)->SetSize(MIN_DATA_SIZE);
}
else
{
// The size stored in the node is the actual size of the data (not the filled-to-bigblock one)
(*newnode)->SetSize(pdata->GetDataSize() + trail_size);
}
// create the trail data unit.
CUnit* ptraildata = new CUnit;
ptraildata->AddFixedDataArray(0x00, trail_size);
(*pdata) += ptraildata;
(*newnode)->SetDataPointer(pdata);
(*newnode)->SetColor(PROPERTY_COLOR_NODE_BLACK);
(*newnode)->SetCreatedSecs(PPT_DFLT_SECS1);
(*newnode)->SetCreatedDays(PPT_DFLT_DAYS1);
(*newnode)->SetModifiedSecs(PPT_DFLT_SECS2);
(*newnode)->SetModifiedDays(PPT_DFLT_DAYS2);
}
return errcode;
}
/*
***********************************
***********************************
*/
/*
Some special adding-node cases:
- The path to reach the node doesn't exist
- The the node already exists
*/
int COleFileSystem::AddNode(COleProp* base_node, StringList_t& path_list)
{
int errcode;
if(!(base_node->m_Child_List).empty())
{
for(Tree_Level_Itor_t node_child = (base_node->m_Child_List).begin();
node_child != (base_node->m_Child_List).end(); node_child++)
{
if((*node_child)->GetName() == **path_list.begin())
{
delete path_list.front();
path_list.pop_front(); // Remove the found element from path
return AddNode(*node_child, path_list);
}
}
}
//if the path element wasn't found, the program gets here
//... and we have two possible reasons:
// 1. The path isn't correct, so no node is created and an error msg have to be returned
// (one of the intermediate nodes is empty or doesn't exist: there are more than one path elements left)
// 2. The node is the new one we want to create.
// if the size of the path is 0, the node already existed
if(path_list.size() != 1)
{
if (path_list.size() == 0)
errcode = FS_NODE_ALREADY_EXISTS;
else
errcode = FS_INVALID_PATH;
}
else
{
unsigned8_t base_node_type = base_node->GetType();
if(base_node_type == PTYPE_DIRECTORY || base_node_type == PTYPE_ROOT)
{
#if 0
COleProp newnode(++m_nProperty_Count, *path_list.begin());
bool was_firstborn = false;
if((base_node->m_Child_List).empty()) //if this is the first child of the node...
{
base_node->SetChildIndex(m_nProperty_Count); // the new one is the child
newnode.SetPreviousIndex(PLINK_EMPTY); // there is no previous
was_firstborn = true;// mark for later
}
// The next-index of the new node shall to point to nowhere
newnode.SetNextIndex(PLINK_EMPTY);
(base_node->m_Child_List).push_back(newnode);
// Get the just added node
Tree_Level_Itor_t nodeadded = (base_node->m_Child_List).end();
nodeadded--;
// Get the previous to the just added node
Tree_Level_Itor_t prev_to_nodeadded = (base_node->m_Child_List).end();
prev_to_nodeadded--;prev_to_nodeadded--;
if(!was_firstborn)
nodeadded->SetPreviousIndex(prev_to_nodeadded->GetIndex());
// Set the next-index of the previous node to point to the newone
prev_to_nodeadded->SetNextIndex(nodeadded->GetIndex());
#else
////////////
COleProp* newnode = new COleProp(++m_nProperty_Count, **path_list.begin());
size_t childnum = (base_node->m_Child_List).size();
if(!(base_node->m_Child_List).empty()) //if this is the first child of the node...
{
Tree_Level_Itor_t lastnode = (base_node->m_Child_List).end();
lastnode--;
if(1 == childnum)
{
base_node->SetChildIndex(newnode->GetIndex()); // The 2nd child is the entry always
newnode->SetPreviousIndex((*lastnode)->GetIndex()); // The previous is the only element of the list
}
else
{
(*lastnode)->SetNextIndex(newnode->GetIndex());
newnode->SetPreviousIndex(PLINK_EMPTY); // there is no previous
}
newnode->SetNextIndex(PLINK_EMPTY); // there is no next
newnode->SetChildIndex(PLINK_EMPTY); // there is no child
}
else
{
base_node->SetChildIndex(m_nProperty_Count); // the new one is the child
newnode->SetPreviousIndex(PLINK_EMPTY); // there is no previous
newnode->SetNextIndex(PLINK_EMPTY); // there is no next
newnode->SetChildIndex(PLINK_EMPTY); // there is no child
}
(base_node->m_Child_List).push_back(newnode);
#endif
errcode = FS_NO_ERRORS;
}
else
{
errcode = FS_NODE_NOT_A_DIRECTORY;
}
}
return errcode;
}
/*
***********************************
***********************************
*/
void COleFileSystem::GetAllNodes(NodeList_t& node_list)
{
GetAllNodesList(node_list, &m_RootEntry);
SortList(node_list);
}
/*
***********************************
***********************************
*/
void COleFileSystem::GetAllNodesList(NodeList_t& node_list, COleProp* base_node)
{
if(!(base_node->m_Child_List).empty())
{
for(Tree_Level_Itor_t child_node = (base_node->m_Child_List).begin();
child_node != (base_node->m_Child_List).end(); child_node++ )
{
GetAllNodesList(node_list, (*child_node));
node_list.push_back((*child_node));
}
}
else
{
return;
}
}
/*
***********************************
An horribly inefficient sorting routine....
... until I find the way of using the list<T>::sort() function so
I can specify the sorting criteria (for this case, a member variable
of the elements of the list.
***********************************
*/
void COleFileSystem::SortList(NodeList_t& node_list)
{
NodeList_t node_list_shadow = node_list;
node_list.erase(node_list.begin(), node_list.end());
NodeList_Itor_t i;
int index = 1;
do{
for(i = node_list_shadow.begin(); i != node_list_shadow.end(); i++)
{
if((*i)->GetIndex() == index)
{
node_list.push_back(*i);
node_list_shadow.erase(i);
index++;
break;
}
}
}while(!node_list_shadow.empty());
}
/*
***********************************
***********************************
*/
unsigned32_t COleFileSystem::GetTotalDataSize()
{
NodeList_t node_list;
GetAllNodes(node_list);
unsigned32_t total_size = 0;
for(NodeList_Itor_t i = node_list.begin(); i != node_list.end(); i++)
{
if((*i)->GetType() == PTYPE_FILE)
total_size += (*i)->GetDataPointer()->GetDataSize();
}
return total_size;
}
/*
***********************************
***********************************
*/
unsigned32_t COleFileSystem::GetNumDataFiles()
{
NodeList_t node_list;
GetAllNodes(node_list);
unsigned32_t total_files = 0;
for(NodeList_Itor_t i = node_list.begin(); i != node_list.end(); i++)
{
if((*i)->GetType() == PTYPE_FILE)
total_files ++;
}
return total_files;
}
/*
***********************************
***********************************
*/
COleProp& COleFileSystem::GetRootEntry()
{
return m_RootEntry;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: olefs.cpp,v $
* Revision 1.3 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.2 2004/09/01 00:47:04 darioglz
* + Modified to gain independence of target
*
* Revision 1.1.1.1 2004/08/27 16:31:43 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

412
uppdev/XLS/oleprop.cpp Normal file
View file

@ -0,0 +1,412 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/oledoc/oleprop.cpp,v $
* $Revision: 1.3 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/ole/oleprop.h>
/*
***********************************
COleProp class Implementation
***********************************
*/
using namespace std;
using namespace xlslib_core;
COleProp::COleProp()
: m_pData(NULL)
{
}
/*
***********************************
***********************************
*/
COleProp::COleProp(signed32_t node_index,
string name,
CDataStorage* data)
: m_sName(name), m_pData(data), m_nIndex(node_index)
{
}
COleProp::~COleProp()
{
for(Tree_Level_Itor_t chld = m_Child_List.begin(); chld != m_Child_List.end(); chld++)
delete *chld;
}
/*
***********************************
***********************************
*/
int COleProp::Init(signed32_t node_index,
string name,
CDataStorage* data)
{
int errcode = NO_ERRORS;
SetName(name);
m_pData = data;
m_nIndex = node_index;
return errcode;
}
/*
***********************************
***********************************
*/
int COleProp::SetName(string name)
{
int errcode = NO_ERRORS;
m_nNameSize = name.size() + 1;
m_sName = name;
return errcode;
}
/*
***********************************
***********************************
*/
string COleProp::GetName(void)
{
return m_sName;
}
/*
***********************************
***********************************
*/
int COleProp::SetIndex(signed32_t newindex)
{
int errcode = NO_ERRORS;
m_nIndex = newindex;
return errcode;
}
/*
***********************************
***********************************
*/
signed32_t COleProp::GetIndex(void)
{
return m_nIndex;
}
/*
***********************************
***********************************
*/
int COleProp::SetType(unsigned8_t newtype)
{
int errcode = NO_ERRORS;
m_nPropType = newtype;
return errcode;
}
/*
***********************************
***********************************
*/
unsigned8_t COleProp::GetType(void)
{
return m_nPropType;
}
/*
***********************************
***********************************
*/
int COleProp::SetColor(unsigned8_t newcolor)
{
int errcode = NO_ERRORS;
m_nNodeColor = newcolor;
return errcode;
}
/*
***********************************
***********************************
*/
unsigned8_t COleProp::GetColor(void)
{
return m_nNodeColor;
}
/*
***********************************
***********************************
*/
int COleProp::SetPreviousIndex(signed32_t prev)
{
int errcode = NO_ERRORS;
m_nPrevPropIndex = prev;
return errcode;
}
/*
***********************************
***********************************
*/
signed32_t COleProp::GetPreviousIndex(void)
{
return m_nPrevPropIndex;
}
/*
***********************************
***********************************
*/
int COleProp::SetNextIndex(signed32_t next)
{
int errcode = NO_ERRORS;
m_nNextPropIndex = next;
return errcode;
}
/*
***********************************
***********************************
*/
signed32_t COleProp::GetNextIndex(void)
{
return m_nNextPropIndex;
}
/*
***********************************
***********************************
*/
int COleProp::SetChildIndex(signed32_t child)
{
int errcode = NO_ERRORS;
m_nChildPropIndex = child;
return errcode;
}
/*
***********************************
***********************************
*/
signed32_t COleProp::GetChildIndex(void)
{
return m_nChildPropIndex;
}
int COleProp::SetStartBlock(signed32_t sb)
{
int errcode = NO_ERRORS;
m_nStartBlock = sb;
return errcode;
}
signed32_t COleProp::GetStartBlock(void)
{
return m_nStartBlock;
}
/*
***********************************
***********************************
*/
int COleProp::SetSize(signed32_t size)
{
int errcode = NO_ERRORS;
m_nSize = size;
return errcode;
}
/*
***********************************
***********************************
*/
signed32_t COleProp::GetSize(void)
{
return m_nSize;
}
/*
***********************************
***********************************
*/
void COleProp::SetDataPointer(CDataStorage* pdata)
{
m_pData = pdata;
}
/*
***********************************
***********************************
*/
CDataStorage* COleProp::GetDataPointer(void)
{
return m_pData;
}
/*
***********************************
***********************************
*/
void COleProp::SetCreatedSecs(signed32_t secs1)
{
m_nTSCreatedSeconds = secs1;
}
/*
***********************************
***********************************
*/
signed32_t COleProp::GetCreatedSecs(void)
{
return m_nTSCreatedSeconds;
}
/*
***********************************
***********************************
*/
void COleProp::SetCreatedDays(signed32_t days1)
{
m_nTSCreatedDays = days1;
}
/*
***********************************
***********************************
*/
signed32_t COleProp::GetCreatedDays(void)
{
return m_nTSCreatedDays;
}
/*
***********************************
***********************************
*/
void COleProp::SetModifiedSecs(signed32_t secs2)
{
m_nTSModifiedSeconds = secs2;
}
/*
***********************************
***********************************
*/
signed32_t COleProp::GetModifiedSecs(void)
{
return m_nTSModifiedSeconds;
}
/*
***********************************
***********************************
*/
void COleProp::SetModifiedDays(signed32_t days2)
{
m_nTSModifiedDays = days2;
}
/*
***********************************
***********************************
*/
signed32_t COleProp::GetModifiedDays(void)
{
return m_nTSModifiedDays;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: oleprop.cpp,v $
* Revision 1.3 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.2 2004/09/01 00:47:04 darioglz
* + Modified to gain independence of target
*
* Revision 1.1.1.1 2004/08/27 16:31:43 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

93
uppdev/XLS/overnew.cpp Normal file
View file

@ -0,0 +1,93 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/common/overnew.cpp,v $
* $Revision: 1.3 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/overnew.h>
/********************************************************************
The new() operator is overloaded only for the PHP_EXTENSION version
********************************************************************/
#if 0
#include <math.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <php.h>
#ifdef __cplusplus
}
#endif
void* operator new(size_t sz) throw (std::bad_alloc)
{
void* m = emalloc(sz);
if(!m) throw std::bad_alloc();
return m;
}
void operator delete(void* m)
{
efree(m);
}
void* operator new[](size_t sz) throw (std::bad_alloc)
{
void* m = emalloc(sz);
if(!m) throw std::bad_alloc();
return m;
}
void operator delete[](void* m)
{
efree(m);
}
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: overnew.cpp,v $
* Revision 1.3 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.2 2004/09/01 00:47:04 darioglz
* + Modified to gain independence of target
*
* Revision 1.1.1.1 2004/08/27 16:32:05 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

71
uppdev/XLS/overnew.h Normal file
View file

@ -0,0 +1,71 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/common/overnew.h,v $
* $Revision: 1.3 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef OVERNEW_H
#define OVERNEW_H
#include <XLS/config.h>
#include <XLS/systype.h>
/********************************************************************
The new() operator is overloaded only for the PHP_EXTENSION version
********************************************************************/
#if 0
#include <new>
#include <cstdio>
using namespace std;
void* operator new(size_t sz) throw (std::bad_alloc);
void operator delete(void* m);
void* operator new[](size_t sz) throw (std::bad_alloc);
void operator delete[](void* m);
#endif
#endif //OVERNEW_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: overnew.h,v $
* Revision 1.3 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.2 2004/09/01 00:47:04 darioglz
* + Modified to gain independence of target
*
* Revision 1.1.1.1 2004/08/27 16:32:05 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

257
uppdev/XLS/range.cpp Normal file
View file

@ -0,0 +1,257 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/range.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/range.h>
using namespace std;
using namespace xlslib_core;
range::range(unsigned16_t row1,
unsigned16_t col1,
unsigned16_t row2,
unsigned16_t col2,
worksheet* pws,
bool atomic)
: m_Atomic(atomic), m_pWorkSheet(pws)
{
first_row = row1;
last_row = row2;
first_col = col1;
last_col = col2;
}
range::~range()
{
}
void range::cellcolor(color_name_t color)
{
unsigned16_t r,c;
for(r = first_row; r <= last_row; r++)
for(c = first_col; c <= last_col; c++)
{
cell_t* cell = m_pWorkSheet->FindCell(r,c);
cell->fillfgcolor(color);
cell->fillstyle(FILL_SOLID);
}
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
xf_i interface implementation for range class
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define SET_RANGE_FUNCTION(function, value) \
{ \
uint16_t r,c; \
for(r = first_row; r <= last_row; r++) \
for(c = first_col; c <= last_col; c++) \
{ \
cell_t* cell = m_pWorkSheet->FindCell(r,c); \
cell->function(value); \
} \
}
void range::font(font_t* fontidx)
{
SET_RANGE_FUNCTION(font, fontidx);
/*
int r,c;
for(r = first_row; r <= last_row; r++)
for(c = first_col; c <= last_col; c++)
{
cell_t* cell = m_pWorkSheet->FindCell(r,c);
cell->font(fontidx);
}
*/
}
void range::borderstyle(border_side_t side,
border_style_t style,
color_name_t color)
{
unsigned16_t r,c;
for(r = first_row; r <= last_row; r++)
for(c = first_col; c <= last_col; c++)
{
cell_t* cell = m_pWorkSheet->FindCell(r,c);
cell->borderstyle(side, style, color);
}
}
void range::format(format_number_t formatidx)
{
SET_RANGE_FUNCTION(format,formatidx);
}
void range::halign(halign_option_t ha_option)
{
SET_RANGE_FUNCTION(halign,ha_option);
}
void range::valign(valign_option_t va_option)
{
SET_RANGE_FUNCTION(valign,va_option);
}
void range::indent(indent_option_t indent_option)
{
SET_RANGE_FUNCTION(indent,indent_option);
}
void range::orientation(txtori_option_t ori_option)
{
SET_RANGE_FUNCTION(orientation,ori_option);
}
void range::fillfgcolor(color_name_t color)
{
SET_RANGE_FUNCTION(fillfgcolor,color);
}
void range::fillbgcolor(color_name_t color)
{
SET_RANGE_FUNCTION(fillbgcolor,color);
}
void range::fillstyle(fill_option_t fill)
{
SET_RANGE_FUNCTION(fillstyle,fill);
}
void range::locked(bool locked_opt)
{
SET_RANGE_FUNCTION(locked,locked_opt);
}
void range::hidden(bool hidden_opt)
{
SET_RANGE_FUNCTION(hidden,hidden_opt);
}
void range::wrap(bool wrap_opt)
{
SET_RANGE_FUNCTION(wrap,wrap_opt);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
font_i interface implementation for range class
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void range::fontname(string fntname)
{
SET_RANGE_FUNCTION(fontname,fntname);
}
void range::fontheight(unsigned16_t fntheight)
{
SET_RANGE_FUNCTION(fontheight,fntheight);
}
void range::fontbold(boldness_option_t fntboldness)
{
/*
int r,c;
for(r = first_row; r <= last_row; r++)
for(c = first_col; c <= last_col; c++)
{
cell_t* cell = m_pWorkSheet->FindCell(r,c);
cell->fontbold(fntboldness);
}
*/
SET_RANGE_FUNCTION(fontbold,fntboldness);
}
void range::fontunderline(underline_option_t fntunderline)
{
SET_RANGE_FUNCTION(fontunderline,fntunderline);
}
void range::fontscript(script_option_t fntscript)
{
SET_RANGE_FUNCTION(fontscript,fntscript);
}
void range::fontcolor(color_name_t fntcolor)
{
SET_RANGE_FUNCTION(fontcolor,fntcolor);
}
void range::fontattr(unsigned16_t attr)
{
SET_RANGE_FUNCTION(fontattr,attr);
}
void range::fontitalic(bool italic)
{
SET_RANGE_FUNCTION(fontitalic,italic);
}
void range::fontstrikeout(bool so)
{
SET_RANGE_FUNCTION(fontstrikeout,so);
}
void range::fontoutline(bool ol)
{
SET_RANGE_FUNCTION(fontoutline,ol);
}
void range::fontshadow(bool sh)
{
SET_RANGE_FUNCTION(fontshadow,sh);
/*
{
int r,c;
for(r = first_row; r <= last_row; r++)
for(c = first_col; c <= last_col; c++)
{
cell_t* cell = m_pWorkSheet->FindCell(r,c);
cell->fontshadow(sh);
}
}
*/
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: range.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:56 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

112
uppdev/XLS/range.h Normal file
View file

@ -0,0 +1,112 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/range.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef RANGE_H
#define RANGE_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/sheetrec.h>
#include <XLS/font.h>
#include <XLS/cell.h>
#include <XLS/extformat.h>
namespace xlslib_core
{
class worksheet;
class range
: public xf_i,
public font_i,
private range_t
{
public:
range(unsigned16_t row1, unsigned16_t col1,
unsigned16_t row2, unsigned16_t col2,
worksheet* pws,
bool atomic = false);
virtual ~range();
void cellcolor(color_name_t color);
private:
bool m_Atomic;
worksheet* m_pWorkSheet;
public: // xf_i interface declaration
void font(font_t* fontidx);
void format(format_number_t formatidx);
void halign(halign_option_t ha_option);
void valign(valign_option_t va_option);
void indent(indent_option_t indent_option);
void orientation(txtori_option_t ori_option);
void fillfgcolor(color_name_t color);
void fillbgcolor(color_name_t color);
void fillstyle(fill_option_t fill);
void locked(bool locked_opt);
void hidden(bool hidden_opt);
void wrap(bool wrap_opt);
void borderstyle(border_side_t side,
border_style_t style,
color_name_t color);
public: // font_i interface declaration
void fontname(std::string fntname);
void fontheight(unsigned16_t fntheight);
void fontbold(boldness_option_t fntboldness);
void fontunderline(underline_option_t fntunderline);
void fontscript(script_option_t fntscript);
void fontcolor(color_name_t fntcolor);
void fontattr(unsigned16_t attr);
void fontitalic(bool italic);
void fontstrikeout(bool so);
void fontoutline(bool ol);
void fontshadow(bool sh);
};
}
#endif //RANGE_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: range.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:49 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

485
uppdev/XLS/recdef.cpp Normal file
View file

@ -0,0 +1,485 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/recdef.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/recdef.h>
using namespace std;
using namespace xlslib_core;
/*
******************************
CBof class implementation
******************************
*/
CBof::CBof(unsigned16_t boftype)
{
SetRecordType(RECTYPE_BOF );
AddValue16(VERSION_BIFF);
AddValue16(boftype);
AddValue16(BOF_BUILD_DFLT);
AddValue16(BOF_YEAR_DFLT);
#if VERSION_BIFF == VERSION_BIFF8
AddValue32(0); //The file hystory flags are all set to zero
AddValue32(VERSION_BIFF); // The lowest BIFF version
#endif
SetRecordLength(GetDataSize()-4);
}
CBof::~CBof()
{}
/*
******************************
CEof class implementation
******************************
*/
CEof::CEof()
{
SetRecordType(RECTYPE_EOF );
SetRecordLength(GetDataSize()-4);
}
CEof::~CEof()
{
}
/*
**********************************
CCodePage class implementation
**********************************
*/
CCodePage::CCodePage(unsigned16_t boftype)
{
SetRecordType(RECTYPE_CODENAME);
AddValue16(boftype);
SetRecordLength(GetDataSize()-4);
}
CCodePage::~CCodePage()
{}
/*
**********************************
CWindow1 class implementation
**********************************
*/
CWindow1::CWindow1()
{
SetRecordType(RECTYPE_WINDOW1);
// The data of this record is hardcoded, since for file creation
// this value takes a default (window dimensions and position).
// NOTE: Doublecheck the previous statement!!
unsigned8_t recwin1[] = {0x40,0x02,0xfc,0x00,0xe0,0x37,0xe0,0x25,
0x38,0x00,0x00,0x00,0x00,0x00,0x01,0x00, 0x58,0x02};
AddDataArray(recwin1, sizeof(recwin1));
SetRecordLength(GetDataSize()-4);
}
CWindow1::~CWindow1()
{
}
/*
**********************************
CDateMode class implementation
**********************************
*/
CDateMode::CDateMode()
{
SetRecordType(RECTYPE_R1904);
#ifdef __APPLE__
AddValue16(1); // 1904
#else
AddValue16(0); // 1900
#endif
SetRecordLength(GetDataSize()-4);
}
CDateMode::~CDateMode()
{}
/*
**********************************
CWindow2 class implementation
**********************************
*/
CWindow2::CWindow2()
{
SetRecordType(RECTYPE_WINDOW2);
AddValue16(W2_DFLT_GRBIT);
AddValue16(W2_DFLT_TOPROW);
AddValue16(W2_DFLT_LEFTCOL);
#if VERSION_BIFF == VERSION_BIFF5
AddValue32(W2_DFLT_COLOR);
#else
AddValue16(0); // 0 == BLACK
AddValue16(0);
AddValue16(0); // zoom, default == 0 (W2_DFLT_ZOOMPBPREV ???)
AddValue16(0); // xoom, default == 0 (W2_DFLT_ZOOMNORMAL ???)
AddValue32(W2_DFLT_RESERVED);
#endif
SetRecordLength(GetDataSize()-4);
}
CWindow2::~CWindow2()
{
}
/*
**********************************
CDimension class implementation
**********************************
*/
CDimension::CDimension(unsigned32_t minRow, unsigned32_t maxRow, unsigned32_t minCol, unsigned32_t maxCol)
{
SetRecordType(RECTYPE_DIMENSIONS);
#if VERSION_BIFF == VERSION_BIFF5
AddValue16((unsigned26_t)minRow);
AddValue16((unsigned26_t)(maxRow+1));
#else
AddValue32(minRow);
AddValue32(maxRow+1);
#endif
AddValue16(minCol);
AddValue16(maxCol+1); // zoom, default == 0 (W2_DFLT_ZOOMPBPREV ???)
AddValue16(W2_DFLT_RESERVED);
SetRecordLength(GetDataSize()-4);
}
CDimension::~CDimension()
{
}
/*
**********************************
**********************************
*/
void CWindow2::SetSelected()
{
unsigned16_t grbitval;
GetValue16From((signed16_t*)&grbitval, W2_OFFSET_GRBIT);
grbitval |= W2_GRBITMASK_SELECTED;
SetValueAt((signed16_t)grbitval, W2_OFFSET_GRBIT);
}
/*
**********************************
**********************************
*/
void CWindow2::SetPaged()
{
unsigned16_t grbitval;
GetValue16From((signed16_t*)&grbitval, W2_OFFSET_GRBIT);
grbitval |= W2_GRBITMASK_PAGED;
SetValueAt((signed16_t)grbitval, W2_OFFSET_GRBIT);
}
/*
**********************************
**********************************
*/
void CWindow2::ClearSelected()
{
unsigned16_t grbitval;
GetValue16From((signed16_t*)&grbitval, W2_OFFSET_GRBIT);
grbitval &= (~W2_GRBITMASK_SELECTED);
SetValueAt((signed16_t)grbitval, W2_OFFSET_GRBIT);
}
/*
**********************************
**********************************
*/
void CWindow2::ClearPaged()
{
unsigned16_t grbitval;
GetValue16From((signed16_t*)&grbitval, W2_OFFSET_GRBIT);
grbitval &= (~W2_GRBITMASK_PAGED);
SetValueAt((signed16_t)grbitval, W2_OFFSET_GRBIT);
}
/*
**********************************
CPalette class implementation
**********************************
*/
/*
CPalette::CPalette()
{
SetRecordType(RECTYPE_PALETTE);
// The data of this record is hardcoded, since for file creation
// this value takes a default (Documentation says that if the BIFF
// file doesn't have a PALETTE record, it uses a default palette, but
// somehow if this record is removed Excel displays an error).
unsigned8_t palette[] =
{
0x38,0x00,0x00,0x00, 0x00,0x00,0xff,0xff,0xff,0x00,0xff,0x00,0x00,0x00,
0x00,0xff,0x00,0x00,0x00,0x00,0xff,0x00, 0xff,0xff,0x00,0x00,0xff,0x00,0xff,0x00,
0x00,0xff,0xff,0x00,0x80,0x00,0x00,0x00, 0x00,0x80,0x00,0x00,0x00,0x00,0x80,0x00,
0x80,0x80,0x00,0x00,0x80,0x00,0x80,0x00, 0x00,0x80,0x80,0x00,0xc0,0xc0,0xc0,0x00,
0x80,0x80,0x80,0x00,0x99,0x99,0xff,0x00, 0x99,0x33,0x66,0x00,0xff,0xff,0xcc,0x00,
0xcc,0xff,0xff,0x00,0x66,0x00,0x66,0x00, 0xff,0x80,0x80,0x00,0x00,0x66,0xcc,0x00,
0xcc,0xcc,0xff,0x00,0x00,0x00,0x80,0x00, 0xff,0x00,0xff,0x00,0xff,0xff,0x00,0x00,
0x00,0xff,0xff,0x00,0x80,0x00,0x80,0x00, 0x80,0x00,0x00,0x00,0x00,0x80,0x80,0x00,
0x00,0x00,0xff,0x00,0x00,0xcc,0xff,0x00, 0xcc,0xff,0xff,0x00,0xcc,0xff,0xcc,0x00,
0xff,0xff,0x99,0x00,0x99,0xcc,0xff,0x00, 0xff,0x99,0xcc,0x00,0xcc,0x99,0xff,0x00,
0xe3,0xe3,0xe3,0x00,0x33,0x66,0xff,0x00, 0x33,0xcc,0xcc,0x00,0x99,0xcc,0x00,0x00,
0xff,0xcc,0x00,0x00,0xff,0x99,0x00,0x00, 0xff,0x66,0x00,0x00,0x66,0x66,0x99,0x00,
0x96,0x96,0x96,0x00,0x00,0x33,0x66,0x00, 0x33,0x99,0x66,0x00,0x00,0x33,0x00,0x00,
0x33,0x33,0x00,0x00,0x99,0x33,0x00,0x00, 0x99,0x33,0x66,0x00,0x33,0x33,0x99,0x00,
0x33,0x33,0x33,0x00
};
AddDataArray(palette, sizeof(palette));
SetRecordLength(GetDataSize()-4);
}
CPalette::~CPalette()
{
}
*/
/*
******************************
CStyle class implementation
******************************
*/
#define STYLE_BUILTIN_NORMAL ((unsigned8_t)0x00)
#define STYLE_BUILTIN_ROWLEVELN ((unsigned8_t)0x01)
#define STYLE_BUILTIN_COLLEVELN ((unsigned8_t)0x02)
#define STYLE_BUILTIN_COMMA ((unsigned8_t)0x03)
#define STYLE_BUILTIN_CURRENCY ((unsigned8_t)0x04)
#define STYLE_BUILTIN_PERCENT ((unsigned8_t)0x05)
#define STYLE_BUILTIN_COMMAT ((unsigned8_t)0x06)
#define STYLE_BUILTIN_CURRENCYT ((unsigned8_t)0x07)
#define STYLE_BUILTIN_BIT ((unsigned16_t)0x8000)
#define STYLE_LEVEL_DUMMY ((unsigned8_t)0x00)
CStyle::CStyle(style_t* styledef)
{
// TODO: Implement user-defined styles. So far only built-in are used.
SetRecordType(RECTYPE_STYLE);
AddValue16(styledef->xfindex|STYLE_BUILTIN_BIT);
AddValue8(styledef->builtintype);
AddValue8(STYLE_LEVEL_DUMMY);
SetRecordLength(GetDataSize()-4);
}
CStyle::CStyle(unsigned16_t xfindex, unsigned8_t builtintype)
{
// TODO: Implement user-defined styles. So far only built-in are used.
SetRecordType(RECTYPE_STYLE);
AddValue16(xfindex|STYLE_BUILTIN_BIT);
AddValue8(builtintype);
AddValue8(STYLE_LEVEL_DUMMY);
SetRecordLength(GetDataSize()-4);
}
CStyle::~CStyle()
{
}
/*
******************************
CBSheet class implementation
******************************
*/
CBSheet::CBSheet(unsigned32_t streampos,
unsigned16_t attributes,
string& sheetname)
{
SetRecordType(RECTYPE_BOUNDSHEET);
AddValue32(streampos);
AddValue16(attributes);
#if VERSION_BIFF == VERSION_BIFF5
AddValue8((unsigned8_t)sheetname.size());
AddDataArray((unsigned8_t*)sheetname.c_str(), sheetname.size());
#endif
#if VERSION_BIFF == VERSION_BIFF8
AddUnicodeStrlen((unsigned8_t)sheetname.size());
AddUnicodeString((unsigned8_t* )sheetname.c_str(), sheetname.size());
#endif
SetRecordLength(GetDataSize()-4);
}
#if VERSION_BIFF == VERSION_BIFF8
CBSheet::CBSheet(unsigned32_t streampos,
unsigned16_t attributes,
ustring& sheetname
#ifdef HAVE_ICONV
, string& iconv_code
#endif
) {
SetRecordType(RECTYPE_BOUNDSHEET);
AddValue32(streampos);
AddValue16(attributes);
#ifdef HAVE_ICONV
u16string u16sheetname;
Conv32to16(iconv_code, sheetname, u16sheetname);
// size_t outSize, resultSize;
// size_t iconv (iconv_t cd, char **restrict inbuf, size_t *restrict inbytesleft, char **restrict outbuf, size_t *restrict outbytesleft);
AddUnicodeStrlen((unsigned8_t)u16sheetname.size());
AddUnicodeString((unsigned16_t* )u16sheetname.c_str(), u16sheetname.size());
#else
AddUnicodeStrlen((unsigned8_t)sheetname.size());
AddUnicodeString((unsigned16_t* )sheetname.c_str(), sheetname.size());
#endif
SetRecordLength(GetDataSize()-4);
}
#endif
CBSheet::CBSheet(boundsheet_t* bsheetdef)
{
SetRecordType(RECTYPE_BOUNDSHEET);
AddValue32(bsheetdef->streampos);
// Set the flags in the attribute variables
unsigned16_t attrflags = 0;
attrflags |= bsheetdef->worksheet? BSHEET_ATTR_WORKSHEET:0;
attrflags |= bsheetdef->ex4macro? BSHEET_ATTR_EX4MACRO:0;
attrflags |= bsheetdef->chart? BSHEET_ATTR_CHART:0;
attrflags |= bsheetdef->vbmodule? BSHEET_ATTR_VBMODULE:0;
attrflags |= bsheetdef->visible? BSHEET_ATTR_VISIBLE:0;
attrflags |= bsheetdef->hidden? BSHEET_ATTR_HIDDEN:0;
attrflags |= bsheetdef->veryhidden? BSHEET_ATTR_VERYHIDDEN:0;
AddValue16(attrflags);
#if VERSION_BIFF == VERSION_BIFF5
AddValue8((unsigned8_t)bsheetdef->sheetname.size());
AddDataArray((unsigned8_t*)((bsheetdef->sheetname).c_str()), (bsheetdef->sheetname).size());
#endif
#if VERSION_BIFF == VERSION_BIFF8
if(bsheetdef->asheetname.size()) {
AddUnicodeStrlen((unsigned8_t)bsheetdef->asheetname.size());
AddUnicodeString((unsigned8_t*)((bsheetdef->asheetname).c_str()), (bsheetdef->asheetname).size());
} else {
#ifdef HAVE_ICONV
u16string u16sheetname;
Conv32to16(bsheetdef->iconv_code, bsheetdef->usheetname, u16sheetname);
AddUnicodeStrlen((unsigned8_t)u16sheetname.size());
AddUnicodeString((unsigned16_t* )u16sheetname.c_str(), u16sheetname.size());
#else
AddUnicodeStrlen((unsigned8_t)bsheetdef->usheetname.size());
AddUnicodeString((unsigned16_t*)(bsheetdef->usheetname.c_str()), (bsheetdef->usheetname).size());
#endif
}
#endif
SetRecordLength(GetDataSize()-4);
}
CBSheet::~CBSheet()
{
}
/*
**********************************
**********************************
*/
void CBSheet::SetStreamPosition(unsigned32_t pos)
{
SetValueAt((signed32_t)pos, BSHEET_OFFSET_POSITION);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: recdef.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:48 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

325
uppdev/XLS/recdef.h Normal file
View file

@ -0,0 +1,325 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/recdef.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef RECDEF_H
#define RECDEF_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/rectypes.h>
#include <XLS/record.h>
namespace xlslib_core
{
/*
******************************
CBof class declaration
******************************
*/
#define BOF_TYPE_WBGLOBALS ((unsigned16_t)0x0005)
#define BOF_TYPE_VBMODULE ((unsigned16_t)0x0006)
#define BOF_TYPE_WORKSHEET ((unsigned16_t)0x0010)
#define BOF_TYPE_CHART ((unsigned16_t)0x0020)
#define BOF_TYPE_EXCEL4_MACROSH ((unsigned16_t)0x0040)
#define BOF_TYPE_WSFILE ((unsigned16_t)0x0100)
#define BOF_BUILD_DFLT ((unsigned16_t)0x1d5f)
#define BOF_YEAR_DFLT ((unsigned16_t)0x07cd)
#define CODEPAGE_IBMPC ((unsigned16_t)0x01b5)
#define CODEPAGE_APPLE ((unsigned16_t)0x8000)
#define CODEPAGE_ANSI ((unsigned16_t)0x04e4)
#define BOF_RECORD_SIZE (12)
class CBof: public CRecord
{
protected:
public:
CBof(unsigned16_t boftype);
~CBof();
};
/*
******************************
CEof class declaration
******************************
*/
class CEof: public CRecord
{
protected:
public:
CEof();
~CEof();
};
/*
******************************
CCodePage class declaration
******************************
*/
class CCodePage: public CRecord
{
protected:
public:
CCodePage(unsigned16_t boftype);
~CCodePage();
};
/*
******************************
CWindow1 class declaration
******************************
*/
class CWindow1: public CRecord
{
protected:
public:
CWindow1();
~CWindow1();
};
/*
******************************
CDateMode class declaration
******************************
*/
class CDateMode: public CRecord
{
protected:
public:
CDateMode();
~CDateMode();
};
/*
******************************
CWindow2 class declaration
******************************
*/
#define W2_OFFSET_GRBIT ((unsigned32_t)4)
#define W2_OFFSET_TOPROW ((unsigned32_t)6)
#define W2_OFFSET_LEFTCOL ((unsigned32_t)8)
#define W2_OFFSET_COLOR ((unsigned32_t)10)
#define W2_OFFSET_ZOOMPREVIEW ((unsigned32_t)14)
#define W2_OFFSET_ZOOMNORMAL ((unsigned32_t)16)
#define W2_OFFSET_RESERVED ((unsigned32_t)18)
#define W2_DFLT_TOPROW ((unsigned16_t)0x0000)
#define W2_DFLT_LEFTCOL ((unsigned16_t)0x0000)
#define W2_DFLT_COLOR ((unsigned32_t)0x00000000)
// NOTE: Check a BIFF8 example to verify the units of the two following values
#define W2_DFLT_ZOOMPBPREV ((unsigned16_t)0x0100)
#define W2_DFLT_ZOOMNORMAL ((unsigned16_t)0x0100)
#define W2_DFLT_RESERVED ((unsigned32_t)0x00000000)
// GRBIT mask-flags:
#define W2_GRBITMASK_FMLA ((unsigned16_t)0x0001)
#define W2_GRBITMASK_GRIDS ((unsigned16_t)0x0002)
#define W2_GRBITMASK_HROWCOL ((unsigned16_t)0x0004)
#define W2_GRBITMASK_FROZEN ((unsigned16_t)0x0008)
#define W2_GRBITMASK_ZEROS ((unsigned16_t)0x0010)
#define W2_GRBITMASK_DFLTHDRCOLOR ((unsigned16_t)0x0020)
#define W2_GRBITMASK_ARABIC ((unsigned16_t)0x0040)
#define W2_GRBITMASK_GUTS ((unsigned16_t)0x0080)
#define W2_GRBITMASK_FRZNOSPLIT ((unsigned16_t)0x0100)
#define W2_GRBITMASK_SELECTED ((unsigned16_t)0x0200)
#define W2_GRBITMASK_PAGED ((unsigned16_t)0x0400)
#define W2_GRBITMASK_SLV ((unsigned16_t)0x0800)
#define W2_GRBITMASK_RESERVED ((unsigned16_t)0xf000)
// NOTE: Hardcoded from an excel example
#define W2_DFLT_GRBIT ((unsigned16_t)0x06b6)
/*
#define W2_DFLT_GRBIT ((unsigned16_t) \
(W2_GRBITMASK_GRIDS|W2_GRBITMASK_HROWCOL|W2_GRBITMASK_DFLTHDRCOLOR))
*/
class CWindow2: public CRecord
{
private:
public:
// TODO: Create a constructor that gets user-defined arguments that specify the appearence
// The following constructor stablishes default values.
CWindow2();
~CWindow2();
void SetSelected();
void SetPaged();
void ClearSelected();
void ClearPaged();
};
/*
******************************
CDimension class declaration
******************************
*/
class CDimension: public CRecord
{
protected:
public:
CDimension(unsigned32_t minRow, unsigned32_t maxRow, unsigned32_t minCol, unsigned32_t maxCol);
~CDimension();
};
/*
******************************
CStyle class declaration
******************************
*/
typedef struct
{
unsigned16_t xfindex;
unsigned8_t builtintype;
} style_t;
typedef std::list<xlslib_core::style_t* XLSLIB_DFLT_ALLOCATOR> Style_List_t;
typedef Style_List_t::iterator Style_List_Itor_t;
class CStyle: public CRecord
{
protected:
public:
CStyle(unsigned16_t xfindex, unsigned8_t builtintype);
CStyle(style_t* styledef);
~CStyle();
};
/*
******************************
CBSheet class declaration
******************************
*/
#define BSHEET_OFFSET_POSITION ((unsigned32_t)4)
#define BSHEET_OFFSET_FLAGS ((unsigned32_t)8)
#define BSHEET_OFFSET_NAMELENGHT ((unsigned32_t)10)
#define BSHEET_OFFSET_B7NAME ((unsigned32_t)11)
#define BSHEET_OFFSET_B8NAME ((unsigned32_t)12)
#define BSHEET_ATTR_WORKSHEET ((unsigned16_t)0x0000)
#define BSHEET_ATTR_EX4MACRO ((unsigned16_t)0x0001)
#define BSHEET_ATTR_CHART ((unsigned16_t)0x0002)
#define BSHEET_ATTR_VBMODULE ((unsigned16_t)0x0006)
#define BSHEET_ATTR_VISIBLE ((unsigned16_t)0x0000)
#define BSHEET_ATTR_HIDDEN ((unsigned16_t)0x0100)
#define BSHEET_ATTR_VERYHIDDEN ((unsigned16_t)0x0200)
// TODO - DFH - are strings leaked????
typedef struct
{
unsigned32_t streampos;
std::string asheetname;
#if VERSION_BIFF == VERSION_BIFF8
std::ustring usheetname;
#ifdef HAVE_ICONV
std::string iconv_code;
#endif
#endif
bool _free :1;
bool worksheet:1;
bool ex4macro:1;
bool chart:1;
bool vbmodule:1;
bool visible:1;
bool hidden:1;
bool veryhidden:1;
} boundsheet_t;
typedef std::list<xlslib_core::boundsheet_t* XLSLIB_DFLT_ALLOCATOR> Boundsheet_List_t;
typedef Boundsheet_List_t::iterator Boundsheet_List_Itor_t;
class CBSheet: public CRecord
{
private:
public:
CBSheet(unsigned32_t streampos,
unsigned16_t attributes,
std::string& sheetname);
#if VERSION_BIFF == VERSION_BIFF8
CBSheet(unsigned32_t streampos,
unsigned16_t attributes,
std::ustring& sheetname
#ifdef HAVE_ICONV
, std::string& iconv_code
#endif
);
#endif
CBSheet(boundsheet_t* bsheetdef);
~CBSheet();
void SetStreamPosition(unsigned32_t pos);
};
}
#endif //RECDEF_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: recdef.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:57 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

150
uppdev/XLS/record.cpp Normal file
View file

@ -0,0 +1,150 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/record.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/record.h>
using namespace std;
using namespace xlslib_core;
/*
******************************
CRecord class implementation
******************************
*/
CRecord::CRecord()
:m_Num(RECTYPE_NULL)
{
// Initialize (and create) the space for record type
// and record length
const unsigned8_t array[] = {0,0,0,0} ;
AddDataArray(array, 4);
}
CRecord::~CRecord()
{
}
/*
******************************
******************************
*/
void CRecord::SetRecordType(unsigned16_t rtype)
{
SetValueAt((signed16_t)rtype, 0);
}
/*
******************************
******************************
*/
unsigned16_t CRecord::GetRecordType()
{
unsigned16_t value;
GetValue16From((signed16_t*)&value, 0);
return value;
}
/*
******************************
******************************
*/
void CRecord::SetRecordLength(unsigned16_t rlength)
{
SetValueAt((signed16_t)rlength, 2);
}
/*
******************************
******************************
*/
unsigned16_t CRecord::GetRecordLength()
{
unsigned16_t value;
GetValue16From((signed16_t*)&value, 2);
return value;
}
/*
******************************
******************************
*/
unsigned8_t* CRecord::GetRecordDataBuffer()
{
return GetBuffer() + 4;
}
/*
******************************
******************************
*/
unsigned32_t CRecord::GetRecordDataSize()
{
return GetDataSize() - 4;
}
/*
******************************
******************************
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: record.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:46 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

91
uppdev/XLS/record.h Normal file
View file

@ -0,0 +1,91 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/record.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef RECORD_H
#define RECORD_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/rectypes.h>
#include <XLS/unit.h>
namespace xlslib_core
{
#define VERSION_BIFF5 0x0500
#define VERSION_BIFF8 0x0600
#define VERSION_BIFF VERSION_BIFF8
/*
******************************
CRecord class declaration
******************************
*/
class CRecord: public CUnit
{
protected:
unsigned16_t m_Num;
public:
CRecord();
~CRecord();
void SetRecordType(unsigned16_t rtype);
unsigned16_t GetRecordType();
void SetRecordLength(unsigned16_t);
unsigned16_t GetRecordLength();
unsigned8_t* GetRecordDataBuffer();
unsigned32_t GetRecordDataSize();
};
}
#endif //RECORD_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: record.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:54 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

758
uppdev/XLS/rectypes.h Normal file
View file

@ -0,0 +1,758 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/rectypes.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef RECTYPES_H
#define RECTYPES_H
/*
sed -e 's/\(^\([A-Z0-9]*\)\:.*$\)/\/\* \1 \*\/\n#define RECTYPE_\2 \\/' biff_records_alpha.txt | sed -e 's/^ \([A-F0-9]*\)\h$/ ((unsigned16_t)0x\1)/' >recordtypes.h
*/
#include <XLS/config.h>
#include <XLS/systype.h>
//#define MAX_RECORD_SIZE_BIFF57 (2000)
#define MAX_RECORD_SIZE_BIFF8 (8000)
#define MAX_RECORD_SIZE MAX_RECORD_SIZE_BIFF8
/* 1904: 1904 Date System */
#define RECTYPE_NULL \
((unsigned16_t)0x00)
/* 1904: 1904 Date System */
#define RECTYPE_R1904 \
((unsigned16_t)0x22)
/* ADDIN: Workbook Is an Add-in Macro */
#define RECTYPE_ADDIN \
((unsigned16_t)0x87)
/* ADDMENU: Menu Addition */
#define RECTYPE_ADDMENU \
((unsigned16_t)0xC2)
/* ARRAY: Array-Entered Formula */
#define RECTYPE_ARRAY \
((unsigned16_t)0x221)
/* AUTOFILTER: AutoFilter Data */
#define RECTYPE_AUTOFILTER \
((unsigned16_t)0x9E)
/* AUTOFILTERINFO: Drop-Down Arrow Count */
#define RECTYPE_AUTOFILTERINFO \
((unsigned16_t)0x9D)
/* BACKUP: Save Backup Version of the File */
#define RECTYPE_BACKUP \
((unsigned16_t)0x40)
/* BLANK: Cell Value, Blank Cell */
#define RECTYPE_BLANK \
((unsigned16_t)0x201)
/* BOF: Beginning of File */
#define RECTYPE_BOF \
((unsigned16_t)0x809)
/* BOOKBOOL: Workbook Option Flag */
#define RECTYPE_BOOKBOOL \
((unsigned16_t)0xDA)
/* BOOLERR: Cell Value, Boolean or Error */
#define RECTYPE_BOOLERR \
((unsigned16_t)0x205)
/* BOTTOMMARGIN: Bottom Margin Measurement */
#define RECTYPE_BOTTOMMARGIN \
((unsigned16_t)0x29)
/* BOUNDSHEET: Sheet Information */
#define RECTYPE_BOUNDSHEET \
((unsigned16_t)0x85)
/* CALCCOUNT: Iteration Count */
#define RECTYPE_CALCCOUNT \
((unsigned16_t)0x0C)
/* CALCMODE: Calculation Mode */
#define RECTYPE_CALCMODE \
((unsigned16_t)0x0D)
/* CF
: Conditional Formatting Conditions */
#define RECTYPE_CF \
((unsigned16_t)0x1B1)
/* CONDFMT: Conditional Formatting Range Information */
#define RECTYPE_CONDFMT \
((unsigned16_t)0x1B0)
/* CODENAME: VBE Object Name */
#define RECTYPE_CODENAME \
((unsigned16_t)0x42)
/* CODEPAGE: Default Code Page */
#define RECTYPE_CODEPAGE \
((unsigned16_t)0x42)
/* COLINFO: Column Formatting Information */
#define RECTYPE_COLINFO \
((unsigned16_t)0x7D)
/* CONTINUE: Continues Long Records */
#define RECTYPE_CONTINUE \
((unsigned16_t)0x3C)
/* COORDLIST: Polygon Object Vertex Coordinates */
#define RECTYPE_COORDLIST \
((unsigned16_t)0xA9)
/* COUNTRY: Default Country and WIN.INI Country */
#define RECTYPE_COUNTRY \
((unsigned16_t)0x8C)
/* CRN: Nonresident Operands */
#define RECTYPE_CRN \
((unsigned16_t)0x5A)
/* DBCELL: Stream Offsets */
#define RECTYPE_DBCELL \
((unsigned16_t)0xD7)
/* DCON: Data Consolidation Information */
#define RECTYPE_DCON \
((unsigned16_t)0x50)
/* DCONBIN: Data Consolidation Information */
#define RECTYPE_DCONBIN \
((unsigned16_t)0x1B5)
/* DCONNAME: Data Consolidation Named References */
#define RECTYPE_DCONNAME \
((unsigned16_t)0x52)
/* DCONREF: Data Consolidation References */
#define RECTYPE_DCONREF \
((unsigned16_t)0x51)
/* DEFAULTROWHEIGHT: Default Row Height */
#define RECTYPE_DEFAULTROWHEIGHT \
((unsigned16_t)0x225)
/* DEFCOLWIDTH: Default Width for Columns */
#define RECTYPE_DEFCOLWIDTH \
((unsigned16_t)0x55)
/* DELMENU: Menu Deletion */
#define RECTYPE_DELMENU \
((unsigned16_t)0xC3)
/* DELTA: Iteration Increment */
#define RECTYPE_DELTA \
((unsigned16_t)0x10)
/* DIMENSIONS: Cell Table Size */
#define RECTYPE_DIMENSIONS \
((unsigned16_t)0x200)
/* DOCROUTE: Routing Slip Information */
#define RECTYPE_DOCROUTE \
((unsigned16_t)0xB8)
/* DSF: Double Stream File */
#define RECTYPE_DSF \
((unsigned16_t)0x161)
/* DV: Data Validation Criteria */
#define RECTYPE_DV \
((unsigned16_t)0x1BE)
/* DVAL: Data Validation Information */
#define RECTYPE_DVAL \
((unsigned16_t)0x1B2)
/* EDG: Edition Globals */
#define RECTYPE_EDG \
((unsigned16_t)0x88)
/* EOF: End of File */
#define RECTYPE_EOF \
((unsigned16_t)0x0A)
/* EXTERNCOUNT: Number of External References */
#define RECTYPE_EXTERNCOUNT \
((unsigned16_t)0x16)
/* EXTERNNAME: Externally Referenced Name */
#define RECTYPE_EXTERNNAME \
((unsigned16_t)0x223)
/* EXTERNSHEET: External Reference */
#define RECTYPE_EXTERNSHEET \
((unsigned16_t)0x17)
/* EXTSST: Extended Shared String Table */
#define RECTYPE_EXTSST \
((unsigned16_t)0xFF)
/* FILEPASS: File Is Password-Protected */
#define RECTYPE_FILEPASS \
((unsigned16_t)0x2F)
/* FILESHARING: File-Sharing Information */
#define RECTYPE_FILESHARING \
((unsigned16_t)0x5B)
/* FILESHARING2: File-Sharing Information for Shared Lists */
#define RECTYPE_FILESHARING2 \
((unsigned16_t)0x1A5)
/* FILTERMODE: Sheet Contains Filtered List */
#define RECTYPE_FILTERMODE \
((unsigned16_t)0x9B)
/* FNGROUPCOUNT: Built-in Function Group Count */
#define RECTYPE_FNGROUPCOUNT \
((unsigned16_t)0x9C)
/* FNGROUPNAME: Function Group Name */
#define RECTYPE_FNGROUPNAME \
((unsigned16_t)0x9A)
/* FONT: Font Description */
// NOTE: Changed temporarilly to 31h (the manual says is 231h)
#define RECTYPE_FONT \
((unsigned16_t)0x31)
/* FOOTER: Print Footer on Each Page */
#define RECTYPE_FOOTER \
((unsigned16_t)0x15)
/* FORMAT: Number Format */
#define RECTYPE_FORMAT \
((unsigned16_t)0x41E)
/* FORMULA: Cell Formula */
#define RECTYPE_FORMULA \
((unsigned16_t)0x406)
/* GCW: Global Column-Width Flags */
#define RECTYPE_GCW \
((unsigned16_t)0xAB)
/* GRIDSET: State Change of Gridlines Option */
#define RECTYPE_GRIDSET \
((unsigned16_t)0x82)
/* GUTS: Size of Row and Column Gutters */
#define RECTYPE_GUTS \
((unsigned16_t)0x80)
/* HCENTER: Center Between Horizontal Margins */
#define RECTYPE_HCENTER \
((unsigned16_t)0x83)
/* HEADER: Print Header on Each Page */
#define RECTYPE_HEADER \
((unsigned16_t)0x14)
/* HIDEOBJ: Object Display Options */
#define RECTYPE_HIDEOBJ \
((unsigned16_t)0x8D)
/* HLINK: Hyperlink */
#define RECTYPE_HLINK \
((unsigned16_t)0x1B8)
/* HORIZONTALPAGEBREAKS: Explicit Row Page Breaks */
#define RECTYPE_HORIZONTALPAGEBREAKS \
((unsigned16_t)0x1B)
/* IMDATA: Image Data */
#define RECTYPE_IMDATA \
((unsigned16_t)0x7F)
/* INDEX: Index Record */
#define RECTYPE_INDEX \
((unsigned16_t)0x20B)
/* INTERFACEEND: End of User Interface Records */
#define RECTYPE_INTERFACEEND \
((unsigned16_t)0xE2)
/* INTERFACEHDR: Beginning of User Interface Records */
#define RECTYPE_INTERFACEHDR \
((unsigned16_t)0xE1)
/* ITERATION: Iteration Mode */
#define RECTYPE_ITERATION \
((unsigned16_t)0x11)
/* LABEL: Cell Value, String Constant */
#define RECTYPE_LABEL \
((unsigned16_t)0x204)
/* LABELSST: Cell Value, String Constant/SST */
#define RECTYPE_LABELSST \
((unsigned16_t)0xFD)
/* LEFTMARGIN: Left Margin Measurement */
#define RECTYPE_LEFTMARGIN \
((unsigned16_t)0x26)
/* LHNGRAPH: Named Graph Information */
#define RECTYPE_LHNGRAPH \
((unsigned16_t)0x95)
/* LHRECORD: .WK? File Conversion Information */
#define RECTYPE_LHRECORD \
((unsigned16_t)0x94)
/* LPR: Sheet Was Printed Using LINE.PRINT( */
#define RECTYPE_LPR \
((unsigned16_t)0x98)
/* MMS: ADDMENU/DELMENU Record Group Count */
#define RECTYPE_MMS \
((unsigned16_t)0xC1)
/* MSODRAWING: Microsoft Office Drawing */
#define RECTYPE_MSODRAWING \
((unsigned16_t)0xEC)
/* MSODRAWINGGROUP: Microsoft Office Drawing Group */
#define RECTYPE_MSODRAWINGGROUP \
((unsigned16_t)0xEB)
/* MSODRAWINGSELECTION: Microsoft Office Drawing Selection */
#define RECTYPE_MSODRAWINGSELECTION \
((unsigned16_t)0xED)
/* MULBLANK: Multiple Blank Cells */
#define RECTYPE_MULBLANK \
((unsigned16_t)0xBE)
/* MULRK: Multiple RK Cells */
#define RECTYPE_MULRK \
((unsigned16_t)0xBD)
/* NAME: Defined Name */
#define RECTYPE_NAME \
((unsigned16_t)0x218)
/* NOTE: Comment Associated with a Cell */
#define RECTYPE_NOTE \
((unsigned16_t)0x1C)
/* NUMBER: Cell Value, Floating-Point Number */
#define RECTYPE_NUMBER \
((unsigned16_t)0x203)
/* OBJ: Describes a Graphic Object */
#define RECTYPE_OBJ \
((unsigned16_t)0x5D)
/* OBJPROTECT: Objects Are Protected */
#define RECTYPE_OBJPROTECT \
((unsigned16_t)0x63)
/* OBPROJ: Visual Basic Project */
#define RECTYPE_OBPROJ \
((unsigned16_t)0xD3)
/* OLESIZE: Size of OLE Object */
#define RECTYPE_OLESIZE \
((unsigned16_t)0xDE)
/* PALETTE: Color Palette Definition */
#define RECTYPE_PALETTE \
((unsigned16_t)0x92)
/* PANE: Number of Panes and Their Position */
#define RECTYPE_PANE \
((unsigned16_t)0x41)
/* PARAMQRY: Query Parameters */
#define RECTYPE_PARAMQRY \
((unsigned16_t)0xDC)
/* PASSWORD: Protection Password */
#define RECTYPE_PASSWORD \
((unsigned16_t)0x13)
/* PLS: Environment-Specific Print Record */
#define RECTYPE_PLS \
((unsigned16_t)0x4D)
/* PRECISION: Precision */
#define RECTYPE_PRECISION \
((unsigned16_t)0x0E)
/* PRINTGRIDLINES: Print Gridlines Flag */
#define RECTYPE_PRINTGRIDLINES \
((unsigned16_t)0x2B)
/* PRINTHEADERS: Print Row/Column Labels */
#define RECTYPE_PRINTHEADERS \
((unsigned16_t)0x2A)
/* PROTECT: Protection Flag */
#define RECTYPE_PROTECT \
((unsigned16_t)0x12)
/* PROT4REV: Shared Workbook Protection Flag */
#define RECTYPE_PROT4REV \
((unsigned16_t)0x1AF)
/* QSI: External Data Range */
#define RECTYPE_QSI \
((unsigned16_t)0x1AD)
/* RECIPNAME: Recipient Name */
#define RECTYPE_RECIPNAME \
((unsigned16_t)0xB9)
/* REFMODE: Reference Mode */
#define RECTYPE_REFMODE \
((unsigned16_t)0x0F)
/* REFRESHALL: Refresh Flag */
#define RECTYPE_REFRESHALL \
((unsigned16_t)0x1B7)
/* RIGHTMARGIN: Right Margin Measurement */
#define RECTYPE_RIGHTMARGIN \
((unsigned16_t)0x27)
/* RK: Cell Value, RK Number */
#define RECTYPE_RK \
((unsigned16_t)0x7E)
/* ROW: Describes a Row */
#define RECTYPE_ROW \
((unsigned16_t)0x208)
/* RSTRING: Cell with Character Formatting */
#define RECTYPE_RSTRING \
((unsigned16_t)0xD6)
/* SAVERECALC: Recalculate Before Save */
#define RECTYPE_SAVERECALC \
((unsigned16_t)0x5F)
/* SCENARIO: Scenario Data */
#define RECTYPE_SCENARIO \
((unsigned16_t)0xAF)
/* SCENMAN: Scenario Output Data */
#define RECTYPE_SCENMAN \
((unsigned16_t)0xAE)
/* SCENPROTECT: Scenario Protection */
#define RECTYPE_SCENPROTECT \
((unsigned16_t)0xDD)
/* SCL: Window Zoom Magnification */
#define RECTYPE_SCL \
((unsigned16_t)0xA0)
/* SELECTION: Current Selection */
#define RECTYPE_SELECTION \
((unsigned16_t)0x1D)
/* SETUP: Page Setup */
#define RECTYPE_SETUP \
((unsigned16_t)0xA1)
/* SHRFMLA: Shared Formula */
#define RECTYPE_SHRFMLA \
((unsigned16_t)0xBC)
/* SORT: Sorting Options */
#define RECTYPE_SORT \
((unsigned16_t)0x90)
/* SOUND: Sound Note */
#define RECTYPE_SOUND \
((unsigned16_t)0x96)
/* SST: Shared String Table */
#define RECTYPE_SST \
((unsigned16_t)0xFC)
/* STANDARDWIDTH: Standard Column Width */
#define RECTYPE_STANDARDWIDTH \
((unsigned16_t)0x99)
/* STRING: String Value of a Formula */
#define RECTYPE_STRING \
((unsigned16_t)0x207)
/* STYLE: Style Information */
#define RECTYPE_STYLE \
((unsigned16_t)0x293)
/* SUB: Subscriber */
#define RECTYPE_SUB \
((unsigned16_t)0x91)
/* SUPBOOK: Supporting Workbook */
#define RECTYPE_SUPBOOK \
((unsigned16_t)0x1AE)
/* SXDB: PivotTable Cache Data */
#define RECTYPE_SXDB \
((unsigned16_t)0xC6)
/* SXDBEX: PivotTable Cache Data */
#define RECTYPE_SXDBEX \
((unsigned16_t)0x122)
/* SXDI: Data Item */
#define RECTYPE_SXDI \
((unsigned16_t)0xC5)
/* SXEX: PivotTable View Extended Information */
#define RECTYPE_SXEX \
((unsigned16_t)0xF1)
/* SXEXT: External Source Information */
#define RECTYPE_SXEXT \
((unsigned16_t)0xDC)
/* SXFDBTYPE: SQL Datatype Identifier */
#define RECTYPE_SXFDBTYPE \
((unsigned16_t)0x1BB)
/* SXFILT: PivotTable Rule Filter */
#define RECTYPE_SXFILT \
((unsigned16_t)0xF2)
/* SXFORMAT: PivotTable Format Record */
#define RECTYPE_SXFORMAT \
((unsigned16_t)0xFB)
/* SXFORMULA: PivotTable Formula Record */
#define RECTYPE_SXFORMULA \
((unsigned16_t)0x103)
/* SXFMLA: PivotTable Parsed Expression */
#define RECTYPE_SXFMLA \
((unsigned16_t)0xF9)
/* SXIDSTM: Stream ID */
#define RECTYPE_SXIDSTM \
((unsigned16_t)0xD5)
/* SXIVD: Row/Column Field IDs */
#define RECTYPE_SXIVD \
((unsigned16_t)0xB4)
/* SXLI: Line Item Array */
#define RECTYPE_SXLI \
((unsigned16_t)0xB5)
/* SXNAME: PivotTable Name */
#define RECTYPE_SXNAME \
((unsigned16_t)0xF6)
/* SXPAIR: PivotTable Name Pair */
#define RECTYPE_SXPAIR \
((unsigned16_t)0xF8)
/* SXPI: Page Item */
#define RECTYPE_SXPI \
((unsigned16_t)0xB6)
/* SXRULE: PivotTable Rule Data */
#define RECTYPE_SXRULE \
((unsigned16_t)0xF0)
/* SXSTRING: String */
#define RECTYPE_SXSTRING \
((unsigned16_t)0xCD)
/* SXSELECT: PivotTable Selection Information */
#define RECTYPE_SXSELECT \
((unsigned16_t)0xF7)
/* SXTBL: Multiple Consolidation Source Info */
#define RECTYPE_SXTBL \
((unsigned16_t)0xD0)
/* SXTBPG: Page Item Indexes */
#define RECTYPE_SXTBPG \
((unsigned16_t)0xD2)
/* SXTBRGIITM: Page Item Name Count */
#define RECTYPE_SXTBRGIITM \
((unsigned16_t)0xD1)
/* SXVD: View Fields */
#define RECTYPE_SXVD \
((unsigned16_t)0xB1)
/* SXVDEX: Extended PivotTable View Fields */
#define RECTYPE_SXVDEX \
((unsigned16_t)0x100)
/* SXVI: View Item */
#define RECTYPE_SXVI \
((unsigned16_t)0xB2)
/* SXVIEW: View Definition */
#define RECTYPE_SXVIEW \
((unsigned16_t)0xB0)
/* SXVS: View Source */
#define RECTYPE_SXVS \
((unsigned16_t)0xE3)
/* TABID: Sheet Tab Index Array */
#define RECTYPE_TABID \
((unsigned16_t)0x13D)
/* TABIDCONF: Sheet Tab ID of Conflict History */
#define RECTYPE_TABIDCONF \
((unsigned16_t)0xEA)
/* TABLE: Data Table */
#define RECTYPE_TABLE \
((unsigned16_t)0x236)
/* TEMPLATE: Workbook Is a Template */
#define RECTYPE_TEMPLATE \
((unsigned16_t)0x60)
/* TOPMARGIN: Top Margin Measurement */
#define RECTYPE_TOPMARGIN \
((unsigned16_t)0x28)
/* TXO: Text Object */
#define RECTYPE_TXO \
((unsigned16_t)0x1B6)
/* UDDESC: Description String for Chart Autoformat */
#define RECTYPE_UDDESC \
((unsigned16_t)0xDF)
/* UNCALCED: Recalculation Status */
#define RECTYPE_UNCALCED \
((unsigned16_t)0x5E)
/* USERBVIEW: Workbook Custom View Settings */
#define RECTYPE_USERBVIEW \
((unsigned16_t)0x1A9)
/* USERSVIEWBEGIN: Custom View Settings */
#define RECTYPE_USERSVIEWBEGIN \
((unsigned16_t)0x1AA)
/* USERSVIEWEND: End of Custom View Records */
#define RECTYPE_USERSVIEWEND \
((unsigned16_t)0x1AB)
/* USESELFS: Natural Language Formulas Flag */
#define RECTYPE_USESELFS \
((unsigned16_t)0x160)
/* VCENTER: Center Between Vertical Margins */
#define RECTYPE_VCENTER \
((unsigned16_t)0x84)
/* VERTICALPAGEBREAKS: Explicit Column Page Breaks */
#define RECTYPE_VERTICALPAGEBREAKS \
((unsigned16_t)0x1A)
/* WINDOW1: Window Information */
#define RECTYPE_WINDOW1 \
((unsigned16_t)0x3D)
/* WINDOW2: Sheet Window Information */
#define RECTYPE_WINDOW2 \
((unsigned16_t)0x23E)
/* WINDOWPROTECT: Windows Are Protected */
#define RECTYPE_WINDOWPROTECT \
((unsigned16_t)0x19)
/* WRITEACCESS: Write Access User Name */
#define RECTYPE_WRITEACCESS \
((unsigned16_t)0x5C)
/* WRITEPROT: Workbook Is Write-Protected */
#define RECTYPE_WRITEPROT \
((unsigned16_t)0x86)
/* WSBOOL: Additional Workspace Information */
#define RECTYPE_WSBOOL \
((unsigned16_t)0x81)
/* XCT: CRN Record Count */
#define RECTYPE_XCT \
((unsigned16_t)0x59)
/* XF: Extended Format */
#define RECTYPE_XF \
((unsigned16_t)0xE0)
/* XL5MODIFY: Flag for DSF */
#define RECTYPE_XL5MODIFY \
((unsigned16_t)0x162)
/* TOOLBARHDR: Not documented */
#define RECTYPE_TOOLBARHDR \
((unsigned16_t)0xbf)
/* TOOLBAREND: Not documented */
#define RECTYPE_TOOLBAREND \
((unsigned16_t)0xc0)
/* TOOLBAREND: Not documented */
#define RECTYPE_MERGEDCELLS \
((unsigned16_t)0xe5)
#endif //RECTYPES_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: rectypes.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:51 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Binary file not shown.

Binary file not shown.

201
uppdev/XLS/row.cpp Normal file
View file

@ -0,0 +1,201 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/row.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/row.h>
using namespace std;
using namespace xlslib_core;
/*
******************************
CRow class implementation
******************************
*/
CRow::CRow(unsigned16_t rownum,
unsigned16_t firstcol,
unsigned16_t lastcol,
unsigned16_t rowheight)
{
SetRecordType(RECTYPE_ROW);
AddValue16(rownum);
AddValue16(firstcol);
AddValue16((lastcol+1));
AddValue16(rowheight);
// A field used by MS for "optimizing" (?) the loading of a file.
// Doc says it shall be set to 0 if I'm creating a BIFF...
AddValue16(0);
// A reserved value:
AddValue16(0);
// TODO: The following flag-word can be used for outline cells. Later.
// As a defaule the GhostDirty flag is is set, so the row has a default
// format (set by the index of byte 18).
if(rowheight == ROW_DFLT_HEIGHT)
{
AddValue16((unsigned16_t)(ROW_DFLT_GRBIT));
}
else
{
AddValue16((unsigned16_t)(ROW_DFLT_GRBIT|ROW_GRBIT_UNSYNC));
}
AddValue16((unsigned16_t)ROW_DFLT_IXFE);
SetRecordLength(GetDataSize()-4);
}
// NOTE: row_t has not a height field
CRow::CRow(row_t& rowdef)
{
SetRecordType(RECTYPE_ROW);
AddValue16(rowdef.rownum);
AddValue16(rowdef.firstcol);
AddValue16((rowdef.lastcol+1));
AddValue16(ROW_DFLT_HEIGHT);
// A field used by MS for "optimizing" (?) the loading of a file.
// Doc says it shall be set to 0 if I'm creating a BIFF...
AddValue16((unsigned16_t)0);
// A reserved value:
AddValue16((unsigned16_t)0);
// TODO: The following flag-word can be used for outline cells. Later.
// As a defaule the GhostDirty flag is is set, so the row has a default
// format (set by the index of byte 18).
AddValue16((unsigned16_t)(ROW_DFLT_GRBIT|ROW_GRBIT_UNSYNC));
AddValue16((unsigned16_t)ROW_DFLT_IXFE);
SetRecordLength(GetDataSize()-4);
}
CRow::~CRow()
{
}
/*
******************************
******************************
*/
void CRow::SetFirstCol(unsigned16_t firstcol)
{
SetValueAt((signed16_t)firstcol, ROW_OFFSET_FIRSTCOL);
}
/*
******************************
******************************
*/
void CRow::SetLastCol(unsigned16_t lastcol)
{
SetValueAt((signed16_t)lastcol, ROW_OFFSET_LASTCOL);
}
/*
******************************
******************************
*/
unsigned16_t CRow::GetFirstCol(void)
{
signed16_t firstcol;
GetValue16From(&firstcol,ROW_OFFSET_FIRSTCOL);
return (unsigned16_t)firstcol;
}
/*
******************************
******************************
*/
unsigned16_t CRow::GetLastCol(void)
{
signed16_t lastcol;
GetValue16From(&lastcol,ROW_OFFSET_LASTCOL);
return (unsigned16_t)lastcol;
}
/*
******************************
CDBCell class implementation
******************************
*/
CDBCell::CDBCell(unsigned32_t startblock)
{
// The new initializated DBCell record points to nowhere and has no
// extra rows (the array of stream offsets is empty);
SetRecordType(RECTYPE_DBCELL);
AddValue32((unsigned32_t) startblock);
SetRecordLength(GetDataSize()-4);
}
CDBCell::~CDBCell()
{
}
void CDBCell::AddRowOffset(unsigned16_t rowoffset)
{
AddValue16((unsigned16_t) rowoffset);
SetRecordLength(GetDataSize()-4);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: row.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:53 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

179
uppdev/XLS/row.h Normal file
View file

@ -0,0 +1,179 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/row.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef ROW_H
#define ROW_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/record.h>
/*
******************************
CRow class declaration
******************************
*/
namespace xlslib_core
{
#define ROW_DFLT_HEIGHT ((unsigned16_t)0x0108)
#define ROW_DFLT_GRBIT ((unsigned16_t)0x0080)
#define ROW_GRBIT_UNSYNC ((unsigned16_t)0x0040)
#define ROW_DFLT_IXFE ((unsigned16_t)0x000f)
#define ROW_OFFSET_FIRSTCOL ((unsigned32_t)6)
#define ROW_OFFSET_LASTCOL ((unsigned32_t)8)
#define ROW_MASK_STDHEIGHT ((unsigned16_t)0x0108)
#define ROW_RECORD_SIZE (20)
class rowheight_t
{
public:
rowheight_t() {};
rowheight_t(unsigned16_t rownum, unsigned16_t rowheight)
: num(rownum), height(rowheight) {}
~rowheight_t() {};
unsigned16_t GetRowNum() {return num;};
void SetRowNum(unsigned16_t rownum) {num = rownum;};
unsigned16_t GetRowHeight() {return height;};
void SetRowHeight(unsigned16_t rowheight) {height = rowheight;};
bool operator<(const rowheight_t& right) const{
return (num < right.num);
};
bool operator>(const rowheight_t& right) const{
return (num > right.num);
};
bool operator==(const rowheight_t& right) const{
return (num == right.num);
};
bool operator!=(const rowheight_t& right) const{
return (num != right.num);
};
private:
unsigned16_t num;
unsigned16_t height;
};
struct rowheightsort
{
public:
bool operator()(rowheight_t* const &a, rowheight_t* const &b) const
{
return (a->GetRowNum() < b->GetRowNum());
};
};
typedef std::set<xlslib_core::rowheight_t*,rowheightsort XLSLIB_DFLT_ALLOCATOR> RowHeight_List_t;
typedef RowHeight_List_t::iterator RowHeight_List_Itor_t;
// NOTE: row_t has not a height field
typedef struct
{
unsigned16_t rownum;
unsigned16_t firstcol;
unsigned16_t lastcol;
}row_t;
typedef std::list<xlslib_core::row_t* XLSLIB_DFLT_ALLOCATOR> Row_List_t;
typedef Row_List_t::iterator Row_List_Itor_t;
class CRow: public CRecord
{
private:
public:
CRow(unsigned16_t rownum,
unsigned16_t firstcol,
unsigned16_t lastcol,
unsigned16_t rowheight = ROW_DFLT_HEIGHT);
CRow(row_t& rowdef);
~CRow();
void SetFirstCol(unsigned16_t firstrow);
void SetLastCol(unsigned16_t lastrow);
unsigned16_t GetFirstCol(void);
unsigned16_t GetLastCol(void);
};
/*
******************************
CDBCell class declaration
******************************
*/
#define DBC_DFLT_STARTBLOCK ((unsigned32_t)(0x00000000))
class CDBCell: public CRecord
{
private:
public:
CDBCell(unsigned32_t startblock = DBC_DFLT_STARTBLOCK);
~CDBCell();
void AddRowOffset(unsigned16_t rowoffset );
};
}
#endif //ROW_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: row.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:46 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

1176
uppdev/XLS/sheetrec.cpp Normal file

File diff suppressed because it is too large Load diff

233
uppdev/XLS/sheetrec.h Normal file
View file

@ -0,0 +1,233 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/sheetrec.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef SHEETREC_H
#define SHEETREC_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/unit.h>
#include <XLS/biffsection.h>
#include <XLS/recdef.h>
#include <XLS/index.h>
#include <XLS/extformat.h>
#include <XLS/label.h>
#include <XLS/blank.h>
#include <XLS/number.h>
#include <XLS/row.h>
#include <XLS/merged.h>
#include <XLS/colinfo.h>
#include <XLS/globalrec.h>
#include <XLS/range.h>
namespace xlslib_core
{
/*
***********************************
worksheet class declaration
***********************************
*/
typedef enum
{
SHEET_INIT,
SHEET_BOF,
SHEET_INDEX,
SHEET_DIMENSION,
SHEET_ROWBLOCKS,
SHEET_MERGED,
SHEET_COLINFO,
SHEET_WINDOW2,
SHEET_EOF,
SHEET_FINISH
} SheetRecordDumpState_t;
#define BOF_SIZE ((unsigned8_t)12)
#define EOF_SIZE ((unsigned8_t)4)
#define WINDOW2_SIZE ((unsigned8_t)14)
typedef struct
{
unsigned32_t rowandcell_size;
unsigned32_t dbcell_size;
unsigned32_t rows_sofar;
} rowblocksize_t;
typedef std::list<xlslib_core::rowblocksize_t* XLSLIB_DFLT_ALLOCATOR> RBSize_List_t;
typedef RBSize_List_t::iterator RBSize_List_Itor_t;
typedef enum
{
RB_INIT,
RB_FIRST_ROW,
RB_ROWS,
RB_FIRSTCELL,
RB_CELLS,
RB_DBCELL,
RB_FINISH
} DumpRowBlocksState_t;
typedef std::list<unsigned16_t XLSLIB_DFLT_ALLOCATOR> CellOffsets_List_t;
typedef CellOffsets_List_t::iterator CellOffsets_List_Itor_t;
//class range;
class worksheet
: public CBiffSection
{
private:
CGlobalRecords* m_pGlobalRecords;
#ifdef HAVE_ICONV
std::string iconv_code;
#endif
SheetRecordDumpState_t m_DumpState;
CUnit* m_pCurrentData;
// std::string m_Name; 10-1-08 not sure why here
bool m_SizeCalculated;
size_t m_Size;
Range_List_t m_MergedRanges;
Colinfo_List_t m_Colinfos;
Colinfo_List_Itor_t m_Current_Colinfo;
RowHeight_List_t m_RowHeights;
RowHeight_List_Itor_t m_Current_RowHeight;
unsigned16_t minRow, minCol, maxRow, maxCol;
// Label related additions
/* void AddLabel(unsigned16_t row, unsigned16_t col,
std::string& strlabel, unsigned16_t& xformat);
*/
private:
Cell_List_t m_Cells;
Cell_List_Itor_t m_CurrentCell; // Init this one in the INIT state
Cell_List_Itor_t m_CurrentSizeCell; // Init this one in the INIT state
bool m_CellsSorted;
RangeObj_List_t m_Ranges;
RBSize_List_t m_RBSizes;
RBSize_List_Itor_t m_Current_RBSize;
bool m_SizesCalculated;
DumpRowBlocksState_t m_DumpRBState;
unsigned8_t m_RowCounter;
unsigned32_t m_CellCounter;
unsigned32_t m_DBCellOffset;
CellOffsets_List_t m_CellOffsets;
unsigned32_t m_CurrentRowBlock;
Cell_List_Itor_t m_Starting_RBCell;
void GetFirstLastRows(unsigned32_t* first_row, unsigned32_t* last_row);
unsigned32_t GetNumRowBlocks();
bool GetRowBlockSizes(unsigned32_t* rowandcell_size,
unsigned32_t* dbcell_size,
unsigned32_t* num_rows = NULL);
CUnit* RowBlocksDump();
void AddCell(cell_t* pcell);
void SortCells();
public:
worksheet(CGlobalRecords* pglobalrec);
#if HAVE_ICONV
worksheet(CGlobalRecords* pglobalrec, std::string& code);
#endif
~worksheet();
// The offset defines the amount
// of data form the beginning of the BIFF records to the first
CUnit* DumpData(unsigned32_t offset);
unsigned32_t GetSize();
cell_t* FindCell(unsigned16_t row, unsigned16_t col);
// Cell operations
void merge(unsigned16_t first_row, unsigned16_t first_col,
unsigned16_t last_row, unsigned16_t last_col);
void colwidth(unsigned16_t col, unsigned16_t width);
void rowheight(unsigned16_t row, unsigned16_t height);
// Ranges
range* rangegroup(unsigned16_t row1, unsigned16_t col1,
unsigned16_t row2, unsigned16_t col2);
// Cells
cell_t* label(unsigned16_t row, unsigned16_t col,
std::string strlabel, xf_t* pxformat = NULL);
#if VERSION_BIFF == VERSION_BIFF8
cell_t* label(unsigned16_t row, unsigned16_t col,
std::ustring strlabel, xf_t* pxformat = NULL);
#endif
cell_t* blank(unsigned16_t row, unsigned16_t col,
xf_t* pxformat = NULL);
cell_t* number(unsigned16_t row, unsigned16_t col,
double numval, format_number_t fmtval,
xf_t* pxformat = NULL);
};
typedef std::vector<xlslib_core::worksheet*> Sheets_Vector_t;
typedef Sheets_Vector_t::iterator Sheets_Vector_Itor_t;
}
#endif // SHEETREC_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: sheetrec.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:44 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

148
uppdev/XLS/stringtok.h Normal file
View file

@ -0,0 +1,148 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/common/stringtok.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* stringtok.h -- Breaks a string into tokens. This is an example for lib3.
*
* Template function looks like this:
*
* template <typename Container>
* void stringtok (Container &l,
* string const &s,
* char const * const ws = " \t\n");
*
* A nondestructive version of strtok() that handles its own memory and can
* be broken up by any character(s). Does all the work at once rather than
* in an invocation loop like strtok() requires.
*
* Container is any type that supports push_back(a_string), although using
* list<string> and deque<string> are indicated due to their O(1) push_back.
* (I prefer deque<> because op[]/at() is available as well.) The first
* parameter references an existing Container.
*
* s is the string to be tokenized. From the parameter declaration, it can
* be seen that s is not affected. Since references-to-const may refer to
* temporaries, you could use stringtok(some_container, readline("")) when
* using the GNU readline library.
*
* The final parameter is an array of characters that serve as whitespace.
* Whitespace characters default to one or more of tab, space, and newline,
* in any combination.
*
* 'l' need not be empty on entry. On return, 'l' will have the token
* strings appended.
*
*
* [Example:
* list<string> ls;
* stringtok (ls, " this \t is\t\n a test ");
* for (list<string>::const_iterator i = ls.begin();
* i != ls.end(); ++i)
* {
* cerr << ':' << (*i) << ":\n";
* }
*
* would print
* :this:
* :is:
* :a:
* :test:
* -end example]
*
* pedwards@jaj.com May 1999
*/
#include <string>
#include <cstring> // for strchr
#include <XLS/config.h>
#include <XLS/systype.h>
/*****************************************************************
* This is the only part of the implementation that I don't like.
* It can probably be improved upon by the reader...
*/
namespace {
inline bool
isws (char c, char const * const wstr)
{
return (strchr(wstr,c) != NULL);
}
}
/*****************************************************************
* Simplistic and quite Standard, but a bit slow. This should be
* templatized on basic_string instead, or on a more generic StringT
* that just happens to support ::size_type, .substr(), and so on.
* I had hoped that "whitespace" would be a trait, but it isn't, so
* the user must supply it. Enh, this lets them break up strings on
* different things easier than traits would anyhow.
*/
template <typename Container>
void
stringtok (Container &l, std::string const &s, char const * const ws = " \t\n")
{
const std::string::size_type S = s.size();
std::string::size_type i = 0;
while (i < S) {
// eat leading whitespace
while ((i < S) && (isws(s[i],ws))) ++i;
if (i == S) return; // nothing left but WS
// find end of word
std::string::size_type j = i+1;
while ((j < S) && (!isws(s[j],ws))) ++j;
// add word
std::string* substr = new std::string;
*substr = s.substr(i,j-i);
l.push_back(substr);
// set up for next loop
i = j+1;
}
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: stringtok.h,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:32:05 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

88
uppdev/XLS/summinfo.cpp Normal file
View file

@ -0,0 +1,88 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/summinfo.cpp,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/summinfo.h>
#include <XLS/data/data3.h> // Temporarilly used to add data for summary info
using namespace std;
using namespace xlslib_core;
/*
**********************************************************************
CSummaryInfo class implementation
**********************************************************************
*/
CSummaryInfo::CSummaryInfo()
{
XTRACE("WRITE_SUMMARY");
CUnit* ptraildata = new CUnit;
ptraildata->AddDataArray(CSummaryInfo::summ_info_data, sizeof(CSummaryInfo::summ_info_data));
(*this) += ptraildata;
}
CSummaryInfo::~CSummaryInfo()
{
}
/*
***********************************
***********************************
*/
CUnit* CSummaryInfo::DumpData(void)
{
XTRACE("\tCSummaryInfo::DumpData");
return (CUnit*)this;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: summinfo.cpp,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:57 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

82
uppdev/XLS/summinfo.h Normal file
View file

@ -0,0 +1,82 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/summinfo.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef SUMMARYINFO_H
#define SUMMARYINFO_H
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/datast.h>
namespace xlslib_core
{
/*
********************************
CSummaryInfo class declaration
********************************
*/
class CSummaryInfo: public CDataStorage
{
private:
static const unsigned8_t summ_info_data[];
protected:
public:
CSummaryInfo();
~CSummaryInfo();
CUnit* DumpData();
};
}
#endif //SUMMARYINFO_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: summinfo.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:49 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

282
uppdev/XLS/systype.h Normal file
View file

@ -0,0 +1,282 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/common/systype.h,v $
* $Revision: 1.3 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef SYSTYPE_H
#define SYSTYPE_H
#if defined(_MSC_VER) && defined(WIN32)
#pragma warning(disable: 4786) // Long debug information related to STL
#pragma warning(disable: 4290) // C++ Exception Specification ignored
#endif
//# define PHPEXT_TSRMLS_C tsrm_ls
//# define PHPEXT_TSRMLS_D void ***tsrm_ls
// Global includes
#include <stdio.h>
#include <stdint.h>
#include <cstring>
#include <string>
#include <string.h> // DFH 10-2-08
#include <iostream>
#include <list>
#include <set>
#include <algorithm>
#define INLINE inline
//#define NULL ((void*)(0))
#define NO_ERRORS 0
#define FILE_ERROR -1
#define GENERAL_ERROR ((signed8_t)-100)
#define PTYPE_DIRECTORY ((unsigned8_t)(0x01))
#define PTYPE_FILE ((unsigned8_t)(0x02))
#define PTYPE_ROOT ((unsigned8_t)(0x05))
#define PCOLOR_BLACK ((unsigned8_t)(0x01))
#define PCOLOR_RED ((unsigned8_t)(0x00))
#define PLINK_EMPTY ((signed32_t)(-1))
#define PBLOCK_END ((signed32_t)(-2))
#if USE_ALLOCATOR==ALLOCATOR_STL
#define XLSLIB_DFLT_ALLOCATOR
#elif USE_ALLOCATOR==ALLOCATOR_BTI
#include "bti_thread_alloc.h"
#define XLSLIB_DFLT_ALLOCATOR ,bti::thr_alloc
#else
# error ERROR: Invalid allocator option
#endif
#ifdef uint32_t // if we have this one we will have all the others too
typedef unsigned char unsigned8_t;
typedef unsigned short int unsigned16_t;
typedef unsigned int unsigned32_t;
typedef char signed8_t;
typedef short int signed16_t;
typedef int signed32_t;
#else
typedef uint8_t unsigned8_t;
typedef uint16_t unsigned16_t;
typedef uint32_t unsigned32_t;
typedef int8_t signed8_t;
typedef int16_t signed16_t;
typedef int32_t signed32_t;
#endif
#if defined(_MSC_VER) && defined(WIN32)
typedef wchar_t uchar_t;
#define ustring wstring
//typedef wstring ustring;
#elif defined(__FRAMEWORK__) // For Mac-OSX
#undef HAVE_ICONV
#if ! defined(unichar)
typedef uint16_t unichar;
#endif
typedef unichar uchar_t;
//typedef std::basic_string<unsigned16_t> ustring;
#define ustring basic_string<uint16_t>
#else
typedef wchar_t uchar_t;
#define ustring wstring
typedef std::basic_string<unsigned16_t> u16string;
#endif
#if defined(_MSC_VER) && defined(WIN32)
typedef __int64 unsigned64_t;
#else // not windows
#ifdef _UINT64_T
typedef uint64_t unsigned64_t;
#else
typedef unsigned long long unsigned64_t;
#endif
#endif
typedef std::list<std::string* XLSLIB_DFLT_ALLOCATOR> StringList_t;
typedef StringList_t::const_iterator StringListItor_t;
// Macros
# define MASK_BYTE0 0x00000000000000ff
# define MASK_BYTE1 0x000000000000ff00
# define MASK_BYTE2 0x0000000000ff0000
# define MASK_BYTE3 0x00000000ff000000
#if defined(_MSC_VER) && defined(WIN32)
# define MASK_BYTE4 0x000000ff00000000
# define MASK_BYTE5 0x0000ff0000000000
# define MASK_BYTE6 0x00ff000000000000
# define MASK_BYTE7 0xff00000000000000
#else
# define MASK_BYTE4 (unsigned64_t)0x000000ff00000000LL
# define MASK_BYTE5 (unsigned64_t)0x0000ff0000000000LL
# define MASK_BYTE6 (unsigned64_t)0x00ff000000000000LL
# define MASK_BYTE7 (unsigned64_t)0xff00000000000000LL
#endif
#define BYTE_0(num) (unsigned8_t) (num & MASK_BYTE0)
#define BYTE_1(num) (unsigned8_t)((num & MASK_BYTE1)>>0x08)
#define BYTE_2(num) (unsigned8_t)((num & MASK_BYTE2)>>0x10)
#define BYTE_3(num) (unsigned8_t)((num & MASK_BYTE3)>>0x18)
#define BYTE_4(num) (unsigned8_t)((num & MASK_BYTE4)>>0x20)
#define BYTE_5(num) (unsigned8_t)((num & MASK_BYTE5)>>0x28)
#define BYTE_6(num) (unsigned8_t)((num & MASK_BYTE6)>>0x30)
#define BYTE_7(num) (unsigned8_t)((num & MASK_BYTE7)>>0x38)
#define PROPERTY_DFLT_NOTUSED ((unsigned8_t)(0x00))
#define PROPERTY_MAX_NAME_LENGTH ((unsigned8_t)(32))
#define PROPERTY_TYPE_DIR ((unsigned8_t)(0x01))
#define PROPERTY_TYPE_FILE ((unsigned8_t)(0x02))
#define PROPERTY_TYPE_ROOT ((unsigned8_t)(0x05))
#define PROPERTY_COLOR_NODE_RED ((unsigned8_t)(0x00))
#define PROPERTY_COLOR_NODE_BLACK ((unsigned8_t)(0x01))
#define PROPERTY_LINK_EMPTY ((signed32_t)(-1))
#define PPTPOS_NAME ((unsigned8_t)(0x00))
#define PPTPOS_NAMELENGTH ((unsigned8_t)(0x40))
#define PPTPOS_TYPE ((unsigned8_t)(0x42))
#define PPTPOS_NODECOLOR ((unsigned8_t)(0x43))
#define PPTPOS_PREVIOUS ((unsigned8_t)(0x44))
#define PPTPOS_NEXT ((unsigned8_t)(0x48))
#define PPTPOS_CHILD ((unsigned8_t)(0x4C))
#define PPTPOS_UNUSED_EMPTY0 ((unsigned8_t)(0x50))
#define PPTPOS_SECS1 ((unsigned32_t)(0x64))
#define PPTPOS_SECS2 ((unsigned32_t)(0x68))
#define PPTPOS_DAYS1 ((unsigned32_t)(0x6c))
#define PPTPOS_DAYS2 ((unsigned32_t)(0x70))
#define PPTPOS_STARTBLOCK ((unsigned8_t)(0x74))
#define PPTPOS_SIZE ((unsigned8_t)(0x78))
#define PPT_DFLT_SECS1 ((signed32_t)(0))
#define PPT_DFLT_SECS2 ((signed32_t)(0))
#define PPT_DFLT_DAYS1 ((signed32_t)(0))
#define PPT_DFLT_DAYS2 ((signed32_t)(0))
// More macros
/*
****************************************
****************************************
*/
#define Delete_Pointer(pt) { \
if(pt != NULL) \
{ \
delete pt; \
pt = NULL; \
} \
}
/*
****************************************
****************************************
*/
#ifdef __DEBUG__
#define XTRACE(str) { \
cout<<"DEBUG: "<<str<<endl; \
}
#else
#define XTRACE(str)
#endif
#ifdef __PHP_DEBUG__
#define PHPTRACE(str) { \
cout<<"PHPDEBUG: "<<str<<endl; \
}
#else
#define PHPTRACE(str)
#endif
#endif //SYSTYPE_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: systype.h,v $
* Revision 1.3 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.2 2004/09/01 00:47:04 darioglz
* + Modified to gain independence of target
*
* Revision 1.1.1.1 2004/08/27 16:32:05 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

114
uppdev/XLS/timespan.h Normal file
View file

@ -0,0 +1,114 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/common/timespan.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:53 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef TIMESPAN_H
#define TIMESPAN_H
#include <time.h>
#include <assert.h>
#include <XLS/config.h>
#include <XLS/systype.h>
class CCpuClockTimespan
{
enum
{ INVALID_VALUE = -1, };
public:
CCpuClockTimespan()
: m_clockStart( INVALID_VALUE),
m_nUsedClockTicks( INVALID_VALUE)
{}
~CCpuClockTimespan()
{}
void StartClock()
{
// the clock is already started !!!
// stop it first !!!
assert( m_clockStart == (clock_t)INVALID_VALUE);
m_nUsedClockTicks = (clock_t)INVALID_VALUE;
m_clockStart = clock();
}
void StopClock()
{
const clock_t clockStop = clock();
// start the clock first !!!
assert( m_clockStart != (clock_t)INVALID_VALUE);
m_nUsedClockTicks = clockStop - m_clockStart;
// after this, we can start it again !!!
m_clockStart = INVALID_VALUE;
}
unsigned long GetUsedMilliseconds() const
{
const int MILLISECONDS_PER_SECOND = 1000;
// the clock was never started,
// or it's started, but it has not been stopped yet
assert( m_nUsedClockTicks != (clock_t)INVALID_VALUE);
double nSeconds = ( ( double)m_nUsedClockTicks) / CLOCKS_PER_SEC;
const unsigned long nMilliseconds = (unsigned long)(nSeconds * MILLISECONDS_PER_SECOND);
return nMilliseconds;
}
private:
// when did we Start to measure
// clock time?
clock_t m_clockStart;
// the used clock ticks, from Start to Stop
clock_t m_nUsedClockTicks;
};
#endif //TIMESPAN_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: timespan.h,v $
* Revision 1.2 2008/10/25 18:39:53 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:32:05 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

171
uppdev/XLS/tostr.h Normal file
View file

@ -0,0 +1,171 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/tostr.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 19:08:52 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef TOSTR_H
#define TOSTR_H
#include <string>
#include <sstream>
#include <iostream>
#include <XLS/config.h>
// forward declaration
struct str_stream;
// ... helper - allow explicit conversion to string
class as_string {};
inline std::ostream & operator<< ( std::ostream & streamOut, const as_string &)
{
return streamOut;
}
namespace Private
{
// what should we return when calling write_to_stream ?
template< class type>
struct return_from_write_to_stream
{
typedef const str_stream & return_type;
};
template<>
struct return_from_write_to_stream< as_string>
{
typedef std::string return_type;
};
// forward declaration
template< class type>
inline typename return_from_write_to_stream< type>::return_type
write_to_stream ( const str_stream & streamOut, const type & value);
}
// forward declaration
template< class type>
inline typename Private::return_from_write_to_stream< type>::return_type operator<< ( const str_stream & streamOut, const type & value);
// str_stream - allow stream usage, and then conversion to string
struct str_stream
{
// default construction
str_stream(){}
// allow to_string like usage
template< class type>
str_stream( const type & value)
{
*this << value;
}
std::stringstream & underlying_stream() const
{ return m_streamOut; }
operator std::string() const
{
return m_streamOut.str();
}
private:
mutable std::stringstream m_streamOut;
#ifndef NDEBUG
public:
void recalculate_string() const
{ m_string = m_streamOut.str(); }
private:
mutable std::string m_string;
#endif
};
namespace Private
{
template< class type>
inline typename return_from_write_to_stream< type>::return_type
write_to_stream ( const str_stream & streamOut, const type & value)
{
streamOut.underlying_stream() << value;
#ifndef NDEBUG
streamOut.recalculate_string();
#endif
return streamOut;
}
}
template< class type>
inline typename Private::return_from_write_to_stream< type>::return_type operator<< ( const str_stream & streamOut, const type & value)
{
return Private::write_to_stream( streamOut, value) ;
}
// allow function IO manipulators
inline const str_stream & operator<< ( const str_stream & streamOut, std::ios_base & (*func)( std::ios_base&) )
{
func( streamOut.underlying_stream());
return streamOut;
}
inline const str_stream & operator<< ( const str_stream & streamOut, std::basic_ios< char> & (*func)( std::basic_ios< char> &) )
{
func( streamOut.underlying_stream());
return streamOut;
}
inline const str_stream & operator<< ( const str_stream & streamOut, std::ostream & (*func)( std::ostream &) )
{
func( streamOut.underlying_stream());
return streamOut;
}
#endif //TOSTR_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: tostr.h,v $
* Revision 1.2 2008/10/25 19:08:52 dhoerl
* Updated header
*
* Revision 1.1.1.1 2004/08/27 16:31:54 darioglz
* Initial Import.
*
* Revision 1.2 2004/01/29 03:18:55 dgonzalez
* + Using the config.h file
*
* Revision 1.1 2003/12/02 18:15:06 dgonzalez
* + Initial version. Added to handle signatures of objects
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

662
uppdev/XLS/unit.cpp Normal file
View file

@ -0,0 +1,662 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/unit.cpp,v $
* $Revision: 1.3 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/systype.h>
#include <XLS/unit.h>
using namespace std;
using namespace xlslib_core;
/*
*********************************************************************************
*********************************************************************************
CUnit class implementation
*********************************************************************************
*********************************************************************************
*/
// Default constructor
CUnit::CUnit() : m_nSize(0), m_pData(0), m_nDataSize(0)
//, m_ShadowUnit(false)
{
}
// Default destructor
CUnit::~CUnit ( )
{
if(m_pData /*&& !m_ShadowUnit*/)
{
delete[] m_pData;
}
}
/************************************************
************************************************/
const unsigned8_t CUnit::DefaultInflateSize = 10;
/************************************************
************************************************/
signed8_t CUnit::SetAt(unsigned8_t newval, unsigned32_t index)
{
signed8_t errcode = NO_ERRORS;
if(m_pData != NULL)
{
if (index < m_nDataSize)
m_pData[index] = newval;
else
errcode = ERR_INVALID_INDEX;
} else {
errcode = ERR_DATASTORAGE_EMPTY;
}
return errcode;
}
/************************************************
************************************************/
signed8_t CUnit::AddValue16(unsigned16_t newval)
{
signed8_t errcode = NO_ERRORS;
if(AddValue8(BYTE_0(newval))) errcode = GENERAL_ERROR;
if(AddValue8(BYTE_1(newval))) errcode = GENERAL_ERROR;
return errcode;
}
/************************************************
************************************************/
signed8_t CUnit::AddValue32(unsigned32_t newval)
{
signed8_t errcode = NO_ERRORS;
if(AddValue8(BYTE_0(newval))) errcode = GENERAL_ERROR;
if(AddValue8(BYTE_1(newval))) errcode = GENERAL_ERROR;
if(AddValue8(BYTE_2(newval))) errcode = GENERAL_ERROR;
if(AddValue8(BYTE_3(newval))) errcode = GENERAL_ERROR;
return errcode;
}
/************************************************
************************************************/
signed8_t CUnit::AddValue64(unsigned64_t newval)
{
signed8_t errcode = NO_ERRORS;
if(AddValue8(BYTE_0(newval))) errcode = GENERAL_ERROR;
if(AddValue8(BYTE_1(newval))) errcode = GENERAL_ERROR;
if(AddValue8(BYTE_2(newval))) errcode = GENERAL_ERROR;
if(AddValue8(BYTE_3(newval))) errcode = GENERAL_ERROR;
if(AddValue8(BYTE_4(newval))) errcode = GENERAL_ERROR;
if(AddValue8(BYTE_5(newval))) errcode = GENERAL_ERROR;
if(AddValue8(BYTE_6(newval))) errcode = GENERAL_ERROR;
if(AddValue8(BYTE_7(newval))) errcode = GENERAL_ERROR;
return errcode;
}
/************************************************
************************************************/
signed8_t CUnit::SetValueAt(signed16_t newval, unsigned32_t index)
{
signed8_t errcode = NO_ERRORS;
if(SetAt(BYTE_0(newval), index )) errcode = GENERAL_ERROR;
if(SetAt(BYTE_1(newval), index+1)) errcode = GENERAL_ERROR;
return errcode;
}
/************************************************
************************************************/
signed8_t CUnit::SetValueAt(signed32_t newval, unsigned32_t index)
{
signed8_t errcode = NO_ERRORS;
if(SetAt(BYTE_0(newval), index )) errcode = GENERAL_ERROR;
if(SetAt(BYTE_1(newval), index+1)) errcode = GENERAL_ERROR;
if(SetAt(BYTE_2(newval), index+2)) errcode = GENERAL_ERROR;
if(SetAt(BYTE_3(newval), index+3)) errcode = GENERAL_ERROR;
return errcode;
}
/************************************************
************************************************/
signed8_t CUnit::GetValue16From(signed16_t* val, unsigned32_t index)
{
signed8_t errcode = NO_ERRORS;
*val = (signed16_t)(operator[](index) +
operator[](index+1)*0x0100);
return errcode;
}
/************************************************
************************************************/
signed8_t CUnit::GetValue32From(signed32_t* val, unsigned32_t index)
{
signed8_t errcode = NO_ERRORS;
*val = (signed16_t)(operator[](index) *0x0000001 +
operator[](index+1)*0x0000100 +
operator[](index+2)*0x0010000 +
operator[](index+2)*0x1000000 );
return errcode;
}
/************************************************
************************************************/
signed8_t CUnit::GetAt(signed8_t* data, unsigned32_t index)
{
signed8_t errcode = NO_ERRORS;
if(m_pData != NULL)
{
if (index < m_nDataSize)
{
*data = m_pData[index];
} else {
errcode = ERR_INVALID_INDEX;
}
} else {
errcode = ERR_DATASTORAGE_EMPTY;
}
return errcode;
}
/************************************************
************************************************/
/*
signed8_t CUnit::GetData(unsigned8_t** ppdata, unsigned32_t from, unsigned32_t to )
{
signed8_t errcode = NO_ERRORS;
// Simply make the external pointer point to the local storage data
*ppdata = m_pData;
return errcode;
}
*/
/************************************************
************************************************/
signed8_t CUnit::AddDataArray (const unsigned8_t* newdata, size_t size)
{
signed8_t errcode = NO_ERRORS;
size_t spaceleft = m_nSize - m_nDataSize;
if(spaceleft < size) // allocate more space if new tobeadded array won't fit
{
Inflate(size-spaceleft+1);
}
if(newdata != NULL)
{
for(unsigned32_t i=0; i<size; i++)
m_pData[m_nDataSize++] = newdata[i];
} else {
//No data to add. Do nothing
}
return errcode;
}
signed8_t CUnit::AddFixedDataArray (const unsigned8_t value, size_t size)
{
signed8_t errcode = NO_ERRORS;
size_t spaceleft = m_nSize - m_nDataSize;
if(spaceleft < size) // allocate more space if new tobeadded array won't fit
{
Inflate(size-spaceleft+1);
}
// The following can be a memset
for(unsigned32_t i=0; i<size; i++)
m_pData[m_nDataSize++] = value;
return errcode;
}
signed8_t AddDataArray (const unsigned16_t* newdata, size_t size);
signed8_t AddFixedDataArray (const unsigned16_t value, size_t size);
/************************************************
************************************************/
signed8_t CUnit::RemoveTrailData (unsigned32_t remove_size)
{
/*
total_to_remove = (m_nSize - m_nDataSize) - remove_size;
size of temp_data = m_nSize - total_to_remove = m_nDataSize + remove_size
*/
unsigned32_t temp_size = m_nDataSize + remove_size;
unsigned8_t* temp_data = new unsigned8_t[temp_size];
if(temp_data != NULL)
{
for(unsigned32_t i=0; i<temp_size; i++)
temp_data[i] = m_pData[i];
} else {
return GENERAL_ERROR;
}
m_nDataSize = temp_size;
m_nSize = m_nDataSize;
delete[] m_pData;
m_pData = temp_data;
return NO_ERRORS;
}
/************************************************
************************************************/
signed8_t CUnit::SetArrayAt(const unsigned8_t* newdata, size_t size, unsigned32_t index)
{
signed8_t errcode = NO_ERRORS;
size_t spaceleft = m_nSize - index;
if(spaceleft < size) // allocate more space if new tobeadded array won't fit
{
Inflate(size-spaceleft);
}
if(newdata != NULL)
{
for(unsigned32_t i=0; i<size; i++)
{
/*
// The following code adds needed space to the whole allocated array
if (index > m_nDataSize) m_nDataSize = index+1;
else if(index==m_nDataSize) m_nDataSize++;
m_pData[index++] = newdata[i];
*/
// The following code truncates the array if it exceeds DataSize
if(index==m_nDataSize) break;
m_pData[index++] = newdata[i];
}
} else {
//No data to add. Do nothing
}
return errcode;
}
/************************************************
************************************************/
signed8_t CUnit::AddValue8(unsigned8_t newdata)
{
if(m_nDataSize >= m_nSize)
{
Inflate();
}
m_pData[m_nDataSize++] = newdata;
return NO_ERRORS;
}
#if VERSION_BIFF == VERSION_BIFF8
#ifdef HAVE_ICONV
void CUnit::Conv32to16(string& iconv_code, ustring& str1, u16string& str2)
{
size_t resultSize, inbytesleft, outbytesleft;
const wchar_t *inbuf;
iconv_t cd;
unsigned16_t *outbuf, *origOutbuf;
static unsigned16_t convFail[] = { 'i', 'c', 'o', 'n', 'v', ' ', 'f', 'a', 'i', 'l', 'e', 'd', '!' };
cd = iconv_open("UCS-2-INTERNAL", "wchar_t");
// no need to test return code as we ALREADY did this when setting iconv_code in workbook
inbytesleft = str1.size() * sizeof(uchar_t);
outbytesleft = inbytesleft * 4 * sizeof(unsigned16_t); // Unicode expansion 4 to 2 ???
inbuf = str1.c_str();
origOutbuf = (unsigned16_t *)calloc(outbytesleft, 1);
outbuf = origOutbuf;
resultSize = iconv(cd, (char **)&inbuf, &inbytesleft, (char **)&outbuf, &outbytesleft);
iconv_close(cd);
if(resultSize == (size_t)-1) {
str2 = convFail;
} else {
str2.assign(origOutbuf, outbuf - origOutbuf);
}
return;
}
#endif
// for cases where we save a single byte
signed8_t CUnit::AddUnicodeStrlen(unsigned8_t newdata)
{
return AddValue8(newdata);
}
// for cases where we save a single byte
signed8_t CUnit::AddUnicodeStrlen(unsigned16_t newdata)
{
return AddValue16(newdata);
}
signed8_t CUnit::AddUnicodeString (const unsigned8_t* newdata, unsigned16_t size)
{
unsigned16_t strSize = 1 + size;
signed8_t errcode = NO_ERRORS;
size_t spaceleft = m_nSize - m_nDataSize;
if(spaceleft < strSize) // allocate more space if new tobeadded array won't fit
{
Inflate((size_t)(strSize-spaceleft+1));
}
m_pData[m_nDataSize++] = 0x00; // character compression
if(newdata != NULL)
{
for(unsigned16_t i=0; i<size; i++)
m_pData[m_nDataSize++] = newdata[i];
} else {
//No data to add. Do nothing
}
return errcode;
}
signed8_t CUnit::AddUnicodeString (const unsigned16_t* newdata, unsigned16_t size)
{
unsigned16_t strSize = 1 + size*sizeof(unsigned16_t);
signed8_t errcode = NO_ERRORS;
size_t spaceleft = m_nSize - m_nDataSize;
if(spaceleft < strSize) // allocate more space if new tobeadded array won't fit
{
Inflate((size_t)(strSize-spaceleft+1));
}
m_pData[m_nDataSize++] = 0x01; // UTF-16
if(newdata != NULL)
{
for(unsigned16_t i=0; i<size; i++) {
unsigned16_t data;
data = newdata[i];
m_pData[m_nDataSize++] = data & 0xFF;
m_pData[m_nDataSize++] = (data >> 8) & 0xFF;
}
} else {
//No data to add. Do nothing
}
return errcode;
}
#endif
/************************************************
************************************************/
signed8_t CUnit::Inflate(size_t increase)
{
signed8_t errcode = NO_ERRORS;
if (increase == 0)
increase = CUnit::DefaultInflateSize;
// Create the new storage with increased size
// and initialize it to 0.
unsigned8_t* temp_storage = new unsigned8_t[m_nSize + increase];
if(temp_storage != NULL)
{
memset(temp_storage, 0, (m_nSize+increase)*(sizeof(unsigned8_t)));
// Copy data to the new storage
memcpy(temp_storage, m_pData, m_nSize*sizeof(unsigned8_t));
// Update the size
m_nSize += increase;
if (m_pData != NULL)
delete []m_pData;
m_pData = temp_storage;
errcode = ERR_UNNABLE_TOALLOCATE_MEMORY;
} else {
// No errors... errcode already clean
}
return errcode;
}
/************************************************
************************************************/
unsigned8_t& CUnit::operator[] ( const unsigned32_t index )
{
if(index >= m_nDataSize)
return m_pData[m_nDataSize];
return m_pData[index];
}
/************************************************
************************************************/
CUnit& CUnit::operator= (CUnit& newvalue )
{
if(&newvalue != this)
Init(newvalue.GetBuffer(), newvalue.GetSize(), newvalue.GetDataSize());
return *this;
}
/************************************************
************************************************/
CUnit& CUnit::operator+= ( CUnit& from )
{
if(&from != this)
Append(from);
else
{
CUnit shadow;
shadow = from;
Append(shadow);
}
return *this;
}
/************************************************
************************************************/
CUnit& CUnit::operator+= ( unsigned8_t from )
{
AddValue8(from);
return *this;
}
/************************************************
************************************************/
signed8_t CUnit::Init (unsigned8_t* data, const size_t size, const unsigned32_t datasz)
{
m_nSize = size;
m_nDataSize = datasz;
m_pData = new unsigned8_t[m_nSize];
if(data)
{
memset(m_pData, 0, m_nSize*sizeof(unsigned8_t));
// Copy data to the new storage
memcpy(m_pData, data, m_nSize*sizeof(unsigned8_t));
}
return NO_ERRORS;
}
/************************************************
************************************************/
signed8_t CUnit::Append (CUnit& newunit)
{
if(AddDataArray(newunit.GetBuffer(), newunit.GetDataSize()) == NO_ERRORS)
return NO_ERRORS;
else
return GENERAL_ERROR;
}
/************************************************
************************************************/
signed8_t CUnit::InitFill (unsigned8_t data, unsigned32_t size)
{
if(m_pData)
delete[] m_pData;
m_pData = new unsigned8_t[size];
if(m_pData)
{
memset(m_pData, data, size*sizeof(unsigned8_t));
m_nSize = m_nDataSize = size;
return NO_ERRORS;
} else {
return GENERAL_ERROR;
}
}
/************************************************
************************************************/
size_t CUnit::GetSize (void)
{
return m_nSize;
}
/************************************************
************************************************/
unsigned32_t CUnit::GetDataSize (void)
{
return m_nDataSize;
}
/************************************************
************************************************/
unsigned8_t* CUnit::GetBuffer (void)
{
return m_pData;
}
/************************************************
************************************************/
/*
void CUnit::SetShadow(bool shadowval)
{
m_ShadowUnit = shadowval;
}
*/
/************************************************
************************************************/
/*
void CUnit::CopyShadowUnit(unsigned8_t* data, unsigned32_t size)
{
m_Size = m_DataSize = size;
m_pData = data;
SetShadow(true);
}
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: unit.cpp,v $
* Revision 1.3 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.2 2004/09/01 00:47:21 darioglz
* + Modified to gain independence of target
*
* Revision 1.1.1.1 2004/08/27 16:31:53 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

140
uppdev/XLS/unit.h Normal file
View file

@ -0,0 +1,140 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/unit.h,v $
* $Revision: 1.2 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef UNIT_H
#define UNIT_H
#include <XLS/config.h>
#include <XLS/common.h>
namespace xlslib_core
{
#define UNIT_MAX_SIZE (0xFFFF)
// Error codes
#define ERR_DATASTORAGE_EMPTY (-2)
#define ERR_INVALID_INDEX (-3)
#define ERR_UNNABLE_TOALLOCATE_MEMORY (-3)
//Block definitions
#define BIG_BLOCK_SIZE (0x200)
#define SMALL_BLOCK_SIZE (0x040)
#define PROP_BLOCK_SIZE (0x080)
class CUnit {
// Attributes
protected:
size_t m_nSize; // Size of data stored
unsigned8_t* m_pData; // Data storage
unsigned32_t m_nDataSize; // Next empty space
// bool m_ShadowUnit;
// Static attributes
static const unsigned8_t DefaultInflateSize;
// Operations
public:
CUnit();
virtual ~CUnit();
virtual unsigned8_t& operator[](const unsigned32_t index);
virtual CUnit& operator=(CUnit& newvalue);
virtual CUnit& operator+=(CUnit& from);
virtual CUnit& operator+= ( unsigned8_t from );
virtual size_t GetSize (void);
virtual unsigned32_t GetDataSize (void);
unsigned8_t* GetBuffer (void);
signed8_t Init (unsigned8_t* data,
const size_t size,
const unsigned32_t datasz);
signed8_t AddDataArray (const unsigned8_t* newdata, size_t size);
signed8_t AddFixedDataArray (const unsigned8_t value, size_t size);
#if VERSION_BIFF == VERSION_BIFF8
#ifdef HAVE_ICONV
void Conv32to16(std::string& iconv_code, std::ustring& str1, u16string& str2);
#endif
// DFH - to convert ascii string to unicode strings for BIFF8
signed8_t AddUnicodeStrlen(unsigned8_t newdata);
signed8_t AddUnicodeStrlen(unsigned16_t newdata);
signed8_t AddUnicodeString (const unsigned8_t* newdata, unsigned16_t size);
signed8_t AddUnicodeString (const unsigned16_t* newdata, unsigned16_t size);
#endif
/*
void SetShadow(bool shadowval);
void CopyShadowUnit(unsigned8_t* data, unsigned32_t size);
*/
protected:
signed8_t Append (CUnit& newunit);
signed8_t SetAt(unsigned8_t newval, unsigned32_t index);// Modify specific position
signed8_t AddValue16(unsigned16_t newval);
signed8_t AddValue32(unsigned32_t newval);
signed8_t AddValue64(unsigned64_t newval);
signed8_t SetValueAt(signed16_t newval, unsigned32_t index);
signed8_t SetValueAt(signed32_t newval, unsigned32_t index);
signed8_t GetValue16From(signed16_t* val, unsigned32_t index);
signed8_t GetValue32From(signed32_t* val, unsigned32_t index);
signed8_t SetArrayAt (const unsigned8_t* newdata, size_t size, unsigned32_t index);
signed8_t GetAt(signed8_t* data, unsigned32_t index);// Get specific data from storage
// signed8_t GetData(unsigned8_t** data, unsigned32_t from, unsigned32_t to );
signed8_t RemoveTrailData (unsigned32_t remove_size);
signed8_t AddValue8(unsigned8_t newdata);
signed8_t InitFill (unsigned8_t data, unsigned32_t size);
signed8_t Inflate(size_t increase = 0);
};
}
#endif // UNIT_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: unit.h,v $
* Revision 1.2 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.1.1.1 2004/08/27 16:31:46 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

560
uppdev/XLS/workbook.cpp Normal file
View file

@ -0,0 +1,560 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2004 Yeico S. A. de C. V.
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/workbook.cpp,v $
* $Revision: 1.3 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <XLS/workbook.h>
#ifdef HAVE_ICONV
#include <errno.h>
#endif
using namespace std;
using namespace xlslib_core;
#define CHANGE_DUMPSTATE(state) { \
m_PreviousDumpState = m_DumpState; \
m_DumpState = state; \
}
/*
**********************************************************************
workbook class implementation
**********************************************************************
*/
workbook::workbook()
: m_DumpState(WB_INIT),
m_PreviousDumpState(WB_FINISH),
m_pCurrentData(NULL),
m_pContinueRecord(NULL),
dump_not_started(true),
globalrec_size(0),
current_sheet(0),
offset(0)
{
#ifdef XLS_PHP
write_fptr = NULL;
m_Disposition = STK_ATTACHMENT;
#endif
#ifdef HAVE_ICONV
iconv_code = "wchar_t";
#endif
}
#ifdef XLS_PHP
workbook::workbook(write_fptr_t w_fptr)
: m_DumpState(WB_INIT),
m_PreviousDumpState(WB_FINISH),
m_pCurrentData(NULL),
m_pContinueRecord(NULL),
dump_not_started(true),
globalrec_size(0),
current_sheet(0),
offset(0)
{
write_fptr = w_fptr;
m_Disposition = STK_ATTACHMENT;
}
#endif
workbook::~workbook()
{
if(!m_Sheets.empty())
{
for(unsigned32_t i = 0; i<m_Sheets.size(); i++)
{
delete m_Sheets[i];
}
}
}
#ifdef HAVE_ICONV
int workbook::iconvInType(const char *inType)
{
int ret;
iconv_t cd;
cd = iconv_open("UCS-2-INTERNAL", inType);
if(cd != (iconv_t)(-1)) {
iconv_close(cd);
iconv_code = inType;
ret = 0;
} else {
ret = errno;
}
return ret;
}
#endif
/*
***********************************
***********************************
*/
worksheet* workbook::sheet(string sheetname)
{
worksheet* pnewsheet = new worksheet(&m_GlobalRecords);
m_Sheets.push_back(pnewsheet);
// NOTE: Streampos defaults to 0
// It has to be set somewhere else
m_GlobalRecords.AddBoundingSheet(0, BSHEET_ATTR_WORKSHEET, sheetname);
// Return a pointer to the just added sheet
return (m_Sheets.back());
}
#if VERSION_BIFF == VERSION_BIFF8
worksheet* workbook::sheet(ustring sheetname)
{
#ifdef HAVE_ICONV
worksheet* pnewsheet = new worksheet(&m_GlobalRecords, iconv_code);
m_Sheets.push_back(pnewsheet);
// NOTE: Streampos defaults to 0
// It has to be set somewhere else
m_GlobalRecords.AddBoundingSheet(0, BSHEET_ATTR_WORKSHEET, sheetname, iconv_code);
#else
worksheet* pnewsheet = new worksheet(&m_GlobalRecords);
m_Sheets.push_back(pnewsheet);
// NOTE: Streampos defaults to 0
// It has to be set somewhere else
m_GlobalRecords.AddBoundingSheet(0, BSHEET_ATTR_WORKSHEET, sheetname);
#endif
// Return a pointer to the just added sheet
return (m_Sheets.back());
}
#endif
/*
***********************************
***********************************
*/
worksheet* workbook::GetSheet(unsigned16_t sheetnum)
{
if(sheetnum < m_Sheets.size())
{
return m_Sheets[sheetnum];
} else {
return NULL;
}
}
/*
***********************************
***********************************
*/
font_t* workbook::font(string name)
{
font_t* newfont = new font_t;
newfont->SetName(name);
return(m_GlobalRecords.AddFont(newfont));
}
/*
***********************************
***********************************
*/
format_t* workbook::format(string formatstr)
{
format_t* newformat = new format_t(0x0000, formatstr);
return(m_GlobalRecords.AddFormat(newformat));
}
xf_t* workbook::xformat(void)
{
xf_t* newxf = new xf_t;
newxf->MarkUsed();
return(m_GlobalRecords.AddXFormat(newxf));
}
xf_t* workbook::xformat(font_t* font)
{
xf_t* newxf = new xf_t;
newxf->MarkUsed();
newxf->SetFont(font);
return(m_GlobalRecords.AddXFormat(newxf));
}
/*
***********************************
***********************************
*/
#define SETWORKBOOK5() \
CDataStorage biffdata; \
CUnit* precorddata; \
bool keep = true; \
do { \
precorddata = DumpData(); \
\
if(precorddata != NULL) \
biffdata += precorddata; \
else \
keep = false; \
}while(keep); \
\
AddFile("/Book",&biffdata); \
string name; \
name = (char)0x05; \
name += "SummaryInformation"; \
AddFile(name, &m_SummaryInfo); \
name = (char)0x05; \
name += "DocumentSummaryInformation"; \
AddFile(name, &m_DocSummaryInfo);
#define SETWORKBOOK8() \
CDataStorage biffdata; \
CUnit* precorddata; \
bool keep = true; \
do { \
precorddata = DumpData(); \
\
if(precorddata != NULL) \
biffdata += precorddata; \
else \
keep = false; \
} while(keep); \
\
AddFile("/Workbook",&biffdata); \
string name; \
name = (char)0x05; \
name += "SummaryInformation"; \
AddFile(name, &m_SummaryInfo); \
name = (char)0x05; \
name += "DocumentSummaryInformation"; \
AddFile(name, &m_DocSummaryInfo);
#ifdef XLS_PHP
/******************************
* This function has to be called before any output to the php-string
* (this includes any non-php-script text in the source file or
* zend_printf call) because it makes use of headers() php-function,
* which has to be called before any of those kind of output.
* If this restraint isn't followed, the html-header won't be modified
* and the binary data will be displayed in the browser (in the best of
* cases).
* This can also be avoided using buffering in the PHP environment
* See chapter LXXVIII. "Output Control Functions" of the PHP manual.
******************************/
void workbook::Stroke(string filename)
{
SetStroke();
#if VERSION_BIFF == VERSION_BIFF5
SETWORKBOOK5();
#else // VERSION_BIFF8
SETWORKBOOK8();
#endif
DumpOleFile();
}
void workbook::Disposition(Stroke_Disposition_t disp)
{
m_Disposition = disp;
}
#endif
int workbook::Dump(string filename)
{
int errors;
if(m_Sheets.empty()) {
return GENERAL_ERROR;
}
#ifdef XLS_PHP
UnSetStroke();
#endif
errors = Open(filename);
if(errors == NO_ERRORS) {
#if VERSION_BIFF == VERSION_BIFF5
SETWORKBOOK5();
#else // VERSION_BIFF8
SETWORKBOOK8();
#endif
errors = DumpOleFile();
Close();
}
return errors;
}
/*
***********************************
***********************************
*/
CUnit* workbook::DumpData(void)
{
bool repeat = false;
XTRACE("\nworkbook::DumpData");
do
{
switch(m_DumpState)
{
case WB_INIT:
dump_not_started = true;
globalrec_size = 0;
current_sheet = 0;
offset = 0;
CHANGE_DUMPSTATE(WB_GLOBALRECORDS);
repeat = true;
break;
case WB_GLOBALRECORDS:
XTRACE("\tGLOBALRECORDS");
repeat = false;
if(dump_not_started)
{ // the following code is executed only if this is the first pas to the first dump-state
// Basically, streampositions of BoundingSheet records are initialized.
dump_not_started = false;
globalrec_size = m_GlobalRecords.GetSize();
offset = globalrec_size;
unsigned32_t offset_from_globalrecs = 0;
if(!m_Sheets.empty())
{
Boundsheet_List_Itor_t bs = m_GlobalRecords.GetFirstBoundSheet();
for(unsigned16_t i = 0; i < m_Sheets.size(); i++)
{
(*bs) -> streampos = globalrec_size + offset_from_globalrecs;
m_GlobalRecords.GetBoundingSheets(bs);
offset_from_globalrecs += m_Sheets[i]->GetSize();
}
}
else
{
//Nothing else to do.
}
//TODO: Add other EOF/BOF blocks here
}
m_pCurrentData = m_GlobalRecords.DumpData();
if(m_pCurrentData == NULL)
{
if(!m_Sheets.empty())
{
// get in advance the first record of the first sheet
//m_pCurrentData = m_Sheets[0].DumpData(globalrec_size);
repeat = true;
CHANGE_DUMPSTATE(WB_SHEETS);
}
else
{
// Nothing else to do. Branch to the FINISH state
m_pCurrentData = NULL;
CHANGE_DUMPSTATE(WB_FINISH);
}
}
else
{
// Do nothing. Continue in this state.
}
break;
case WB_SHEETS:
{
XTRACE("\tSHEETS");
repeat = false;
// If I got here, there's at least one sheet which has already
// sent the first record block of data.
//m_GlobalRecords.GetSize();
m_pCurrentData = m_Sheets[current_sheet]->DumpData(offset);
if(m_pCurrentData == NULL)
{
if((unsigned16_t)(current_sheet+1) < m_Sheets.size())
{
// Update the offset for the next sheet
offset += m_Sheets[current_sheet]->GetSize();
current_sheet++;
// ... and get the first record of the next sheet.
// m_pCurrentData = m_Sheets[current_sheet].DumpData(offset);
repeat = true;
}
else
{
// I'm done with all the sheets
// Nothing else to do. Branch to the FINISH state
CHANGE_DUMPSTATE(WB_FINISH);
repeat = true;
}
}
break;
}
case WB_FINISH:
XTRACE("\tFINISH");
repeat = false;
m_pCurrentData = NULL;
CHANGE_DUMPSTATE(WB_INIT);
break;
case WB_CONTINUE_REC:
XTRACE("\tCONTINUE-REC");
repeat = false;
if(m_ContinueIndex == 0)
{
//Create a new data unit containing the max data size
m_pContinueRecord = (CUnit*)(new CRecord());
// The real size of the record is the size of the buffer minus the
// size of the header record
((CUnit*)(m_pContinueRecord))->AddDataArray(((CRecord*)m_pCurrentData)->GetRecordDataBuffer(),MAX_RECORD_SIZE);
((CRecord*)(m_pContinueRecord))->SetRecordType(((CRecord*)m_pCurrentData)->GetRecordType());
((CRecord*)(m_pContinueRecord))->SetRecordLength(MAX_RECORD_SIZE);
// m_pContinueRecord->SetValueAt(MAX_RECORD_SIZE-4,2);
m_ContinueIndex++;
return m_pContinueRecord;
}
else
{
//Delete_Pointer(m_pContinueRecord);
// Get a pointer to the next chunk of data
unsigned8_t* pdata = (((CRecord*)m_pCurrentData)->GetRecordDataBuffer()) + m_ContinueIndex*MAX_RECORD_SIZE;
// Get the size of the chunk of data (that is the MAX_REC_SIZE except by the last one)
unsigned32_t csize = 0;
if(( ((CRecord*)m_pCurrentData)->GetRecordDataSize()/MAX_RECORD_SIZE) > (m_ContinueIndex))
{
csize = MAX_RECORD_SIZE;
m_ContinueIndex++;
m_pContinueRecord =(CUnit*) ( new CContinue(pdata, csize));
return m_pContinueRecord;
}
else
{
unsigned32_t data_size = ((CRecord*)m_pCurrentData)->GetRecordDataSize();
csize = (data_size - (m_ContinueIndex) * MAX_RECORD_SIZE);
// Restore the previous state (*Don't use the macro*)
m_DumpState = m_PreviousDumpState;
m_PreviousDumpState = WB_CONTINUE_REC;
m_ContinueIndex = 0;
if(csize)
{
m_pContinueRecord = (CUnit*) new CContinue(pdata, csize);
Delete_Pointer(m_pCurrentData);
return m_pContinueRecord;
}
else
{
Delete_Pointer(m_pCurrentData);
repeat = true;
}
}
}
break;
default:
XTRACE("\tDEFAULT");
break;
}
if(m_pCurrentData != NULL)
if(((CRecord*)m_pCurrentData)->GetRecordDataSize() >= MAX_RECORD_SIZE && m_DumpState != WB_CONTINUE_REC)
{
// Save the current dump satate and change to the CONTINUE Record state
CHANGE_DUMPSTATE(WB_CONTINUE_REC);
m_ContinueIndex = 0;
repeat = true;
}
} while(repeat);
return m_pCurrentData;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: workbook.cpp,v $
* Revision 1.3 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.2 2004/09/01 00:47:21 darioglz
* + Modified to gain independence of target
*
* Revision 1.1.1.1 2004/08/27 16:31:49 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

148
uppdev/XLS/workbook.h Normal file
View file

@ -0,0 +1,148 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* $Source: /cvsroot/xlslib/xlslib/src/xlslib/workbook.h,v $
* $Revision: 1.3 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:39:54 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
*
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef WORKBOOK_H
#define WORKBOOK_H
#include <sstream>
#include <XLS/config.h>
#include <XLS/common.h>
#include <XLS/ole/oledoc.h>
#include <XLS/datast.h>
#include <XLS/globalrec.h>
#include <XLS/sheetrec.h>
#include <XLS/recdef.h>
#include <XLS/continue.h>
#include <XLS/summinfo.h>
#include <XLS/docsumminfo.h>
namespace xlslib_core
{
typedef enum
{
WB_INIT,
WB_GLOBALRECORDS,
WB_SHEETS,
WB_CONTINUE_REC,
WB_FINISH
} WorkbookDumpState_t;
#ifdef XLS_PHP
typedef enum
{
STK_INLINE=0,
STK_ATTACHMENT
} Stroke_Disposition_t;
#endif
class workbook
:public COleDoc
{
private:
CSummaryInfo m_SummaryInfo;
CDocSummaryInfo m_DocSummaryInfo;
CGlobalRecords m_GlobalRecords;
Sheets_Vector_t m_Sheets;
WorkbookDumpState_t m_DumpState;
WorkbookDumpState_t m_PreviousDumpState;
CUnit* m_pCurrentData;
// Continue record variables:
CUnit* m_pContinueRecord;
unsigned16_t m_ContinueIndex;
#ifdef HAVE_ICONV
std::string iconv_code;
#endif
protected:
public:
workbook();
#ifdef XLS_PHP
workbook(write_fptr_t w_fptr);
#endif
~workbook();
worksheet* sheet(std::string sheetname);
#if VERSION_BIFF == VERSION_BIFF8
worksheet* sheet(std::ustring sheetname);
#endif
worksheet* GetSheet(unsigned16_t sheetnum);
font_t* font(std::string name);
format_t* format(std::string formatstr);
xf_t* xformat(void);
xf_t* xformat(font_t* font);
#ifdef HAVE_ICONV
int iconvInType(const char *inType);
#endif
CUnit* DumpData(void); // oledoc use
int Dump(std::string filename);
#ifdef XLS_PHP
void Disposition(Stroke_Disposition_t disp);
void Stroke(std::string filename);
Stroke_Disposition_t m_Disposition;
#endif
private:
bool dump_not_started;
unsigned32_t globalrec_size;
unsigned16_t current_sheet;
unsigned32_t offset;
};
}
#endif //WORKBOOK_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* $Log: workbook.h,v $
* Revision 1.3 2008/10/25 18:39:54 dhoerl
* 2008
*
* Revision 1.2 2004/09/01 00:47:21 darioglz
* + Modified to gain independence of target
*
* Revision 1.1.1.1 2004/08/27 16:31:44 darioglz
* Initial Import.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

392
uppdev/XLS/xlslib.h Normal file
View file

@ -0,0 +1,392 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This file is part of xlslib -- A multiplatform, C/C++ library
* for dynamic generation of Excel(TM) files.
*
* xlslib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* xlslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with xlslib. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2008 David Hoerl
*
* $Source: /cvsroot/xlslib/xlslib/src/common/xlslib.h,v $
* $Revision: 1.1 $
* $Author: dhoerl $
* $Date: 2008/10/25 18:44:32 $
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* File description:
*
* all include file for users
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifdef __cplusplus
#include <XLS/workbook.h>
#define EXTERN_TYPE extern "C"
using namespace xlslib_core;
#else // "C"
#define EXTERN_TYPE extern
typedef uintptr_t write_fptr_t;
typedef unsigned char unsigned8_t;
typedef unsigned short int unsigned16_t;
typedef unsigned uint32_t unsigned32_t;
#if defined(_MSC_VER) && defined(WIN32)
typedef __int64 unsigned64_t;
#else
//typedef long long unsigned int unsigned64_t;
typedef uint64_t unsigned64_t;
#endif
typedef char signed8_t;
typedef short int signed16_t;
typedef int32_t signed32_t;
typedef enum
{
FMT_GENERAL = 0,
FMT_NUMBER1,
FMT_NUMBER2,
FMT_NUMBER3,
FMT_NUMBER4,
FMT_CURRENCY1,
FMT_CURRENCY2,
FMT_CURRENCY3,
FMT_CURRENCY4,
FMT_PERCENT1,
FMT_PERCENT2,
FMT_SCIENTIFIC1,
FMT_FRACTION1,
FMT_FRACTION2,
FMT_DATE1,
FMT_DATE2,
FMT_DATE3,
FMT_DATE4,
FMT_HOUR1,
FMT_HOUR2,
FMT_HOUR3,
FMT_HOUR4,
FMT_HOURDATE,
FMT_NUMBER5,
FMT_NUMBER6,
FMT_NUMBER7,
FMT_NUMBER8,
FMT_ACCOUNTING1,
FMT_ACCOUNTING2,
FMT_ACCOUNTING3,
FMT_ACCOUNTING4,
FMT_HOUR5,
FMT_HOUR6,
FMT_HOUR7,
FMT_SCIENTIFIC2,
FMT_TEXT
} format_number_t;
typedef enum
{
HALIGN_GENERAL = 0,
HALIGN_LEFT,
HALIGN_CENTER,
HALIGN_RIGHT,
HALIGN_FILL,
HALIGN_JUSTIFY,
HALIGN_CENTERACCROSS
} halign_option_t;
typedef enum
{
VALIGN_TOP = 0,
VALIGN_CENTER,
VALIGN_BOTTOM,
VALIGN_JUSTIFY
} valign_option_t;
typedef enum
{
ORI_NONE = 0,
ORI_TOPBOTTOMTXT,
ORI_90NOCLOCKTXT,
ORI_90CLOCKTXT
} txtori_option_t;
typedef enum
{
COLOR_BLACK,
COLOR_DARK_RED,
COLOR_RED,
COLOR_FUCSIA,
COLOR_COMBINED01,
COLOR_COMBINED02,
COLOR_COMBINED03,
COLOR_COMBINED04,
COLOR_COMBINED05,
COLOR_COMBINED06,
COLOR_OLIVE,
COLOR_DARK_YELLOW,
COLOR_COMBINED07,
COLOR_YELLOW,
COLOR_LIGHT_YELLOW,
COLOR_DARK_GREEN,
COLOR_GREEN,
COLOR_COMBINED08,
COLOR_LIVING_GREEN,
COLOR_LIGHT_GREEN,
COLOR_COMBINED09,
COLOR_BLUE_GREEN,
COLOR_AQUAMARINA,
COLOR_TURQOISE,
COLOR_COMBINED10,
COLOR_DARK_BLUE,
COLOR_BLUE,
COLOR_LIGHT_BLUE,
COLOR_SKY_BLUE,
COLOR_COMBINED11,
COLOR_INDIGO,
COLOR_BLUE_GRAY,
COLOR_VIOLET,
COLOR_PLUM,
COLOR_LAVANDER,
COLOR_COMBINED12,
COLOR_GRAY50,
COLOR_GRAY40,
COLOR_GRAY25,
COLOR_WHITE
} color_name_t;
typedef enum
{
FILL_NONE = 0,
FILL_SOLID,
FILL_ATEN75,
FILL_ATEN50,
FILL_ATEN25,
FILL_ATEN12,
FILL_ATEN06,
FILL_HORIZ_LIN,
FILL_VERTICAL_LIN,
FILL_DIAG,
FILL_INV_DIAG,
FILL_INTER_DIAG,
FILL_DIAG_THICK_INTER,
FILL_HORIZ_LINES_THIN,
FILL_VERTICAL_LINES_THIN,
FILL_DIAG_THIN,
FILL_INV_DIAG_THIN,
FILL_HORIZ_INT_THIN,
FILL_HORIZ_INTER_THICK
} fill_option_t;
typedef enum
{
BORDER_NONE = 0,
BORDER_THIN,
BORDER_MEDIUM,
BORDER_DASHED,
BORDER_DOTTED,
BORDER_THICK,
BORDER_DOUBLE,
BORDER_HAIR
} border_style_t;
typedef enum
{
BORDER_BOTTOM = 0,
BORDER_TOP,
BORDER_LEFT,
BORDER_RIGHT
} border_side_t;
typedef enum
{
BOLDNESS_BOLD = 0,
BOLDNESS_HALF,
BOLDNESS_NORMAL,
BOLDNESS_DOUBLE
} boldness_option_t;
typedef enum
{
SCRIPT_NONE = 0,
SCRIPT_SUPER,
SCRIPT_SUB
} script_option_t;
typedef enum
{
UNDERLINE_NONE = 0,
UNDERLINE_SINGLE,
UNDERLINE_DOUBLE,
UNDERLINE_SINGLEACC,
UNDERLINE_DOUBLEACC
} underline_option_t;
typedef enum
{
BOLDNESS_BOLD = 0,
BOLDNESS_HALF,
BOLDNESS_NORMAL,
BOLDNESS_DOUBLE
} boldness_option_t;
typedef enum
{
SCRIPT_NONE = 0,
SCRIPT_SUPER,
SCRIPT_SUB
} script_option_t;
typedef enum
{
UNDERLINE_NONE = 0,
UNDERLINE_SINGLE,
UNDERLINE_DOUBLE,
UNDERLINE_SINGLEACC,
UNDERLINE_DOUBLEACC
} underline_option_t;
typedef struct _workbook workbook;
typedef struct _worksheet worksheet;
typedef struct _font_t font_t;
typedef struct _format_t format_t;
typedef struct _cell_t cell_t;
typedef struct _xf_t xf_t;
typedef struct _range range;
#ifndef bool
typedef int bool;
#endif
#endif
// Workbook
EXTERN_TYPE workbook *newWorkbook(void);
#ifdef XLS_PHP
EXTERN_TYPE workbook *newWorkbook_w_fptr(write_fptr_t w_fptr);
#endif
EXTERN_TYPE void deleteWorkbook(workbook *w);
EXTERN_TYPE worksheet *callWorkbookSheet(workbook *w, char *sheetname);
#if VERSION_BIFF == VERSION_BIFF8
EXTERN_TYPE worksheet *callWorkbookSheetW(workbook *w, uchar_t *sheetname);
#endif
EXTERN_TYPE worksheet *callWorkbookGetSheet(workbook *w, unsigned16_t sheetnum);
EXTERN_TYPE font_t *callWorkbookFont(workbook *w, char *name);
EXTERN_TYPE xf_t *callWorkbookxFormat(workbook *w);
EXTERN_TYPE xf_t *callWorkbookxFormatFont(workbook *w, font_t *font);
EXTERN_TYPE int callWorkbookDump(workbook *w, char *filename);
#ifdef XLS_PHP
EXTERN_TYPE void callWorkbookDisposition(workbook *w, Stroke_Disposition_t disp);
EXTERN_TYPE void callWorkbookStroke(workbook *w, char *filename);
#endif
// Worksheet
EXTERN_TYPE cell_t *callWorksheetFindCell(worksheet *w, unsigned16_t row, unsigned16_t col);
EXTERN_TYPE void callWorksheetMerge(worksheet *w, unsigned16_t first_row, unsigned16_t first_col, unsigned16_t last_row, unsigned16_t last_col);
EXTERN_TYPE void callWorksheetColwidth(worksheet *w, unsigned16_t col, unsigned16_t width);
EXTERN_TYPE void callWorksheetRowheight(worksheet *w, unsigned16_t row, unsigned16_t height);
EXTERN_TYPE range *callWorksheetRangegroup(worksheet *w, unsigned16_t row1, unsigned16_t col1, unsigned16_t row2, unsigned16_t col2);
EXTERN_TYPE cell_t *callWorksheetLabel(worksheet *w, unsigned16_t row, unsigned16_t col, char *strlabel, xf_t *pxformat);
#if VERSION_BIFF == VERSION_BIFF8
EXTERN_TYPE cell_t *callWorksheetLabelW(worksheet *w, unsigned16_t row, unsigned16_t col, uchar_t *strlabel, xf_t *pxformat);
#endif
EXTERN_TYPE cell_t *callWorksheetBlank(worksheet *w, unsigned16_t row, unsigned16_t col, xf_t *pxformat);
EXTERN_TYPE cell_t *callWorksheetNumber(worksheet *w, unsigned16_t row, unsigned16_t col, double numval, format_number_t fmtval, xf_t *pxformat);
// cell: xfi
EXTERN_TYPE void callCellFont(cell_t *c, font_t *fontidx);
EXTERN_TYPE void callCellFormat(cell_t *c, format_number_t formatidx);
EXTERN_TYPE void callCellHalign(cell_t *c, halign_option_t ha_option);
EXTERN_TYPE void callCellValign(cell_t *c, valign_option_t va_option);
EXTERN_TYPE void callCellOrientation(cell_t *c, txtori_option_t ori_option);
EXTERN_TYPE void callCellFillfgcolor(cell_t *c, color_name_t color);
EXTERN_TYPE void callCellFillbgcolor(cell_t *c, color_name_t color);
EXTERN_TYPE void callCellFillstyle(cell_t *c, fill_option_t fill);
EXTERN_TYPE void callCellLocked(cell_t *c, bool locked_opt);
EXTERN_TYPE void callCellHidden(cell_t *c, bool hidden_opt);
EXTERN_TYPE void callCellWrap(cell_t *c, bool wrap_opt);
EXTERN_TYPE void callCellBorderstyle(cell_t *c, border_side_t side, border_style_t style, color_name_t color);
EXTERN_TYPE void callCellFontname(cell_t *c, char *fntname);
// cell: font
EXTERN_TYPE void callCellFontheight(cell_t *c, unsigned16_t fntheight);
EXTERN_TYPE void callCellFontbold(cell_t *c, boldness_option_t fntboldness);
EXTERN_TYPE void callCellFontunderline(cell_t *c, underline_option_t fntunderline);
EXTERN_TYPE void callCellFontscript(cell_t *c, script_option_t fntscript);
EXTERN_TYPE void callCellFontcolor(cell_t *c, color_name_t fntcolor);
EXTERN_TYPE void callCellFontattr(cell_t *c, unsigned16_t attr);
EXTERN_TYPE void callCellFontitalic(cell_t *c, bool italic);
EXTERN_TYPE void callCellFontstrikeout(cell_t *c, bool so);
EXTERN_TYPE void callCellFontoutline(cell_t *c, bool ol);
EXTERN_TYPE void callCellFontshadow(cell_t *c, bool sh);
EXTERN_TYPE unsigned16_t callCellGetRow(cell_t *c);
EXTERN_TYPE unsigned16_t callCellGetCol(cell_t *c);
EXTERN_TYPE unsigned16_t callCellGetXFIndex(cell_t *c);
EXTERN_TYPE void callCellSetXF(cell_t *c, xf_t *pxfval);
// range
EXTERN_TYPE void callRangeCellcolor(range *r, color_name_t color);
// xformat
EXTERN_TYPE void callXformatSetFont(xf_t *x, font_t* fontidx);
EXTERN_TYPE unsigned16_t callXformatGetFontIndex(xf_t *x);
EXTERN_TYPE font_t* callXformatGetFont(xf_t *x);
EXTERN_TYPE void callXformatSetFormat(xf_t *x, format_number_t formatidx);
EXTERN_TYPE unsigned16_t callXformatGetFormatIndex(xf_t *x);
EXTERN_TYPE format_number_t callXformatGetFormat(xf_t *x);
EXTERN_TYPE void callXformatSetHAlign(xf_t *x, halign_option_t ha_option);
EXTERN_TYPE unsigned8_t callXformatGetHAlign(xf_t *x);
EXTERN_TYPE void callXformatSetVAlign(xf_t *x, valign_option_t va_option);
EXTERN_TYPE unsigned8_t callXformatGetVAlign(xf_t *x);
EXTERN_TYPE void callXformatSetTxtOrientation(xf_t *x, txtori_option_t ori_option);
EXTERN_TYPE unsigned8_t callXformatGetTxtOrientation(xf_t *x);
EXTERN_TYPE void callXformatSetFillFGColor(xf_t *x, color_name_t color);
EXTERN_TYPE unsigned8_t callXformatGetFillFGColor(xf_t *x);
EXTERN_TYPE void callXformatSetFillBGColor(xf_t *x, color_name_t color);
EXTERN_TYPE unsigned8_t callXformatGetFillBGColor(xf_t *x);
EXTERN_TYPE void callXformatSetFillStyle(xf_t *x, fill_option_t fill);
EXTERN_TYPE unsigned8_t callXformatGetFillStyle(xf_t *x);
EXTERN_TYPE void callXformatSetLocked(xf_t *x, bool locked_opt);
EXTERN_TYPE bool callXformatIsLocked(xf_t *x);
EXTERN_TYPE void callXformatSetHidden(xf_t *x, bool hidden_opt);
EXTERN_TYPE bool callXformatIsHidden(xf_t *x);
EXTERN_TYPE void callXformatSetWrap(xf_t *x, bool wrap_opt);
EXTERN_TYPE bool callXformatIsWrap(xf_t *x);
EXTERN_TYPE void callXformatSetCellMode(xf_t *x, bool cellmode);
EXTERN_TYPE bool callXformatIsCell(xf_t *x);
EXTERN_TYPE void callXformatSetBorderStyle(xf_t *x, border_side_t side, border_style_t style, color_name_t color);
EXTERN_TYPE unsigned8_t callXformatGetBorderStyle(xf_t *x, border_side_t side);
EXTERN_TYPE unsigned8_t callXformatGetBorderColor(xf_t *x, border_side_t side);
EXTERN_TYPE unsigned32_t callXformatGetSignature(xf_t *x);
// Font
EXTERN_TYPE void callFontSetName(font_t *f, char *name);
EXTERN_TYPE char *callFontGetName(font_t *f, char *name);
EXTERN_TYPE void callFontSetHeight(font_t *f, unsigned16_t fntheight);
EXTERN_TYPE unsigned16_t callFontGetHeight(font_t *f);
EXTERN_TYPE void callFontSetBoldStyle(font_t *f, boldness_option_t fntboldness);
EXTERN_TYPE unsigned16_t callFontGetBoldStyle(font_t *f);
EXTERN_TYPE void callFontSetUnderlineStyle(font_t *f, underline_option_t fntunderline);
EXTERN_TYPE unsigned8_t callFontGetUnderlineStyle(font_t *f);
EXTERN_TYPE void callFontSetScriptStyle(font_t *f, script_option_t fntscript);
EXTERN_TYPE unsigned16_t callFontGetScriptStyle(font_t *f);
EXTERN_TYPE void callFontSetColor(font_t *f, color_name_t fntcolor);
EXTERN_TYPE unsigned16_t callFontGetColor(font_t *f);
EXTERN_TYPE void callFontSetItalic(font_t *f, bool italic);
EXTERN_TYPE void callFontSetStrikeout(font_t *f, bool so);
EXTERN_TYPE void callFontSetAttributes(font_t *f, unsigned16_t attr);
EXTERN_TYPE unsigned16_t callFontGetAttributes(font_t *f);
EXTERN_TYPE void callFontSetOutline(font_t *f, bool ol);
EXTERN_TYPE void callFontSetShadow(font_t *f, bool sh);