|
🛰️航天仿真算法库 SpaceAST 0.0.1
|
#include <XMLParser.hpp>
类 ast::XMLParser 继承关系图:Public 类型 | |
| enum | EToken { eError = -1 , eStartDocument , eEndDocument , eStartElement , eEndElement , eCharacters , eComment , eDocTypeDecl , eProcessingInstruction } |
Public 成员函数 | |
| XMLParser (StringView filepath) | |
| errc_t | parse (XMLSax &sax) |
| errc_t | parse (XMLNode &node) |
| EToken | getNext () |
| StringView | getName () const |
| StringView | getText () const |
| StringView | getComment () const |
| const XMLSax::AttributeList & | getAttributes () const |
Public 成员函数 继承自 ast::BaseParser | |
| BaseParser (StringView filepath) | |
| void | open (StringView filepath) |
| bool | isOpen () const |
| void | close () |
| void | seek (std::streamoff pos, std::ios::seekdir dir) |
| std::streamoff | tell () |
| bool | eof () const |
| size_t | read (void *buffer, size_t size, size_t pos) const |
| size_t | read (void *buffer, size_t size) const |
| StringView | getLineWithNewline () |
| StringView | getLine () |
| StringView | getLineTrim () |
| StringView | getLineSkipHashComment () |
| int | getLineNumber () |
| std::string | getFilePath () const |
| void | setBorrowedFile (FILE *file) |
| void | setOwnedFile (FILE *file) |
| FILE * | getFile () const |
Protected 成员函数 | |
| void | setName (StringView name) |
| void | setText (StringView text) |
| void | setComment (StringView comment) |
Protected 成员函数 继承自 ast::BaseParser | |
| std::vector< char > & | getLineBuffer () |
轻量级的SAX解析器
用于解析XML文档,支持流式解析,无需加载整个文档到内存
|
inline |
获取属性列表
|
inline |
获取注释
|
inline |
获取元素名称
| XMLParser::EToken ast::XMLParser::getNext | ( | ) |
获取下一个解析令牌
|
inline |
获取文本
| errc_t ast::XMLParser::parse | ( | XMLNode & | node | ) |
解析XML文档到节点
| node | 解析结果节点 |