5
5
6
6
#include < vector>
7
7
8
- namespace fly {
8
+ namespace fly ::parser {
9
9
10
10
#define ILOG (...) \
11
11
LOGW (" [line {}]: " FLY_FORMAT_STRING(__VA_ARGS__), line() FLY_FORMAT_ARGS(__VA_ARGS__));
12
12
13
13
// ==================================================================================================
14
- std::optional<Json> IniParser::parse_internal ()
14
+ std::optional<fly:: Json> IniParser::parse_internal ()
15
15
{
16
- Json values = JsonTraits::object_type ();
17
- Json::iterator current;
16
+ fly:: Json values = JsonTraits::object_type ();
17
+ fly:: Json::iterator current;
18
18
19
19
std::string data;
20
20
21
21
while (getline (data))
22
22
{
23
- String::trim (data);
23
+ fly:: String::trim (data);
24
24
25
25
if (data.empty () || data.starts_with (' ;' ))
26
26
{
@@ -84,7 +84,7 @@ std::optional<Json> IniParser::parse_internal()
84
84
}
85
85
}
86
86
87
- return values.empty () ? std::nullopt : std::optional<Json>(std::move (values));
87
+ return values.empty () ? std::nullopt : std::optional<fly:: Json>(std::move (values));
88
88
}
89
89
90
90
// ==================================================================================================
@@ -106,7 +106,7 @@ bool IniParser::getline(std::string &result)
106
106
// ==================================================================================================
107
107
std::optional<std::string> IniParser::on_section (std::string §ion)
108
108
{
109
- String::trim (section);
109
+ fly:: String::trim (section);
110
110
111
111
if ((trim_value (section, ' \' ' ) != TrimResult::Untrimmed) ||
112
112
(trim_value (section, ' \" ' ) != TrimResult::Untrimmed))
@@ -124,14 +124,14 @@ IniParser::on_name_value_pair(const std::string &name_value)
124
124
{
125
125
static constexpr std::uint32_t s_size = 2 ;
126
126
127
- std::vector<std::string> pair = String::split (name_value, ' =' , s_size);
127
+ std::vector<std::string> pair = fly:: String::split (name_value, ' =' , s_size);
128
128
129
129
if (pair.size () == s_size)
130
130
{
131
131
std::string name (std::move (pair[0 ])), value (std::move (pair[1 ]));
132
132
133
- String::trim (name);
134
- String::trim (value);
133
+ fly:: String::trim (name);
134
+ fly:: String::trim (value);
135
135
136
136
if ((trim_value (name, ' \' ' ) != TrimResult::Untrimmed) ||
137
137
(trim_value (name, ' \" ' ) != TrimResult::Untrimmed))
@@ -181,4 +181,4 @@ IniParser::TrimResult IniParser::trim_value(std::string &str, char start, char e
181
181
return TrimResult::Untrimmed;
182
182
}
183
183
184
- } // namespace fly
184
+ } // namespace fly::parser
0 commit comments