WPS8Struct::FileData Struct Reference

A recursif structure which seems generally used to store complex memory structures in a file. More...

#include <WPS8Struct.h>

Public Member Functions

 FileData ()
 constructor
 
bool isBad () const
 returns true if the field was not read
 
bool hasStr () const
 returns true if it is a string data
 
bool isNumber () const
 returns true if it is a number data
 
WPSColor getRGBColor () const
 returns a rgb color by converting the integer value field
 
bool getBorderStyles (WPSBorder::Style &style, WPSBorder::Type &type, std::string &mess) const
 returns the border, type style using the integer value field
 
bool isBool () const
 returns true if it is a bool data
 
bool isTrue () const
 returns true if this is a bool and the val is true
 
bool isFalse () const
 returns true if this is a bool and the val is false
 
bool isArray () const
 returns true if this is a list of block or an unstructured list
 
bool isRead () const
 returns true if the data are read
 
int type () const
 returns the data type (low level)
 
int id () const
 returns the identificator
 
bool readArrayBlock () const
 forces reading the data as a list of block
 
long begin () const
 beginning of data position
 
long end () const
 end of data position
 

Public Attributes

long m_value
 an int value, filled if the data store an val
 
std::string m_text
 the string values
 
std::vector< FileDatam_recursData
 the list of children
 

Static Protected Member Functions

static std::string createErrorString (RVNGInputStreamPtr input, long endPos)
 creates a string used to store the unparsed data
 

Protected Attributes

int m_type
 an int which indicates the data type
 
int m_id
 an identificator
 
long m_beginOffset
 the initial position of the data of this field
 
long m_endOffset
 the final position of the data of this field
 
RVNGInputStreamPtr m_input
 the input
 

Friends

std::ostream & operator<< (std::ostream &o, FileData const &dt)
 operator<<
 
bool readData (RVNGInputStreamPtr input, long endPos, FileData &dt, std::string &error)
 function which parses an element
 
bool readBlockData (RVNGInputStreamPtr input, long endPos, FileData &dt, std::string &error)
 function which parses a set of elements
 

Detailed Description

A recursif structure which seems generally used to store complex memory structures in a file.

Each element seems to contains

  • the encoded type of the field (bool, int, strings, lists, entry ...)
  • an identificator of the field
  • the field values
Note
  • the distinction between a lists of recursif Data and a list of << local >> structures is not clear. This implies that when the field is a list, readBlockData must be called in order to try reading the data recursively
  • the case typeId = 0x2a seems to correspond to an entry id (4 letters + id), it is the only special case ?
  • the difference between signed and unsigned field must be checked.

Constructor & Destructor Documentation

◆ FileData()

WPS8Struct::FileData::FileData ( )
inline

constructor

Member Function Documentation

◆ begin()

long WPS8Struct::FileData::begin ( ) const
inline

beginning of data position

◆ createErrorString()

std::string WPS8Struct::FileData::createErrorString ( RVNGInputStreamPtr input,
long endPos )
staticprotected

creates a string used to store the unparsed data

◆ end()

long WPS8Struct::FileData::end ( ) const
inline

end of data position

◆ getBorderStyles()

bool WPS8Struct::FileData::getBorderStyles ( WPSBorder::Style & style,
WPSBorder::Type & type,
std::string & mess ) const

returns the border, type style using the integer value field

◆ getRGBColor()

WPSColor WPS8Struct::FileData::getRGBColor ( ) const
inline

returns a rgb color by converting the integer value field

◆ hasStr()

bool WPS8Struct::FileData::hasStr ( ) const
inline

returns true if it is a string data

Referenced by isArray(), isBool(), and isNumber().

◆ id()

int WPS8Struct::FileData::id ( ) const
inline

◆ isArray()

bool WPS8Struct::FileData::isArray ( ) const
inline

returns true if this is a list of block or an unstructured list

Referenced by readArrayBlock(), and WPS8TextStyle::readParagraph().

◆ isBad()

bool WPS8Struct::FileData::isBad ( ) const
inline

returns true if the field was not read

◆ isBool()

bool WPS8Struct::FileData::isBool ( ) const
inline

returns true if it is a bool data

◆ isFalse()

bool WPS8Struct::FileData::isFalse ( ) const
inline

returns true if this is a bool and the val is false

◆ isNumber()

bool WPS8Struct::FileData::isNumber ( ) const
inline

returns true if it is a number data

◆ isRead()

bool WPS8Struct::FileData::isRead ( ) const
inline

◆ isTrue()

bool WPS8Struct::FileData::isTrue ( ) const
inline

returns true if this is a bool and the val is true

◆ readArrayBlock()

bool WPS8Struct::FileData::readArrayBlock ( ) const

forces reading the data as a list of block

Referenced by WPS8Text::defDataParser(), WPS8TextStyle::readParagraph(), and WPS8Text::textZonesDataParser().

◆ type()

int WPS8Struct::FileData::type ( ) const
inline

returns the data type (low level)

Referenced by WPS8Text::textZonesDataParser(), and WPS8Text::tokenEndDataParser().

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & o,
FileData const & dt )
friend

operator<<

◆ readBlockData

bool readBlockData ( RVNGInputStreamPtr input,
long endPos,
FileData & dt,
std::string & error )
friend

function which parses a set of elements

Referenced by readArrayBlock().

◆ readData

bool readData ( RVNGInputStreamPtr input,
long endPos,
FileData & dt,
std::string & error )
friend

function which parses an element

Member Data Documentation

◆ m_beginOffset

long WPS8Struct::FileData::m_beginOffset
protected

the initial position of the data of this field

Referenced by begin(), isRead(), and readArrayBlock().

◆ m_endOffset

long WPS8Struct::FileData::m_endOffset
protected

the final position of the data of this field

Referenced by end(), isRead(), and readArrayBlock().

◆ m_id

int WPS8Struct::FileData::m_id
protected

an identificator

Referenced by id().

◆ m_input

RVNGInputStreamPtr WPS8Struct::FileData::m_input
protected

the input

Referenced by isRead(), and readArrayBlock().

◆ m_recursData

◆ m_text

std::string WPS8Struct::FileData::m_text

the string values

Referenced by hasStr().

◆ m_type

int WPS8Struct::FileData::m_type
protected

an int which indicates the data type

Referenced by isArray(), isBad(), isBool(), isFalse(), isNumber(), isRead(), isTrue(), and type().

◆ m_value

long WPS8Struct::FileData::m_value

an int value, filled if the data store an val

Referenced by getBorderStyles(), getRGBColor(), WPS8TextStyle::readFont(), and WPS8TextStyle::readParagraph().


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

Generated on Thu Jul 18 2024 00:00:00 for libwps by doxygen 1.12.0