]> granicus.if.org Git - icinga2/blob - lib/base/serializer.hpp
Merge pull request #7185 from Icinga/bugfix/gelfwriter-wrong-log-facility
[icinga2] / lib / base / serializer.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef SERIALIZER_H
4 #define SERIALIZER_H
5
6 #include "base/i2-base.hpp"
7 #include "base/type.hpp"
8 #include "base/value.hpp"
9 #include "base/exception.hpp"
10
11 namespace icinga
12 {
13
14 class CircularReferenceError : virtual public user_error
15 {
16 public:
17         CircularReferenceError(String message, std::vector<String> path);
18         ~CircularReferenceError() throw() = default;
19
20         const char *what(void) const throw() final;
21         std::vector<String> GetPath() const;
22
23 private:
24         String m_Message;
25         std::vector<String> m_Path;
26 };
27
28 Value Serialize(const Value& value, int attributeTypes = FAState);
29 Value Deserialize(const Value& value, bool safe_mode = false, int attributeTypes = FAState);
30 Value Deserialize(const Object::Ptr& object, const Value& value, bool safe_mode = false, int attributeTypes = FAState);
31
32 }
33
34 #endif /* SERIALIZER_H */