blob: c7e0fc3d2e7efa4ab570d2881e91ff399a9b2065 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
#ifndef SLICER_JSON_H
#define SLICER_JSON_H
#include <slicer/serializer.h>
#include <jsonpp.h>
#include <visibility.h>
namespace Slicer {
class JsonSerializer : public Serializer {
protected:
static void ModelTreeIterate(json::Value *, const std::string &, ModelPartPtr mp);
static void ModelTreeIterateSeq(json::Value *, ModelPartPtr mp);
static void ModelTreeIterateRoot(json::Value *, ModelPartPtr mp);
};
class DLL_PUBLIC JsonStreamSerializer : public JsonSerializer {
public:
JsonStreamSerializer(std::ostream &);
virtual void Serialize(ModelPartPtr) override;
protected:
std::ostream & strm;
};
class DLL_PUBLIC JsonFileSerializer : public JsonSerializer {
public:
JsonFileSerializer(const boost::filesystem::path &);
virtual void Serialize(ModelPartPtr) override;
protected:
const boost::filesystem::path path;
};
class DLL_PUBLIC JsonValueSerializer : public JsonSerializer {
public:
JsonValueSerializer(json::Value &);
virtual void Serialize(ModelPartPtr) override;
protected:
json::Value & value;
};
class DLL_PUBLIC JsonStreamDeserializer : public Deserializer {
public:
JsonStreamDeserializer(std::istream &);
virtual void Deserialize(ModelPartPtr) override;
protected:
std::istream & strm;
};
class DLL_PUBLIC JsonFileDeserializer : public Deserializer {
public:
JsonFileDeserializer(const boost::filesystem::path &);
virtual void Deserialize(ModelPartPtr) override;
protected:
const boost::filesystem::path path;
};
class DLL_PUBLIC JsonValueDeserializer : public Deserializer {
public:
JsonValueDeserializer(const json::Value &);
virtual void Deserialize(ModelPartPtr) override;
protected:
const json::Value & value;
};
}
#endif
|