libqi-api  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
jsoncodec.hpp
Go to the documentation of this file.
1 #pragma once
2 /*
3 ** Copyright (C) 2013 Aldebaran Robotics
4 ** See COPYING for the license
5 */
6 
7 #ifndef _QI_TYPE_JSONCODEC_HPP_
8 #define _QI_TYPE_JSONCODEC_HPP_
9 
10 #include <qi/api.hpp>
11 #include <qi/anyvalue.hpp>
12 
13 namespace qi {
14 
15  // Do not use enum here because we want to pipe those values and we don't want to cast them each time we pipe them
16  using JsonOption = unsigned int;
20 
25  QI_API std::string encodeJSON(const qi::AutoAnyReference &val, JsonOption jsonPrintOption = JsonOption_None);
26 
32  QI_API qi::AnyValue decodeJSON(const std::string &in);
33 
41  QI_API std::string::const_iterator decodeJSON(const std::string::const_iterator &begin,
42  const std::string::const_iterator &end,
43  AnyValue &target);
44 
45 
46 
47 }
48 
49 #endif // _QITYPE_JSONCODEC_HPP_
#define QI_API
Definition: api.hpp:33
dll import/export and compiler message
unsigned int JsonOption
Definition: jsoncodec.hpp:16
const JsonOption JsonOption_Expand
Definition: jsoncodec.hpp:19
const JsonOption JsonOption_PrettyPrint
Definition: jsoncodec.hpp:18
const JsonOption JsonOption_None
Definition: jsoncodec.hpp:17
qi::AnyValue decodeJSON(const std::string &in)
std::string encodeJSON(const qi::AutoAnyReference &val, JsonOption jsonPrintOption=JsonOption_None)