MCPcopy Create free account
hub / github.com/ByConity/ByConity / getType

Method getType

base/common/JSON.cpp:176–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174
175
176JSON::ElementType JSON::getType() const
177{
178 switch (*ptr_begin)
179 {
180 case '{':
181 return TYPE_OBJECT;
182 case '[':
183 return TYPE_ARRAY;
184 case 't':
185 case 'f':
186 return TYPE_BOOL;
187 case 'n':
188 return TYPE_NULL;
189 case '-':
190 case '0':
191 case '1':
192 case '2':
193 case '3':
194 case '4':
195 case '5':
196 case '6':
197 case '7':
198 case '8':
199 case '9':
200 return TYPE_NUMBER;
201 case '"':
202 {
203 /// Проверим - это просто строка или name-value pair
204 Pos after_string = skipString();
205 if (after_string < ptr_end && *after_string == ':')
206 return TYPE_NAME_VALUE_PAIR;
207 else
208 return TYPE_STRING;
209 }
210 default:
211 throw JSONException(std::string("JSON: unexpected char ") + *ptr_begin + ", expected one of '{[tfn-0123456789\"'");
212 }
213}
214
215
216void JSON::checkPos(Pos pos) const

Callers 10

inFuncFunction · 0.45
arrayFuncFunction · 0.45
arithmeticFuncFunction · 0.45
simpleFuncFunction · 0.45
fuzzFieldMethod · 0.45
clearOldStoreDirectoryFunction · 0.45
mainMethod · 0.45
initHDFSMethod · 0.45
processTableMethod · 0.45
loadAndDumpPartMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected