1#ifndef MSTL_CORE_FILE_JSON_JSON_PARSER_HPP__
2#define MSTL_CORE_FILE_JSON_JSON_PARSER_HPP__
4#include "json_value.hpp"
7class MSTL_API json_parser {
13 void skip_space() noexcept {
19 char current() const noexcept {
20 if (pos < length)
return json[pos];
24 bool eof() const noexcept {
return pos >= length; }
27 unique_ptr<json_string> parse_string();
28 unique_ptr<json_number> parse_number();
29 unique_ptr<json_value> parse_keyword();
30 unique_ptr<json_array> parse_array();
31 unique_ptr<json_object> parse_object();
32 unique_ptr<json_value> parse_value();
35 explicit json_parser(
string json_str) noexcept
36 : json(
_MSTL move(json_str)), length(json.size()) {}
38 unique_ptr<json_value> parse();
39 optional<unique_ptr<json_value>> try_parse();
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 bool is_space(const CharT c) noexcept
检查字符是否为空白字符
#define _MSTL
全局命名空间MSTL前缀
#define MSTL_END_NAMESPACE__
结束全局命名空间MSTL
#define MSTL_BEGIN_NAMESPACE__
开始全局命名空间MSTL
constexpr Iterator2 move(Iterator1 first, Iterator1 last, Iterator2 result)
移动范围元素