NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
json_parser.hpp
浏览该文件的文档.
1#ifndef NEFORCE_CORE_FILE_JSON_JSON_PARSER_HPP__
2#define NEFORCE_CORE_FILE_JSON_JSON_PARSER_HPP__
3
11
14NEFORCE_BEGIN_NAMESPACE__
15
20
25
41class NEFORCE_API json_parser {
42private:
43 string text_;
44 size_t len_;
45 size_t pos_ = 0;
46
52 void skip_space() noexcept;
53
58 char current() const noexcept;
59
64 bool eof() const noexcept;
65
73 unique_ptr<json_string> parse_string();
74
85 unique_ptr<json_number> parse_number();
86
97 unique_ptr<json_value> parse_keyword();
98
108 unique_ptr<json_array> parse_array();
109
119 unique_ptr<json_object> parse_object();
120
133 unique_ptr<json_value> parse_value();
134
135public:
142 explicit json_parser(string text) noexcept :
143 text_(_NEFORCE move(text)),
144 len_(text_.size()) {}
145
155
164};
165 // JsonConfig
167 // ConfigFormat
169
170NEFORCE_END_NAMESPACE__
171#endif // NEFORCE_CORE_FILE_JSON_JSON_PARSER_HPP__
optional< unique_ptr< json_value > > try_parse()
尝试执行解析
json_parser(string text) noexcept
构造函数
unique_ptr< json_value > parse()
执行解析
可选值类
独占智能指针
constexpr Iterator2 move(Iterator1 first, Iterator1 last, Iterator2 result) noexcept(noexcept(inner::__move_aux(first, last, result)))
移动范围元素
JSON配置格式变量
可选值类型