MCPcopy Create free account
hub / github.com/crownengine/crown / parse_string

Function parse_string

src/core/json/json.cpp:180–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 }
179
180 void parse_string(DynamicString &str, const char *json)
181 {
182 CE_ENSURE(NULL != json);
183
184 if (*json == '"') {
185 while (*++json) {
186 if (*json == '"')
187 return;
188
189 if (*json == '\\') {
190 ++json;
191
192 switch (*json) {
193 case '"': str += '"'; break;
194 case '\\': str += '\\'; break;
195 case '/': str += '/'; break;
196 case 'b': str += '\b'; break;
197 case 'f': str += '\f'; break;
198 case 'n': str += '\n'; break;
199 case 'r': str += '\r'; break;
200 case 't': str += '\t'; break;
201 default: CE_FATAL("Bad escape character"); break;
202 }
203 } else {
204 str += *json;
205 }
206 }
207 }
208
209 CE_FATAL("Bad string");
210 }
211
212 void parse_array(JsonArray &arr, const char *json)
213 {

Callers 15

parse_objectFunction · 0.70
test_jsonFunction · 0.50
test_sjsonFunction · 0.50
parse_texturesFunction · 0.50
parse_uniformsFunction · 0.50
compileFunction · 0.50
parse_outputFunction · 0.50
compileFunction · 0.50
parse_shadersFunction · 0.50
parse_internalFunction · 0.50
writeFunction · 0.50
parse_internalFunction · 0.50

Calls

no outgoing calls

Tested by 2

test_jsonFunction · 0.40
test_sjsonFunction · 0.40