Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
picojson::serialize_str_char< Iter > Struct Template Reference

Public Member Functions

void operator() (char c)
 

Public Attributes

Iter oi
 

Detailed Description

template<typename Iter>
struct picojson::serialize_str_char< Iter >

Definition at line 503 of file spec_test_generator.cpp.

Member Function Documentation

◆ operator()()

template<typename Iter >
void picojson::serialize_str_char< Iter >::operator() ( char c)
inline

Definition at line 505 of file spec_test_generator.cpp.

505 {
506 switch (c) {
507# define MAP(val, sym) \
508 case val: copy(sym, oi); break
509 MAP('"', "\\\"");
510 MAP('\\', "\\\\");
511 MAP('/', "\\/");
512 MAP('\b', "\\b");
513 MAP('\f', "\\f");
514 MAP('\n', "\\n");
515 MAP('\r', "\\r");
516 MAP('\t', "\\t");
517# undef MAP
518 default:
519 if (static_cast<unsigned char>(c) < 0x20 || c == 0x7f) {
520 char buf[7];
521 SNPRINTF(buf, sizeof(buf), "\\u%04x", c & 0xff);
522 copy(buf, buf + 6, oi);
523 } else {
524 *oi++ = c;
525 }
526 break;
527 }
528 }
void copy(const std::string &s, Iter oi)
#define MAP(val, sym)
#define SNPRINTF
uint8_t buf[2048]
Here is the call graph for this function:

Member Data Documentation

◆ oi

template<typename Iter >
Iter picojson::serialize_str_char< Iter >::oi

Definition at line 504 of file spec_test_generator.cpp.


The documentation for this struct was generated from the following file: