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< Formatm_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)
inlineexplicit

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 )
inlinestatic

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 )
inlinestatic

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 )
inlinestatic

◆ readUnit()

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

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 )
inlinestatic

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 )
inlinestatic

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

◆ 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)
inlinestatic

returns the upper case of a string

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

◆ 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

◆ m_children

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

◆ m_entry

◆ 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


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

Generated on Sat Jul 19 2025 05:24:41 for libwps by doxygen 1.14.0