• Home
  • Raw
  • Download

Lines Matching refs:jsonStr

70 FlatJsonParser::FlatJsonParser(const std::string& jsonStr)  in FlatJsonParser()  argument
73 Parse(jsonStr); in FlatJsonParser()
76 void FlatJsonParser::Parse(const std::string& jsonStr) in Parse() argument
80 while (index_ < jsonStr.length()) { in Parse()
81 if (charFilter_[static_cast<uint8_t>(jsonStr[index_])] != STRING_FLAG) { in Parse()
85 std::string key = ParseKey(jsonStr); in Parse()
86 std::string val = ParseValue(jsonStr); in Parse()
93 std::string jsonStr = "{"; in Print() local
96 jsonStr += "\"" + kvList_[i].first + "\":" + kvList_[i].second + ","; in Print()
98 jsonStr += "\"" + kvList_.back().first + "\":" + kvList_.back().second; in Print()
100 jsonStr += "}"; in Print()
101 return jsonStr; in Print()
104 std::string FlatJsonParser::ParseKey(const std::string& jsonStr) in ParseKey() argument
108 while (index_ < jsonStr.length()) { in ParseKey()
109 if (charFilter_[static_cast<uint8_t>(jsonStr[index_])] == STRING_FLAG) { in ParseKey()
112 key.push_back(jsonStr[index_]); in ParseKey()
119 std::string FlatJsonParser::ParseValue(const std::string& jsonStr) in ParseValue() argument
123 while (index_ < jsonStr.length()) { in ParseValue()
124 int charCode = static_cast<uint8_t>(jsonStr[index_]); in ParseValue()
127 value = ParseBrackets(jsonStr, jsonStr[index_]); in ParseValue()
131 value = ParseNumer(jsonStr); in ParseValue()
135 value = ParseString(jsonStr); in ParseValue()
150 std::string FlatJsonParser::ParseNumer(const std::string& jsonStr) in ParseNumer() argument
153 while (index_ < jsonStr.length()) { in ParseNumer()
154 if (charFilter_[static_cast<uint8_t>(jsonStr[index_])] != NUMBER_FLAG) { in ParseNumer()
157 number.push_back(jsonStr[index_]); in ParseNumer()
163 std::string FlatJsonParser::ParseString(const std::string& jsonStr) in ParseString() argument
166 txt.push_back(jsonStr[index_++]); in ParseString()
167 while (index_ < jsonStr.length()) { in ParseString()
168 if (charFilter_[static_cast<uint8_t>(jsonStr[index_])] == STRING_FLAG && in ParseString()
169 jsonStr[index_ - 1] != '\\') { in ParseString()
172 txt.push_back(jsonStr[index_]); in ParseString()
175 txt.push_back(jsonStr[index_++]); in ParseString()
179 std::string FlatJsonParser::ParseBrackets(const std::string& jsonStr, char leftBracket) in ParseBrackets() argument
184 val.push_back(jsonStr[index_++]); in ParseBrackets()
185 while (index_ < jsonStr.length()) { in ParseBrackets()
186 if (jsonStr[index_] == leftBracket) { in ParseBrackets()
188 } else if (jsonStr[index_] == rightBracket) { in ParseBrackets()
194 val.push_back(jsonStr[index_++]); in ParseBrackets()
196 val.push_back(jsonStr[index_++]); in ParseBrackets()