Tidy up some xml structures.
This commit is contained in:
parent
875cdc84ff
commit
8771b721d1
31 changed files with 885 additions and 563 deletions
|
@ -6,97 +6,95 @@
|
|||
class XmlParser
|
||||
{
|
||||
public:
|
||||
enum class DocumentState
|
||||
{
|
||||
Await_Prolog,
|
||||
Build_Prolog,
|
||||
Await_Element,
|
||||
Build_Element,
|
||||
Close_Element
|
||||
};
|
||||
enum class DocumentState
|
||||
{
|
||||
Await_Prolog,
|
||||
Build_Prolog,
|
||||
Await_Element,
|
||||
Build_Element,
|
||||
Close_Element
|
||||
};
|
||||
|
||||
enum class LineState
|
||||
{
|
||||
Await_Tag_Open,
|
||||
Await_Tag_Follower,
|
||||
Await_Tag_Name,
|
||||
Await_Tag_Name_End,
|
||||
Await_Attribute_Name,
|
||||
Await_Attribute_Name_End,
|
||||
Await_Attribute_Value,
|
||||
Await_Attribute_Value_End,
|
||||
Await_Text_End
|
||||
};
|
||||
enum class LineState
|
||||
{
|
||||
Await_Tag_Open,
|
||||
Await_Tag_Follower,
|
||||
Await_Tag_Name,
|
||||
Await_Tag_Name_End,
|
||||
Await_Attribute_Name,
|
||||
Await_Attribute_Name_End,
|
||||
Await_Attribute_Value,
|
||||
Await_Attribute_Value_End,
|
||||
Await_Text_End
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
DocumentState mDocumentState;
|
||||
LineState mLineState;
|
||||
XmlDocumentPtr mDocument;
|
||||
XmlPrologPtr mWorkingProlog;
|
||||
XmlElementPtr mParentElement;
|
||||
XmlElementPtr mWorkingElement;
|
||||
XmlAttributePtr mWorkingAttribute;
|
||||
std::string mWorkingAttributeName;
|
||||
std::string mWorkingTagName;
|
||||
std::string mWorkingAttributeValue;
|
||||
std::string mWorkingText;
|
||||
DocumentState mDocumentState;
|
||||
LineState mLineState;
|
||||
XmlDocumentPtr mDocument;
|
||||
XmlElement* mParentElement;
|
||||
XmlElement* mWorkingElement;
|
||||
std::string mWorkingAttributeName;
|
||||
std::string mWorkingTagName;
|
||||
std::string mWorkingAttributeValue;
|
||||
std::string mWorkingText;
|
||||
|
||||
public:
|
||||
|
||||
XmlParser();
|
||||
XmlParser();
|
||||
|
||||
void ProcessLine(const std::string& input);
|
||||
void ProcessLine(const std::string& input);
|
||||
|
||||
XmlDocumentPtr GetDocument() const;
|
||||
XmlDocumentPtr GetDocument() const;
|
||||
|
||||
private:
|
||||
|
||||
void OnLeftBracket();
|
||||
void OnLeftBracket();
|
||||
|
||||
void OnRightBracket();
|
||||
void OnRightBracket();
|
||||
|
||||
void OnQuestionMark();
|
||||
void OnQuestionMark();
|
||||
|
||||
void OnForwardSlash();
|
||||
void OnForwardSlash();
|
||||
|
||||
void OnChar(char c);
|
||||
void OnChar(char c);
|
||||
|
||||
void OnSpace(char c);
|
||||
void OnSpace(char c);
|
||||
|
||||
void OnAlphaNumeric(char c);
|
||||
void OnAlphaNumeric(char c);
|
||||
|
||||
void OnNonAlphaNumeric(char c);
|
||||
void OnNonAlphaNumeric(char c);
|
||||
|
||||
void OnEquals();
|
||||
void OnEquals();
|
||||
|
||||
void OnDoubleQuote();
|
||||
void OnDoubleQuote();
|
||||
|
||||
void OnTagOpen();
|
||||
void OnTagOpen();
|
||||
|
||||
void OnTagNameStart(char c);
|
||||
void OnTagNameStart(char c);
|
||||
|
||||
void OnTagNameEnd();
|
||||
void OnTagNameEnd();
|
||||
|
||||
void OnTagClose();
|
||||
void OnTagClose();
|
||||
|
||||
void OnTextStart(char c);
|
||||
void OnTextStart(char c);
|
||||
|
||||
void OnTextEnd();
|
||||
void OnTextEnd();
|
||||
|
||||
void OnAttributeNameStart(char c);
|
||||
void OnAttributeNameStart(char c);
|
||||
|
||||
void OnAttributeNameEnd();
|
||||
void OnAttributeNameEnd();
|
||||
|
||||
void OnAttributeValueStart();
|
||||
void OnAttributeValueStart();
|
||||
|
||||
void OnAttributeValueEnd();
|
||||
void OnAttributeValueEnd();
|
||||
|
||||
void OnPrologId();
|
||||
void OnPrologId();
|
||||
|
||||
void OnStartProlog();
|
||||
void OnStartProlog();
|
||||
|
||||
void onFinishProlog();
|
||||
void onFinishProlog();
|
||||
|
||||
void onElementTagEnd();
|
||||
void onElementTagEnd();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue