You.i Engine
YiYouIMarkupParser.h
Go to the documentation of this file.
1 // © You i Labs Inc. All rights reserved.
2 #ifndef _YI_YOUI_MARKUP_PARSER_H_
3 #define _YI_YOUI_MARKUP_PARSER_H_
4 
6 
69 {
70 public:
77  virtual bool ParseMarkup(const CYIString &rMarkupText, const CYITextSceneNode::YI_TEXT_STYLE_DEF &rDefaultStyle, const CYICustomMarkupTagsProvider *pExternalTagsProvider, bool logErrors, CYIString *pParsedText, std::vector<CYITextSceneNode::YI_TEXT_STYLE_DEF> *pStyles) const override;
78 
84  static bool HasMarkup(const CYIString &rText);
85 
95  static bool GetNextTagContent(const CYIString &input, const CYIString::ConstIterator &startPosition, CYIString *pTagContent, CYIString::ConstIterator *pTagStartPosition, CYIString::ConstIterator *pNextPosition, bool logErrors, bool *pErrorEncountered);
96 
97 private:
101  struct MARKUP_STYLE
102  {
103  MARKUP_STYLE(const CYITextSceneNode::YI_TEXT_STYLE_DEF &rStyle);
104 
106  CYIString fontFamily;
107  CYIString fontStyle;
108  };
109 
113  static void UpdateOrAddStyle(std::vector<CYIYouIMarkupParser::MARKUP_STYLE> *pStyles, const MARKUP_STYLE &rStyle, size_t lastCodepointIndex, bool updateExisting);
114 
130  static bool CreateStyle(const CYIString &rTagContent, const CYICustomMarkupTagsProvider *pExternalTagsProvider, MARKUP_STYLE *pNewStyle, CYIString *pNewText, bool logErrors, bool *pFinishTag, bool *pAddTag);
131 
143  static bool ResolveFont(MARKUP_STYLE *pStyle, bool logErrors);
144 };
145 
150 #endif // _YI_YOUI_MARKUP_PARSER_H_
static bool HasMarkup(const CYIString &rText)
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:32
static bool GetNextTagContent(const CYIString &input, const CYIString::ConstIterator &startPosition, CYIString *pTagContent, CYIString::ConstIterator *pTagStartPosition, CYIString::ConstIterator *pNextPosition, bool logErrors, bool *pErrorEncountered)
virtual bool ParseMarkup(const CYIString &rMarkupText, const CYITextSceneNode::YI_TEXT_STYLE_DEF &rDefaultStyle, const CYICustomMarkupTagsProvider *pExternalTagsProvider, bool logErrors, CYIString *pParsedText, std::vector< CYITextSceneNode::YI_TEXT_STYLE_DEF > *pStyles) const override
Definition: YiYouIMarkupParser.h:68
Definition: YiTextMarkupParser.h:15
Definition: YiString.h:46
Definition: YiTextSceneNode.h:89
Definition: YiCustomMarkupTagsProvider.h:15