automotive-message-broker  0.14.803
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
jsonhelper.h
1 #ifndef _JSON_HELPER_H_
2 #define _JSON_HELPER_H_
3 
4 #include "picojson.h"
5 
6 #include <memory>
7 
8 #include <glib.h>
9 
11 
12 namespace amb
13 {
14 namespace BasicTypes
15 {
16 enum BasicTypeEnum
17 {
18  UInt16,
19  UInt32,
20  Int16,
21  Int32,
22  String,
23  Double,
24  Boolean
25 };
26 
27 extern const char * UInt16Str;
28 extern const char * UInt32Str;
29 extern const char * Int16Str;
30 extern const char * Int32Str;
31 extern const char * StringStr;
32 extern const char * DoubleStr;
33 extern const char * BooleanStr;
34 
40 const std::string fromSignature(std::string const & sig);
41 
47 const std::string fromAbstractProperty(AbstractPropertyType *property);
48 
49 } // BasicTypes
50 
51 picojson::value gvariantToJson(GVariant* value);
52 
53 GVariant * jsonToGVariant(const picojson::value & json, const std::string & signature);
54 
55 std::shared_ptr<AbstractPropertyType> jsonToProperty(const picojson::value& json);
56 }
57 
58 #endif
59