Small html cleanup
This commit is contained in:
parent
c102ebb6da
commit
31b479e9f6
27 changed files with 330 additions and 252 deletions
|
@ -2,7 +2,12 @@
|
|||
|
||||
#include <string>
|
||||
#include <stack>
|
||||
#include "XmlDocument.h"
|
||||
#include <memory>
|
||||
|
||||
class XmlDocument;
|
||||
using XmlDocumentPtr = std::unique_ptr<XmlDocument>;
|
||||
|
||||
class XmlElement;
|
||||
|
||||
class XmlParser
|
||||
{
|
||||
|
@ -29,72 +34,70 @@ public:
|
|||
Await_Text_End
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
DocumentState mDocumentState;
|
||||
LineState mLineState;
|
||||
XmlDocumentPtr mDocument;
|
||||
std::stack<XmlElement*> mWorkingElements;
|
||||
std::string mWorkingAttributeName;
|
||||
std::string mWorkingTagName;
|
||||
std::string mWorkingAttributeValue;
|
||||
std::string mWorkingText;
|
||||
|
||||
public:
|
||||
|
||||
XmlParser();
|
||||
|
||||
void ProcessLine(const std::string& input);
|
||||
void processLine(const std::string& input);
|
||||
|
||||
XmlDocumentPtr GetDocument() const;
|
||||
XmlDocumentPtr getDocument();
|
||||
|
||||
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 onElementTagEnd();
|
||||
|
||||
private:
|
||||
DocumentState mDocumentState;
|
||||
LineState mLineState;
|
||||
XmlDocumentPtr mDocument;
|
||||
std::stack<XmlElement*> mWorkingElements;
|
||||
|
||||
std::string mWorkingAttributeName;
|
||||
std::string mWorkingTagName;
|
||||
std::string mWorkingAttributeValue;
|
||||
std::string mWorkingText;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue