|
stmm-games-doc
0.32.0
|
Public Member Functions | |
| XmlBasicParser (XmlConditionalParser &oXmlConditionalParser) | |
| NRect | parseNRect (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, const std::string &sAttrNameX, const std::string &sAttrNameY, const std::string &sAttrNameW, const std::string &sAttrNameH, bool bMandatory, const NRect &oInRect, NSize oMinSize) |
| Parse integer rectangle. More... | |
Protected Attributes | |
| XmlConditionalParser & | m_oXmlConditionalParser |
| stmg::XmlBasicParser::XmlBasicParser | ( | XmlConditionalParser & | oXmlConditionalParser | ) |
| NRect stmg::XmlBasicParser::parseNRect | ( | ConditionalCtx & | oCtx, |
| const xmlpp::Element * | p0Element, | ||
| const std::string & | sAttrNameX, | ||
| const std::string & | sAttrNameY, | ||
| const std::string & | sAttrNameW, | ||
| const std::string & | sAttrNameH, | ||
| bool | bMandatory, | ||
| const NRect & | oInRect, | ||
| NSize | oMinSize | ||
| ) |
Parse integer rectangle.
If oInRect has non zero size and all the attributes are not defined and bMandatory is false a zero sized rectangle is returned. Otherwise, if oInRect has non zero size and any of the attributes is not defined it is inferred from the oInRect in that the resulting rectangle is extended as much as possible within it. If oInRect has zero size and bMandatory is true then all attributes must be defined. If oInRect has zero size and bMandatory is false then all attributes must be not defined.
Ex. oInRect={0,0,5,4}, sAttrNameX value is 2. Result is {2,0,3,4}
Ex. oInRect={10,20,5,4}, sAttrNameH value is 2. Result is {10,20,2,4}
Ex. oInRect={10,20,5,4}, bMandatory is false, no attribute defined. Result is {?,?,0,0}
Ex. oInRect={10,20,5,4}, bMandatory is true, no attribute defined. Result is {10,20,5,4}
Ex. oInRect={?,?,0,0}, bMandatory is false, no attribute defined. Result is {?,?,0,0}
Ex. oInRect={?,?,0,0}, bMandatory is true, sAttrNameH value is 2. throws an error
| oCtx | The context. |
| p0Element | The element. Cannot be null. |
| sAttrNameX | The x attribute name. |
| sAttrNameY | The y attribute name. |
| sAttrNameW | The w attribute name. |
| sAttrNameH | The h attribute name. |
| bMandatory | WhetherIt must be defined |
| oInRect | The rectangle the parsed rectangle must fit in. If its size is 0 no limits. |
| oMinSize | The minimum size of the parsed rectangle. Must be positive. |
|
protected |
1.8.13