MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / esc

Function esc

src/io/json11.cpp:329–337  ·  view source on GitHub ↗

esc(c) * * Format char c suitable for printing in an error message. */

Source from the content-addressed store, hash-verified

327 * Format char c suitable for printing in an error message.
328 */
329static inline string esc(char c) {
330 char buf[12];
331 if (static_cast<uint8_t>(c) >= 0x20 && static_cast<uint8_t>(c) <= 0x7f) {
332 snprintf(buf, sizeof buf, "'%c' (%d)", c, c);
333 } else {
334 snprintf(buf, sizeof buf, "(%d)", c);
335 }
336 return string(buf);
337}
338
339static inline bool in_range(long x, long lower, long upper) {
340 return (x >= lower && x <= upper);

Callers 4

parse_stringMethod · 0.70
parse_numberMethod · 0.70
parse_jsonMethod · 0.70
parseMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected