aboutsummaryrefslogtreecommitdiff
path: root/src/main/input-output/input/json-parsing/json_helper.h
diff options
context:
space:
mode:
authorthecharlesblake2018-10-13 22:32:19 +0100
committerthecharlesblake2018-10-13 22:32:19 +0100
commit23b250bf83739772ff54d9ba505f1fafa2be193b (patch)
treef5ec04f085779c03045fab051eb0bb519d4bfd96 /src/main/input-output/input/json-parsing/json_helper.h
parentAdd deal-print cmdln option (diff)
downloadmetasol-23b250bf83739772ff54d9ba505f1fafa2be193b.tar.gz
metasol-23b250bf83739772ff54d9ba505f1fafa2be193b.zip

Add json printing of initial deal

Diffstat (limited to 'src/main/input-output/input/json-parsing/json_helper.h')
-rw-r--r--src/main/input-output/input/json-parsing/json_helper.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/input-output/input/json-parsing/json_helper.h b/src/main/input-output/input/json-parsing/json_helper.h
index b5e2d51..460911f 100644
--- a/src/main/input-output/input/json-parsing/json_helper.h
+++ b/src/main/input-output/input/json-parsing/json_helper.h
@@ -7,7 +7,11 @@
#include <string>
+#include <boost/property_tree/ptree.hpp>
+#include <boost/property_tree/json_parser.hpp>
+
#include "../../../../../lib/rapidjson/schema.h"
+#include "../../../game/search-state/game_state.h"
class json_helper {
public:
@@ -15,6 +19,12 @@ public:
static void json_parse_warning(const std::string& msg);
static void json_parse_err(const std::string& msg);
static const std::string schema_err_str(const rapidjson::SchemaValidator&);
+ static void print_game_state_as_json(const game_state&);
+private:
+ static boost::property_tree::ptree piles_to_ptree(const game_state&, const std::list<pile::ref>&);
+ static boost::property_tree::ptree piles_to_ptree(const game_state&, const std::vector<pile::ref>&);
+ static boost::property_tree::ptree pile_to_ptree(const pile&);
+ static boost::property_tree::ptree card_to_ptree(const card&);
};