Salome HOME
FileService
[modules/gde.git] / projects / GDE_API_CPP / api / src / JsonFormatter.hpp
1 #ifndef GDE_JSON_FORMATTER_HPP
2 #define GDE_JSON_FORMATTER_HPP
3
4 #include <string>
5 #include <vector>
6
7 #include <Poco/JSON/Object.h>
8 #include <Poco/Timestamp.h>
9
10 namespace gde {
11
12   class JsonFormatter {
13   public:
14
15     static Poco::JSON::Object::Ptr parse(const std::string&);
16
17     template <typename T> static T extract(Poco::JSON::Object::Ptr, const std::string&);
18     static Poco::Timestamp extract(Poco::JSON::Object::Ptr, const std::string&);
19
20     template <typename T> static std::vector<T> extractVector(Poco::JSON::Object::Ptr, const std::string&);
21
22     static std::string stringify(const Poco::JSON::Object&);
23
24     static std::string format(const std::string txt, int value);
25     static std::string format(const std::string txt, const std::string& value);
26     static std::string format(const std::string txt, bool value);
27
28   };
29
30 };
31
32 #endif