Commit 16d32d5f authored by Mathieu Giraud's avatar Mathieu Giraud

core/output.{h,cpp}: SampleOutput

See #3358.
parent 70c2c165
......@@ -2,22 +2,27 @@
#include "output.h"
void CloneOutput::set(string key, json val)
void Output::set(string key, json val)
{
j[key] = val ;
}
void CloneOutput::set(string key, string subkey, json val)
void Output::set(string key, string subkey, json val)
{
j[key][subkey] = val ;
}
void Output::set(string key, string subkey, string subsubkey, json val)
{
j[key][subkey][subsubkey] = val ;
}
void CloneOutput::setSeg(string subkey, json val)
{
set(KEY_SEG, subkey, val);
}
void CloneOutput::add_warning(string code, string msg, string level)
void Output::add_warning(string code, string msg, string level)
{
json_add_warning(j, code, msg, level);
}
......@@ -26,3 +31,16 @@ json CloneOutput::toJson()
{
return j;
}
SampleOutput::SampleOutput(json init)
{
j = init;
}
void SampleOutput::addClone(junction junction, CloneOutput *clone)
{
clones[junction] = clone;
}
......@@ -4,6 +4,7 @@
#include <string>
#include <fstream>
#include <iostream>
#include "windows.h"
#include "tools.h"
#include "../lib/json.hpp"
......@@ -12,27 +13,61 @@
using namespace std;
using json = nlohmann::json;
class CloneOutput
class Output
{
private:
protected:
json j;
public:
void set(string key, json val);
void set(string key, string subkey, json val);
void setSeg(string subkey, json val);
void set(string key, string subkey, string subsubkey, json val);
void add_warning(string code, string msg, string level);
};
class CloneOutput : public Output
{
public:
void setSeg(string subkey, json val);
json toJson();
};
class SampleOutput : public Output
{
private:
map <junction, CloneOutput*> clones;
public:
SampleOutput(json init);
void addClone(junction junction, CloneOutput *clone);
json toJson();
};
/*
class SampleOutput
class CloneOutputFormatter
{
}
class CloneOutputFormatterCSV(CloneOutputFormatter)
{
}
class CloneOutputFormatterJson(CloneOutputFormatter)
{
}
*/
/*
class SampleOutputFormatter
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment