Go to the documentation of this file.
34 #ifndef GREAT_WKS_DB_PARSER
35 # define GREAT_WKS_DB_PARSER
40 #include <librevenge/librevenge.h>
74 void parse(librevenge::RVNGSpreadsheetInterface *documentInterface);
81 void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface);
129 bool readFormula(
long endPos, std::vector<MWAWCellContent::FormulaInstruction> &formula);
161 shared_ptr<GreatWksDBParserInternal::State>
m_state;
@ F_CellList
Definition: MWAWCell.hxx:360
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
@ MWAW_K_DATABASE
database
Definition: MWAWDocument.hxx:87
Format const & getFormat() const
returns the cell format
Definition: MWAWCell.hxx:211
bool m_footerPrint
Definition: GreatWksDBParser.cxx:402
bool readHeader()
try to read the database header: list of zones, ...
Definition: GreatWksDBParser.cxx:737
virtual class which defines the ancestor of all spreadsheet zone parser
Definition: MWAWParser.hxx:281
bool m_headerPrint
the header is printed
Definition: GreatWksDBParser.cxx:402
bool readForm(MWAWEntry const &zone)
try to read a form zone
Definition: GreatWksDBParser.cxx:2016
bool readField(GreatWksDBParserInternal::Field &field)
try to read a field
Definition: GreatWksDBParser.cxx:1617
void setName(std::string const &nam)
sets the name of the entry
Definition: MWAWEntry.hxx:137
int m_id
the subdocument id
Definition: GreatWksDBParser.cxx:431
State()
constructor
Definition: GreatWksDBParser.cxx:389
MWAWEntry m_textEntry
the cell string
Definition: MWAWCell.hxx:438
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:262
shared_ptr< MWAWSpreadsheetListener > MWAWSpreadsheetListenerPtr
a smart pointer of MWAWSpreadsheetListener
Definition: libmwaw_internal.hxx:515
bool checkSmallZone(MWAWEntry &zone)
check if a pointer correspond or not to a small zone entry, if so update the entry
Definition: GreatWksDBParser.cxx:1151
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:127
bool m_isSequence
true if the number is a sequence
Definition: GreatWksDBParser.cxx:220
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:785
void addDelimiter(long pos, char c)
adds a not breaking delimiter in position pos
Definition: MWAWDebug.cxx:73
void setValue(double value)
sets the double value
Definition: MWAWCell.hxx:407
virtual bool operator!=(MWAWSubDocument const &doc) const
operator!=
Definition: GreatWksDBParser.cxx:455
bool createZones()
finds the different objects zones
Definition: GreatWksDBParser.cxx:574
@ F_Summary
Definition: GreatWksDBParser.cxx:183
a big block of a GreatWksDBParser
Definition: GreatWksDBParser.cxx:100
@ F_DATE
Definition: MWAWCell.hxx:56
std::vector< int > m_heightRows
the row height in points
Definition: GreatWksDBParser.cxx:377
@ F_Date
Definition: GreatWksDBParser.cxx:183
int m_footerHeight
the footer height if known
Definition: GreatWksDBParser.cxx:404
BlockHeader m_header
the corresponding entry header
Definition: GreatWksDBParser.cxx:148
void setPosition(MWAWVec2i posi)
set the cell positions : 0,0 -> A1, 0,1 -> A2
Definition: MWAWCell.hxx:163
bool isParsed() const
a flag to know if the entry was parsed or not
Definition: MWAWEntry.hxx:110
std::string m_extra
extra data
Definition: GreatWksDBParser.cxx:227
@ F_Operator
Definition: MWAWCell.hxx:360
void init()
inits all internal variables
Definition: GreatWksDBParser.cxx:478
std::vector< BlockHeader > m_blocks
the list of big blocks
Definition: GreatWksDBParser.cxx:398
bool readFormulaResult(long endPos, GreatWksDBParserInternal::Cell &cell, std::string &extra)
try to read a formula result in a row content zone
Definition: GreatWksDBParser.cxx:1449
bool isValueSet() const
returns true if the value has been setted
Definition: MWAWCell.hxx:413
bool sendHF(int id)
try to send the i^th header/footer
Definition: GreatWksDBParser.cxx:494
bool open(std::string const &filename)
opens/creates a file to store a result
Definition: MWAWDebug.cxx:46
@ F_Picture
Definition: GreatWksDBParser.cxx:183
size_t getNumZones() const
returns the number of zone
Definition: GreatWksDBParser.cxx:133
a field of a GreatWksDBParser
Definition: GreatWksDBParser.cxx:181
int m_numRecords
the number of records
Definition: GreatWksDBParser.cxx:365
small class use to define a formula instruction
Definition: MWAWCell.hxx:359
int id() const
returns the id
Definition: MWAWEntry.hxx:153
int m_widthDefault
the default column width
Definition: GreatWksDBParser.cxx:371
static std::string getBasicCellName(MWAWVec2i const &pos)
return the name of a cell (given row and column) : 0,0 -> A1, 0,1 -> A2...
Definition: MWAWCell.cxx:342
MWAWEntry m_footerBlockHeader
the footer entry (in v2)
Definition: GreatWksDBParser.cxx:401
int version() const
returns the works version
Definition: MWAWParser.hxx:108
bool readDatabase()
read the database block
Definition: GreatWksDBParser.cxx:690
Internal: the structures of a GreatWksDBParser.
Definition: GreatWksDBParser.cxx:64
bool checkHeader(MWAWHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: GreatWksDBParser.cxx:2216
void setAnchorToCell(librevenge::RVNGString const &cellName)
sets the anchor to a cell position
Definition: MWAWPosition.hxx:228
bool readRowLinks(GreatWksDBParserInternal::Block &block)
try to read row record to small zone link (the 1th big zone)
Definition: GreatWksDBParser.cxx:1041
@ F_Function
Definition: MWAWCell.hxx:360
bool readFieldLinks(GreatWksDBParserInternal::Field &field)
try to read a zone which links a field to zone record
Definition: GreatWksDBParser.cxx:1901
void setFormat(Format const &format)
set the cell format
Definition: MWAWCell.hxx:216
the main class to read a GreatWorks database file
Definition: GreatWksDBParser.hxx:62
bool readFieldAuxis(MWAWEntry const &zon)
try to read a field extra v2 zone ( small zone 13)
Definition: GreatWksDBParser.cxx:1705
void resetSpreadsheetListener()
resets the listener
Definition: MWAWParser.cxx:140
bool readRecordList(GreatWksDBParserInternal::Block &block)
try to read the record list (the 3th big zone)
Definition: GreatWksDBParser.cxx:959
@ F_NUMBER_GENERIC
Definition: MWAWCell.hxx:58
~Block()
destructor
Definition: GreatWksDBParser.cxx:124
void setParsed(bool ok=true) const
sets the flag m_parsed to true or false
Definition: MWAWEntry.hxx:115
Zone()
constructor
Definition: GreatWksDBParser.cxx:104
std::string m_name
the database name
Definition: GreatWksDBParser.cxx:381
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59
abstract class used to store a subdocument (with a comparison function)
Definition: MWAWSubDocument.hxx:42
std::string m_content
the content ( if type == F_Operator or type = F_Function or type==F_Text)
Definition: MWAWCell.hxx:376
bool sendDatabase()
try to send the main database
Definition: GreatWksDBParser.cxx:2150
long m_linkZone
the file position which stores the position link to record zone
Definition: GreatWksDBParser.cxx:203
int m_summaryField
the summary field
Definition: GreatWksDBParser.cxx:215
bool isEmpty() const
returns true if the zone list is empty
Definition: GreatWksDBParser.cxx:128
libmwaw::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: MWAWParser.hxx:195
bool readFormLinks(MWAWEntry const &zone)
try to read the list of form
Definition: GreatWksDBParser.cxx:1962
std::string const & asciiName() const
return the ascii file name
Definition: MWAWParser.hxx:232
int m_actPage
the actual page
Definition: GreatWksDBParser.cxx:399
MWAWCell::Format m_format
the field format
Definition: GreatWksDBParser.cxx:201
std::vector< Zone > m_zoneList
the zone list
Definition: GreatWksDBParser.cxx:150
MWAWSpreadsheetListenerPtr & getSpreadsheetListener()
returns the spreadsheet listener
Definition: MWAWParser.hxx:140
bool readFieldRecords(GreatWksDBParserInternal::Field &field)
try to read a list of records corresponding to field
Definition: GreatWksDBParser.cxx:1780
SubDocumentType
Definition: libmwaw_internal.hxx:178
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:85
std::vector< FormulaInstruction > m_formula
the formula list of instruction
Definition: MWAWCell.hxx:440
This class contents the main functions needed to create a spreadsheet processing Document.
Definition: MWAWSpreadsheetListener.hxx:66
int m_id
the field id
Definition: GreatWksDBParser.cxx:197
void setAsciiName(char const *name)
Debugging: change the default ascii file.
Definition: MWAWParser.hxx:227
void skipZone(long beginPos, long endPos)
skips the file zone defined by beginPos-endPos
Definition: MWAWDebug.hxx:105
int m_heightDefault
the default row height
Definition: GreatWksDBParser.cxx:375
bool dumpFile(librevenge::RVNGBinaryData &data, char const *fileName)
a debug function to store in a datafile in the current directory WARNING: this function erase the fil...
Definition: MWAWDebug.cxx:197
bool readFormula(long endPos, std::vector< MWAWCellContent::FormulaInstruction > &formula)
try to read a formula result in field definition
Definition: GreatWksDBParser.cxx:1388
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type)
the parser function
Definition: GreatWksDBParser.cxx:434
void setEnd(long off)
sets the end offset
Definition: MWAWEntry.hxx:66
Type m_type
the type
Definition: MWAWCell.hxx:374
std::vector< Field > m_fieldList
the list of field
Definition: GreatWksDBParser.cxx:369
virtual ~GreatWksDBParser()
destructor
Definition: GreatWksDBParser.cxx:474
Database()
constructor
Definition: GreatWksDBParser.cxx:326
int m_headerHeight
the header height if known
Definition: GreatWksDBParser.cxx:403
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
virtual bool operator==(MWAWSubDocument const &doc) const
operator!==
Definition: GreatWksDBParser.cxx:421
std::string const & name() const
name of the entry
Definition: MWAWEntry.hxx:142
bool readFreeList(GreatWksDBParserInternal::Block &block)
try to read the free zone list: 0th big zone
Definition: GreatWksDBParser.cxx:988
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:56
@ F_Text
Definition: GreatWksDBParser.cxx:183
MWAWEntry m_headerBlockHeader
the header entry (in v2)
Definition: GreatWksDBParser.cxx:401
bool isEmpty() const
returns true if the cell do contain any content
Definition: GreatWksDBParser.cxx:165
a cell of a GreatWksDBParser
Definition: GreatWksDBParser.cxx:158
double m_value
the cell value
Definition: MWAWCell.hxx:434
long length() const
returns the length of the zone
Definition: MWAWEntry.hxx:82
@ DOC_HEADER_FOOTER
Definition: libmwaw_internal.hxx:178
Cell()
constructor
Definition: GreatWksDBParser.cxx:161
std::vector< float > convertInPoint(std::vector< int > const &list) const
convert the m_widthCols in a vector of of point size
Definition: GreatWksDBParser.cxx:353
int m_numPages
the number of page of the final document
Definition: GreatWksDBParser.cxx:399
Block & operator=(Block const &orig)
Internal: the subdocument of a GreatWksDBParser.
Definition: GreatWksDBParser.cxx:410
the database of a GreatWksDBParser
Definition: GreatWksDBParser.cxx:323
shared_ptr< GreatWksDocument > m_document
the document
Definition: GreatWksDBParser.hxx:164
small class use to define a sheet cell content
Definition: MWAWCell.hxx:356
Definition: libmwaw_internal.hxx:142
long begin() const
returns the begin offset
Definition: MWAWEntry.hxx:72
bool readBlock(GreatWksDBParserInternal::Block &block, int fieldSize)
try to read a unknown block, knowing the field size
Definition: GreatWksDBParser.cxx:1117
void setLength(long l)
sets the zone size
Definition: MWAWEntry.hxx:61
MWAWPageSpan const & getPageSpan() const
returns the actual page dimension
Definition: MWAWParser.hxx:160
virtual ~SubDocument()
destructor
Definition: GreatWksDBParser.cxx:416
bool readZone12(MWAWEntry const &zone)
try to read the small zone 12(unknown format, maybe some preferences)
Definition: GreatWksDBParser.cxx:2076
MWAWCellContent m_content
the cell content
Definition: GreatWksDBParser.cxx:171
Block(BlockHeader const &header, Zone &zone)
constructor given a zone
Definition: GreatWksDBParser.cxx:119
bool readBlockHeader(GreatWksDBParserInternal::BlockHeader &entry)
try to read a big block entry
Definition: GreatWksDBParser.cxx:867
SubDocument(GreatWksDBParser &pars, MWAWInputStreamPtr input, int zoneId)
Definition: GreatWksDBParser.cxx:412
shared_ptr< GreatWksDBParserInternal::Block > createBlock(GreatWksDBParserInternal::BlockHeader &entry)
try to create a block corresponding to an entry
Definition: GreatWksDBParser.cxx:875
friend std::ostream & operator<<(std::ostream &o, Field const &field)
operator<<
Definition: GreatWksDBParser.cxx:278
void setId(int newId)
sets the id
Definition: MWAWEntry.hxx:158
int m_incrementNumber
the increment number (in case of progression sequence)
Definition: GreatWksDBParser.cxx:224
int m_N
the number of sub data
Definition: GreatWksDBParser.cxx:110
@ F_Formula
Definition: GreatWksDBParser.cxx:183
bool readRowRecords(MWAWEntry const &zone)
try to read a list of records corresponding to a row
Definition: GreatWksDBParser.cxx:1181
@ C_FORMULA
Definition: MWAWCell.hxx:390
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
void setSpreadsheetListener(MWAWSpreadsheetListenerPtr &listener)
sets the spreadsheet listener
Definition: MWAWParser.cxx:135
@ F_Time
Definition: GreatWksDBParser.cxx:183
@ F_Cell
Definition: MWAWCell.hxx:360
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:503
shared_ptr< GreatWksDBParserInternal::State > m_state
the state
Definition: GreatWksDBParser.hxx:161
long m_ptr
the begin zone pointer
Definition: GreatWksDBParser.cxx:108
long end() const
returns the end offset
Definition: MWAWEntry.hxx:77
std::map< int, MWAWEntry > m_idZonesMap
a map id to zone used to stored the small zones
Definition: GreatWksDBParser.cxx:396
@ F_NUMBER
Definition: MWAWCell.hxx:56
@ F_TIME
Definition: MWAWCell.hxx:56
a small block of a GreatWksDBParserInternal::Block
Definition: GreatWksDBParser.cxx:102
the main class to read/store generic data of a GreatWorks document
Definition: GreatWksDocument.hxx:61
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
bool readBlockHeader2(GreatWksDBParserInternal::Block &block)
try to read the 2th big zone (maybe a list of pointers, but I only see a list of 0:recordId )
Definition: GreatWksDBParser.cxx:1085
bool addCell(MWAWVec2i const &pos, Cell const &cell)
add a cell data in one given position
Definition: GreatWksDBParser.cxx:331
bool readSmallZone(MWAWEntry const &zone)
try to read an unknown small zone, ie. a default reader: type, 0, size, N, dSz
Definition: GreatWksDBParser.cxx:2111
@ C_TEXT
Definition: MWAWCell.hxx:390
MWAWParser * m_parser
the main zone parser
Definition: MWAWSubDocument.hxx:75
bool readFields(MWAWEntry const &zone)
try to read the fields' zone
Definition: GreatWksDBParser.cxx:1524
MWAWVec2i m_position[2]
cell position ( if type==F_Cell or F_CellList )
Definition: MWAWCell.hxx:382
bool hasBorders() const
return true if the cell has some border
Definition: MWAWCell.hxx:272
bool readIntList(MWAWEntry const &zone, std::vector< int > &list)
try to read a int's zone
Definition: GreatWksDBParser.cxx:1933
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
void setStream(MWAWInputStreamPtr ip)
resets the input
Definition: MWAWDebug.hxx:73
void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface)
creates the listener which will be associated to the document
Definition: GreatWksDBParser.cxx:531
bool valid() const
returns true if the zone length is positive
Definition: MWAWEntry.hxx:88
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:513
void setHeaderFooter(MWAWHeaderFooter const &headerFooter)
add a header/footer on some page
Definition: MWAWPageSpan.cxx:223
virtual ~Cell()
destructor
Definition: GreatWksDBParser.cxx:176
Type
the file type
Definition: GreatWksDBParser.cxx:183
bool updateCell(int row, int numRow, Cell &cell) const
update the cell to correspond to the final data
Definition: GreatWksDBParser.cxx:230
Zone const & getZone(size_t i) const
returns the ith zone
Definition: GreatWksDBParser.cxx:138
MWAWVec2b m_positionRelative[2]
relative cell position ( if type==F_Cell or F_CellList )
Definition: MWAWCell.hxx:384
std::vector< int > m_widthCols
the column size in points
Definition: GreatWksDBParser.cxx:373
int getRowHeight(int row) const
returns the row size in point
Definition: GreatWksDBParser.cxx:346
bool empty() const
returns true if the cell has no content
Definition: MWAWCell.hxx:399
std::vector< MWAWEntry > m_rowList
the list of rows data
Definition: GreatWksDBParser.cxx:367
@ F_Unknown
Definition: GreatWksDBParser.cxx:183
GreatWksDBParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
constructor
Definition: GreatWksDBParser.cxx:468
@ F_Number
Definition: GreatWksDBParser.cxx:183
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:207
Field()
constructor
Definition: GreatWksDBParser.cxx:185
a structure used to define a cell and its format
Definition: MWAWCell.hxx:53
int m_firstNumber
the first number (in case of progression sequence)
Definition: GreatWksDBParser.cxx:222
Type m_contentType
the content type ( by default unknown )
Definition: MWAWCell.hxx:432
MWAWEntry m_pictEntry
picture
Definition: GreatWksDBParser.cxx:173
@ C_NUMBER
Definition: MWAWCell.hxx:390
std::string m_name
the field name
Definition: GreatWksDBParser.cxx:199
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface)
virtual function used to parse the input
Definition: GreatWksDBParser.cxx:502
MWAWVec2i const & position() const
position accessor
Definition: MWAWCell.hxx:158
std::ostream & operator<<(std::ostream &o, Field const &field)
Definition: GreatWksDBParser.cxx:278
MWAWVec2< bool > MWAWVec2b
MWAWVec2 of bool.
Definition: libmwaw_internal.hxx:779
@ F_Memo
Definition: GreatWksDBParser.cxx:183
std::vector< MWAWCellContent::FormulaInstruction > m_formula
the formula
Definition: GreatWksDBParser.cxx:210
Block(BlockHeader const &header)
constructor
Definition: GreatWksDBParser.cxx:115
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:781
std::map< int, std::vector< Cell > > m_rowCellsMap
the map row -> list of cells
Definition: GreatWksDBParser.cxx:379
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:505
Type m_type
the field type
Definition: GreatWksDBParser.cxx:195
Internal: the state of a GreatWksDBParser.
Definition: GreatWksDBParser.cxx:387
shared_ptr< MWAWInputStream > m_input
the input
Definition: MWAWSubDocument.hxx:77
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:96
BlockHeader m_recordBlock
the block file position which stores the position of the field's record
Definition: GreatWksDBParser.cxx:205
long m_dataSize
the data size
Definition: GreatWksDBParser.cxx:112
Database m_database
the database
Definition: GreatWksDBParser.cxx:394
@ F_TEXT
Definition: MWAWCell.hxx:56
int m_summaryType
the summary type: 1:average, 2:count, 3:total, 4:minimum, 5:maximum
Definition: GreatWksDBParser.cxx:213
Generated on Wed Jun 17 2020 06:30:09 for libmwaw by
doxygen 1.8.18