306 | void write(const T& c) {
307 | $(writer_body("escape", ""))
308 | }
309 |
310 | void write_b(const std::string & c) {
311 | $(writer_body("escape_b", ""))
312 | }
313 |
314 | public:
315 | ascii_printer(std::ostream & str_v) : str(str_v) {
316 | str <<
317 | ""
318 | ""
319 | ""
320 | ""
340 | ""
341 | ""
342 | "";
343 | }
344 |
345 | ~ascii_printer() {
346 | str << "
"
347 | ""
348 | "\n";
349 | }
350 |
351 | ascii_printer& operator<<(unsigned int c) {
352 | col.emplace(c);
353 | return *this;
354 | }
355 |
356 | ascii_printer& operator<<(const std::string & c) {
357 | write(c); return *this;
358 | }
359 |
360 | ascii_printer& operator>>(const char c) {
361 | write(c); return *this;
362 | }
363 |
364 | ascii_printer& operator>>(const std::string & c) {
365 | write_b(c); return *this;
366 | }
367 |
368 | ascii_printer& operator<<(const std::string_view & c) {
369 | write(c); return *this;
370 | }
371 | };
372 | }
373 |
374 | #endif
375 |
--------------------------------------------------------------------------------