1
2
3
4
5
6 #include <cpp2cm/cpp2cm/Args.hpp>
7 #include <cpp2cm/cpp2cm/ArgsParser.hpp>
8 #include <soulng/lexer/TrivialLexer.hpp>
9
10 std::std::vector<int>ParseArgs(conststd::u32string&args)
11 {
12 std::vector<int> argsVec;
13 TrivialLexer lexer(args, "", 0);
14 ArgsParser::Parse(lexer, &argsVec);
15 return argsVec;
16 }
17
18 int ParseInt(const std::u32string& s)
19 {
20 int x = 0;
21 for (char32_t c : s)
22 {
23 if (c >= '0' && c <= '9')
24 {
25 x = 10 * x + c - '0';
26 }
27 }
28 return x;
29 }