From 3e25e61778cc9fe427bf68f45de43f26985b12c3 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Fri, 23 Dec 2022 17:22:24 +0100 Subject: aiger: Use new JSON code for writing aiger witness map files --- kernel/json.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'kernel/json.h') diff --git a/kernel/json.h b/kernel/json.h index 3ba355327..ae86b3aa6 100644 --- a/kernel/json.h +++ b/kernel/json.h @@ -38,18 +38,26 @@ class PrettyJson ARRAY, }; + struct Target { + virtual void emit(const char *data) = 0; + virtual void flush() {}; + virtual ~Target() {}; + }; + std::string newline_indent = "\n"; - std::vector> targets; + std::vector> targets; std::vector state = {VALUE}; public: void emit_to_log(); void append_to_string(std::string &target); + bool write_to_file(const std::string &path); bool active() { return !targets.empty(); } void line(); void raw(const char *raw_json); + void flush(); void begin_object(); void begin_array(); void end_object(); -- cgit v1.2.3