XYWriteParserInternal::Format Struct Reference

a structure used to store a format More...

## Public Member Functions
| Format (bool inDosFile=false)
| constructor
bool | empty () const
| return true if the format is empty
std::string | title () const
| returns the title in uppercase
std::string | shortTitle (size_t sz=2) const
| returns the two/... first character of the main string in uppercase
bool | updateFont (WPSFont &font) const
| update a font if possible
bool | updateParagraph (WPSParagraph &para) const
| update a paragraph if possible
bool | readColor (WPSColor &color) const
| try to read a color

## Static Public Member Functions
static std::string | upperCase (std::string const &str)
| returns the upper case of a string
static bool | readBox2f (std::string const &str, size_t i, bool inDosFile, WPSBox2f &box, std::string &extra)
| try to read a box of double in points
static bool | readVec2f (std::string const &str, size_t i, bool inDosFile, Vec2f &vec, std::string &extra)
| try to read a vector of double in points
static bool | readVec2i (std::string const &str, size_t i, Vec2i &vec, std::string &extra)
| try to read a vector of uint
static bool | readUInt (std::string const &str, size_t &i, unsigned int &value, std::string &extra)
| try to read a int
static bool | readNumber (std::string const &str, size_t &i, double &value)
| try to read a double.
static bool | readUnit (std::string const &str, size_t i, bool inDosFile, double &value, bool &inPoint, std::string &extra, bool dosInChar=true)
| try to read an unit, returns a number in Point or in Line.

## Public Attributes
bool | m_inDosFile
| flag to know if we are in a dos file
std::string | m_string
| the main part
std::vector< std::string > | m_args
| the other arguments
WPSEntry | m_entry
| a text zone entry
bool | m_isComplex
| a flag to know if this is a complex entry
int | m_listCounter
| the list counter (if known)
WPSList::Level | m_level
| the list level (if known)
std::vector< Format > | m_children
| the list of child (for style, ...)

## Friends
std::ostream & | operator<< (std::ostream &o, Format const &format)
| operator<<

## Detailed Description

a structure used to store a format

## Constructor & Destructor Documentation

## ◆ Format()

XYWriteParserInternal::Format::Format | ( | bool | inDosFile = false | ) |
| inline explicit

constructor

Referenced by operator<<.

## Member Function Documentation

## ◆ empty()

bool XYWriteParserInternal::Format::empty | ( |  | ) | const
| inline

return true if the format is empty

## ◆ readBox2f()

bool XYWriteParserInternal::Format::readBox2f | ( | std::string const & | str,
|  | size_t | i,
|  | bool | inDosFile,
|  | WPSBox2f & | box,
|  | std::string & | extra )
| inline static

try to read a box of double in points

## ◆ readColor()

bool XYWriteParserInternal::Format::readColor | ( | WPSColor & | color | ) | const
| inline

try to read a color

Referenced by updateFont(), and updateParagraph().

## ◆ readNumber()

bool XYWriteParserInternal::Format::readNumber | ( | std::string const & | str,
|  | size_t & | i,
|  | double & | value )
| inline static

try to read a double.

Referenced by readUnit(), and updateParagraph().

## ◆ readUInt()

bool XYWriteParserInternal::Format::readUInt | ( | std::string const & | str,
|  | size_t & | i,
|  | unsigned int & | value,
|  | std::string & | extra )
| inline static

try to read a int

Referenced by XYWriteParser::createTable(), XYWriteParser::parseTextZone(), readColor(), readVec2i(), and XYWriteParser::update().

## ◆ readUnit()

bool XYWriteParserInternal::Format::readUnit | ( | std::string const & | str,
|  | size_t | i,
|  | bool | inDosFile,
|  | double & | value,
|  | bool & | inPoint,
|  | std::string & | extra,
|  | bool | dosInChar = true )
| inline static

try to read an unit, returns a number in Point or in Line.

Note
  if unit=AUTO set value to 72pt=1in

Referenced by XYWriteParser::createListener(), XYWriteParser::createTable(), readVec2f(), XYWriteParser::update(), updateFont(), and updateParagraph().

## ◆ readVec2f()

