19#ifndef _BACKENDS_TOFINO_BF_P4C_LOGGING_RAPIDJSON_ADAPTER_H_
20#define _BACKENDS_TOFINO_BF_P4C_LOGGING_RAPIDJSON_ADAPTER_H_
22#include <rapidjson/document.h>
23#include <rapidjson/prettywriter.h>
28using PlainWriter = rapidjson::Writer<rapidjson::StringBuffer>;
29using PrettyWriter = rapidjson::PrettyWriter<rapidjson::StringBuffer>;
38 virtual void Key(
const char *s) = 0;
39 virtual void Bool(
bool b) = 0;
40 virtual void Int(
int n) = 0;
41 virtual void Double(
double d) = 0;
42 virtual void String(
const char *s) = 0;
43 virtual void StartArray() = 0;
44 virtual void EndArray() = 0;
45 virtual void StartObject() = 0;
46 virtual void EndObject() = 0;
55 virtual void Key(
const char *s) { w.Key(s); }
56 virtual void Bool(
bool b) { w.Bool(b); }
57 virtual void Int(
int n) { w.Int(n); }
58 virtual void Double(
double d) { w.Double(d); }
59 virtual void String(
const char *s) { w.String(s); }
60 virtual void StartArray() { w.StartArray(); }
61 virtual void EndArray() { w.EndArray(); }
62 virtual void StartObject() { w.StartObject(); }
63 virtual void EndObject() { w.EndObject(); }
72 virtual void Key(
const char *s) { w.Key(s); }
73 virtual void Bool(
bool b) { w.Bool(b); }
74 virtual void Int(
int n) { w.Int(n); }
75 virtual void Double(
double d) { w.Double(d); }
76 virtual void String(
const char *s) { w.String(s); }
77 virtual void StartArray() { w.StartArray(); }
78 virtual void EndArray() { w.EndArray(); }
79 virtual void StartObject() { w.StartObject(); }
80 virtual void EndObject() { w.EndObject(); }
Definition rapidjson_adapter.h:68
Definition rapidjson_adapter.h:51
Definition rapidjson_adapter.h:36
rapidjson::Writer< rapidjson::StringBuffer > PlainWriter
Plain writer does not indent with whitespaces.
Definition rapidjson_adapter.h:28