NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
env_parser.hpp
浏览该文件的文档.
1#ifndef NEFORCE_CORE_FILE_ENV_ENV_PARSER_HPP__
2#define NEFORCE_CORE_FILE_ENV_ENV_PARSER_HPP__
3
12
15NEFORCE_BEGIN_NAMESPACE__
16
22
28
43class NEFORCE_API env_parser {
44private:
45 string text_;
46 size_t len_;
47 size_t pos_ = 0;
48 size_t line_ = 1;
49 size_t column_ = 1;
50
52
58 void skip_whitespace() noexcept;
59
65 void skip_line() noexcept;
66
71 char current() const noexcept;
72
78 char peek(size_t offset = 1) const noexcept;
79
84 bool eof() const noexcept;
85
91 void advance() noexcept;
92
98 bool is_comment_line(const string& line) const;
99
105 bool is_blank_line(const string& line) const;
106
116 bool parse_variable_line(const string& line, string& name, unique_ptr<env_variable>& variable) const;
117
126 string parse_unquoted_value(const string& line, size_t& pos) const;
127
136 string parse_single_quoted_value(const string& line, size_t& pos) const;
137
146 string parse_double_quoted_value(const string& line, size_t& pos) const;
147
154 void parse_line(const string& line) const;
155
156public:
163 explicit env_parser(string text) noexcept :
164 text_(_NEFORCE move(text)),
165 len_(text_.size()) {
167 }
168
178
187};
188 // EnvConfig
190 // ConfigFormat
192
193NEFORCE_END_NAMESPACE__
194#endif // NEFORCE_CORE_FILE_ENV_ENV_PARSER_HPP__
optional< unique_ptr< env_document > > try_parse()
尝试执行解析
unique_ptr< env_document > parse()
执行解析
env_parser(string text) noexcept
构造函数
可选值类
独占智能指针
env配置格式变量
constexpr void advance(Iterator &i, Distance n)
将迭代器前进指定距离
constexpr Iterator2 move(Iterator1 first, Iterator1 last, Iterator2 result) noexcept(noexcept(inner::__move_aux(first, last, result)))
移动范围元素
NEFORCE_ALWAYS_INLINE_INLINE bool name(char *buffer, size_t size)
获取当前线程名称
NEFORCE_CONSTEXPR20 unique_ptr< T > make_unique(Args &&... args)
创建unique_ptr
可选值类型