bool XYWriteParserInternal::Format::readVec2f | ( | std::string const & | str,
|  | size_t | i,
|  | bool | inDosFile,
|  | Vec2f & | vec,
|  | std::string & | extra )
| inline static

try to read a vector of double in points

Referenced by readBox2f().

## ◆ readVec2i()

bool XYWriteParserInternal::Format::readVec2i | ( | std::string const & | str,
|  | size_t | i,
|  | Vec2i & | vec,
|  | std::string & | extra )
| inline static

try to read a vector of uint

## ◆ shortTitle()

std::string XYWriteParserInternal::Format::shortTitle | ( | size_t | sz = 2 | ) | const
| inline

returns the two/... first character of the main string in uppercase

Referenced by XYWriteParser::createListener(), XYWriteParser::createTable(), XYWriteParser::parseTextZone(), XYWriteParser::update(), updateFont(), and updateParagraph().

## ◆ title()

std::string XYWriteParserInternal::Format::title | ( |  | ) | const
| inline

returns the title in uppercase

Referenced by XYWriteParser::createListener(), XYWriteParser::createTable(), XYWriteParser::parseMetaData(), XYWriteParser::parseTextZone(), XYWriteParser::update(), updateFont(), and updateParagraph().

## ◆ updateFont()

bool XYWriteParserInternal::Format::updateFont | ( | WPSFont & | font | ) | const
| inline

update a font if possible

Referenced by XYWriteParser::update().

## ◆ updateParagraph()

bool XYWriteParserInternal::Format::updateParagraph | ( | WPSParagraph & | para | ) | const
| inline

update a paragraph if possible

Referenced by XYWriteParser::update().

## ◆ upperCase()

std::string XYWriteParserInternal::Format::upperCase | ( | std::string const & | str | ) |
| inline static

returns the upper case of a string

Referenced by readUnit(), shortTitle(), title(), and updateParagraph().

## Friends And Related Symbol Documentation

## ◆ operator<<

std::ostream & operator<< | ( | std::ostream & | o,
|  | Format const & | format )
| friend

operator<<

## Member Data Documentation

## ◆ m_args

std::vector<std::string> XYWriteParserInternal::Format::m_args

the other arguments

Referenced by XYWriteParser::createListener(), XYWriteParser::createTable(), empty(), Format(), operator<<, XYWriteParser::parseFormat(), readColor(), and updateParagraph().

## ◆ m_children

std::vector<Format> XYWriteParserInternal::Format::m_children

the list of child (for style, ...)

Referenced by XYWriteParser::createFormatChildren(), Format(), operator<<, XYWriteParser::parseFrameZone(), and XYWriteParser::parsePictureZone().

## ◆ m_entry

WPSEntry XYWriteParserInternal::Format::m_entry

a text zone entry

Referenced by XYWriteParser::createFormatChildren(), XYWriteParser::createListener(), Format(), operator<<, XYWriteParser::parseFormat(), XYWriteParser::parseFrameZone(), XYWriteParser::parsePictureZone(), XYWriteParser::parseTextZone(), and XYWriteParser::update().

## ◆ m_inDosFile

bool XYWriteParserInternal::Format::m_inDosFile

flag to know if we are in a dos file

Referenced by Format(), updateFont(), and updateParagraph().

## ◆ m_isComplex

bool XYWriteParserInternal::Format::m_isComplex

a flag to know if this is a complex entry

Referenced by Format(), operator<<, and XYWriteParser::parseFormat().

## ◆ m_level

WPSList::Level XYWriteParserInternal::Format::m_level
| mutable

the list level (if known)

Referenced by Format(), and XYWriteParser::update().

## ◆ m_listCounter

int XYWriteParserInternal::Format::m_listCounter
| mutable

the list counter (if known)

Referenced by Format(), and XYWriteParser::update().

## ◆ m_string

std::string XYWriteParserInternal::Format::m_string

the main part

Referenced by XYWriteParser::createListener(), XYWriteParser::createTable(), empty(), Format(), operator<<, XYWriteParser::parseFormat(), XYWriteParser::parseTextZone(), readColor(), shortTitle(), title(), XYWriteParser::update(), updateFont(), and updateParagraph().

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

- XYWrite.cpp