2016-07-03 08:02:42 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
#include "storage/model/properties/properties.hpp"
|
|
|
|
#include "storage/model/properties/handler.hpp"
|
2016-07-03 08:02:42 +08:00
|
|
|
|
|
|
|
using std::cout;
|
|
|
|
using std::endl;
|
|
|
|
|
|
|
|
class ConsoleWriter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ConsoleWriter() {}
|
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
void handle(const std::string &key, Property &value)
|
2016-07-03 08:02:42 +08:00
|
|
|
{
|
|
|
|
cout << "KEY: " << key << "; VALUE: ";
|
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
accept(value, *this);
|
|
|
|
|
|
|
|
// value.accept(*this);
|
2016-07-03 08:02:42 +08:00
|
|
|
|
|
|
|
cout << endl;
|
|
|
|
}
|
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
void handle(Bool &b) { cout << b.value(); }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
void handle(String &s) { cout << s.value; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
void handle(Int32 &int32) { cout << int32.value; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
void handle(Int64 &int64) { cout << int64.value; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
void handle(Float &f) { cout << f.value; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
void handle(Double &d) { cout << d.value; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
void finish() {}
|
2016-07-03 08:02:42 +08:00
|
|
|
};
|