OpenVPN 3 Core Library
Loading...
Searching...
No Matches
jsonhelper.hpp File Reference
#include <string>
#include <cstring>
#include <cstdint>
#include <utility>
#include <openvpn/common/exception.hpp>
#include <openvpn/common/string.hpp>
#include <openvpn/common/number.hpp>
#include <openvpn/common/file.hpp>
#include <openvpn/common/jsonlib.hpp>
#include <openvpn/common/jsonhelperfmt.hpp>
#include <openvpn/buffer/bufstr.hpp>
#include <openvpn/buffer/bufstream.hpp>
Include dependency graph for jsonhelper.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  openvpn
 Support deferred server-side state creation when client connects.
 
namespace  openvpn::json
 

Macros

#define DISABLE_DANGLING_WARNINGS()
 
#define REENABLE_DANGLING_WARNINGS()
 

Functions

 openvpn::json::OPENVPN_EXCEPTION (json_parse)
 
template<typename TITLE >
Json::Value openvpn::json::parse (const std::string &str, const TITLE &title)
 
Json::Value openvpn::json::parse (const std::string &str)
 
Json::Value openvpn::json::parse_from_file (const std::string &fn)
 
template<typename BUFFER , typename TITLE >
Json::Value openvpn::json::parse_from_buffer (const BUFFER &buf, const TITLE &title)
 
template<typename T , typename NAME >
void openvpn::json::from_vector (Json::Value &root, const T &vec, const NAME &name)
 
template<typename TITLE >
void openvpn::json::assert_dict (const Json::Value &obj, const TITLE &title)
 
template<typename TITLE >
bool openvpn::json::is_dict (const Json::Value &obj, const TITLE &title)
 
template<typename NAME >
bool openvpn::json::exists (const Json::Value &root, const NAME &name)
 
template<typename NAME >
bool openvpn::json::string_exists (const Json::Value &root, const NAME &name)
 
template<typename T , typename NAME , typename TITLE >
void openvpn::json::to_vector (const Json::Value &root, T &vec, const NAME &name, const TITLE &title)
 
template<typename NAME , typename TITLE >
std::string openvpn::json::get_string (const Json::Value &root, const NAME &name, const TITLE &title)
 
template<typename NAME >
std::string openvpn::json::get_string (const Json::Value &root, const NAME &name)
 
template<typename NAME , typename TITLE >
std::string openvpn::json::get_string_optional (const Json::Value &root, const NAME &name, const std::string &default_value, const TITLE &title)
 
template<typename NAME >
std::string openvpn::json::get_string_optional (const Json::Value &root, const NAME &name, const std::string &default_value)
 
template<typename TITLE >
std::string openvpn::json::get_string_from_array (const Json::Value &root, const Json::ArrayIndex index, const TITLE &title)
 
std::string openvpn::json::get_string_from_array (const Json::Value &root, const Json::ArrayIndex index)
 
template<typename NAME , typename TITLE >
int openvpn::json::get_int (const Json::Value &root, const NAME &name, const TITLE &title)
 
template<typename NAME >
int openvpn::json::get_int (const Json::Value &root, const NAME &name)
 
template<typename NAME , typename TITLE >
int openvpn::json::get_int_optional (const Json::Value &root, const NAME &name, const int default_value, const TITLE &title)
 
template<typename NAME >
int openvpn::json::get_int_optional (const Json::Value &root, const NAME &name, const int default_value)
 
template<typename NAME , typename TITLE >
unsigned int openvpn::json::get_uint (const Json::Value &root, const NAME &name, const TITLE &title)
 
template<typename NAME >
unsigned int openvpn::json::get_uint (const Json::Value &root, const NAME &name)
 
template<typename NAME , typename TITLE >
unsigned int openvpn::json::get_uint_optional (const Json::Value &root, const NAME &name, const unsigned int default_value, const TITLE &title)
 
template<typename NAME >
unsigned int openvpn::json::get_uint_optional (const Json::Value &root, const NAME &name, const unsigned int default_value)
 
template<typename NAME , typename TITLE >
unsigned int openvpn::json::get_uint_via_string (const Json::Value &root, const NAME &name, const TITLE &title)
 
template<typename NAME >
unsigned int openvpn::json::get_uint_via_string (const Json::Value &root, const NAME &name)
 
template<typename NAME , typename TITLE >
unsigned int openvpn::json::get_uint_optional_via_string (const Json::Value &root, const NAME &name, const unsigned int default_value, const TITLE &title)
 
template<typename NAME >
unsigned int openvpn::json::get_uint_optional_via_string (const Json::Value &root, const NAME &name, const unsigned int default_value)
 
template<typename NAME , typename TITLE >
std::uint64_t openvpn::json::get_uint64 (const Json::Value &root, const NAME &name, const TITLE &title)
 
template<typename NAME >
std::uint64_t openvpn::json::get_uint64 (const Json::Value &root, const NAME &name)
 
template<typename NAME , typename TITLE >
std::uint64_t openvpn::json::get_uint64_optional (const Json::Value &root, const NAME &name, const std::uint64_t default_value, const TITLE &title)
 
template<typename NAME , typename TITLE >
std::int64_t openvpn::json::get_int64_optional (const Json::Value &root, const NAME &name, const std::uint64_t default_value, const TITLE &title)
 
template<typename NAME >
std::uint64_t openvpn::json::get_uint64_optional (const Json::Value &root, const NAME &name, const std::uint64_t default_value)
 
template<typename NAME , typename TITLE >
std::uint64_t openvpn::json::get_integer_optional (const Json::Value &root, const NAME &name, const std::uint64_t default_value, const TITLE &title)
 
template<typename NAME , typename TITLE >
std::int64_t openvpn::json::get_integer_optional (const Json::Value &root, const NAME &name, const std::int64_t default_value, const TITLE &title)
 
template<typename NAME , typename TITLE >
unsigned int openvpn::json::get_integer_optional (const Json::Value &root, const NAME &name, const unsigned int default_value, const TITLE &title)
 
template<typename NAME , typename TITLE >
int openvpn::json::get_integer_optional (const Json::Value &root, const NAME &name, const int default_value, const TITLE &title)
 
template<typename NAME , typename TITLE >
std::uint64_t openvpn::json::get_uint64_via_string (const Json::Value &root, const NAME &name, const TITLE &title)
 
template<typename NAME >
std::uint64_t openvpn::json::get_uint64_via_string (const Json::Value &root, const NAME &name)
 
template<typename NAME , typename TITLE >
std::uint64_t openvpn::json::get_uint64_optional_via_string (const Json::Value &root, const NAME &name, const std::uint64_t default_value, const TITLE &title)
 
template<typename NAME >
std::uint64_t openvpn::json::get_uint64_optional_via_string (const Json::Value &root, const NAME &name, const std::uint64_t default_value)
 
template<typename NAME , typename TITLE >
bool openvpn::json::get_bool (const Json::Value &root, const NAME &name, const TITLE &title)
 
template<typename NAME >
bool openvpn::json::get_bool (const Json::Value &root, const NAME &name)
 
template<typename NAME >
bool openvpn::json::get_bool_optional (const Json::Value &root, const NAME &name, const bool default_value=false)
 
template<typename NAME >
int openvpn::json::get_bool_tristate (const Json::Value &root, const NAME &name)
 
template<typename NAME , typename TITLE >
const Json::Value & openvpn::json::get_dict (const Json::Value &root, const NAME &name, const bool optional, const TITLE &title)
 
template<typename NAME >
const Json::Value & openvpn::json::get_dict (const Json::Value &root, const NAME &name, const bool optional)
 
template<typename NAME , typename TITLE >
Json::Value openvpn::json::get_dict (Json::Value &&root, const NAME &name, const bool optional, const TITLE &title)
 
template<typename NAME >
Json::Value openvpn::json::get_dict (Json::Value &&root, const NAME &name, const bool optional)
 
template<typename TITLE >
const Json::Value & openvpn::json::cast_dict (const Json::Value &value, const bool optional, const TITLE &title)
 
const Json::Value & openvpn::json::cast_dict (const Json::Value &value, const bool optional)
 
template<typename TITLE >
Json::Value openvpn::json::cast_dict (Json::Value &&value, const bool optional, const TITLE &title)
 
Json::Value openvpn::json::cast_dict (Json::Value &&value, const bool optional)
 
template<typename NAME , typename TITLE >
const Json::Value & openvpn::json::get_array (const Json::Value &root, const NAME &name, const bool optional, const TITLE &title)
 
template<typename NAME >
const Json::Value & openvpn::json::get_array (const Json::Value &root, const NAME &name, const bool optional)
 
template<typename NAME , typename TITLE >
Json::Value openvpn::json::get_array (Json::Value &&root, const NAME &name, const bool optional, const TITLE &title)
 
template<typename NAME >
Json::Value openvpn::json::get_array (Json::Value &&root, const NAME &name, const bool optional)
 
template<typename TITLE >
const Json::Value & openvpn::json::cast_array (const Json::Value &value, const bool optional, const TITLE &title)
 
const Json::Value & openvpn::json::cast_array (const Json::Value &value, const bool optional)
 
template<typename TITLE >
Json::Value openvpn::json::cast_array (Json::Value &&value, const bool optional, const TITLE &title)
 
Json::Value openvpn::json::cast_array (Json::Value &&value, const bool optional)
 
template<typename NAME , typename TITLE >
void openvpn::json::to_string (const Json::Value &root, std::string &dest, const NAME &name, const TITLE &title)
 
template<typename NAME , typename TITLE >
void openvpn::json::to_string_optional (const Json::Value &root, std::string &dest, const NAME &name, const std::string &default_value, const TITLE &title)
 
template<typename NAME , typename TITLE >
void openvpn::json::to_int (const Json::Value &root, int &dest, const NAME &name, const TITLE &title)
 
template<typename NAME , typename TITLE >
void openvpn::json::to_uchar (const Json::Value &root, unsigned char &dest, const NAME &name, const TITLE &title)
 
template<typename NAME , typename TITLE >
void openvpn::json::to_uint (const Json::Value &root, unsigned int &dest, const NAME &name, const TITLE &title)
 
template<typename NAME , typename TITLE >
void openvpn::json::to_uint_optional (const Json::Value &root, unsigned int &dest, const NAME &name, const unsigned int default_value, const TITLE &title)
 
template<typename NAME , typename TITLE >
void openvpn::json::to_uint64 (const Json::Value &root, std::uint64_t &dest, const NAME &name, const TITLE &title)
 
template<typename NAME , typename TITLE >
void openvpn::json::to_bool (const Json::Value &root, bool &dest, const NAME &name, const TITLE &title)
 
void openvpn::json::format_compact (const Json::Value &root, Buffer &buf)
 
std::string openvpn::json::format_compact (const Json::Value &root, const size_t size_hint=256)
 
void openvpn::json::format (const Json::Value &root, Buffer &buf)
 
std::string openvpn::json::format (const Json::Value &root)
 
std::string openvpn::json::error (const Json::Value &root)
 
Json::Value openvpn::json::dict_result (Json::Value jr)
 

Macro Definition Documentation

◆ DISABLE_DANGLING_WARNINGS

#define DISABLE_DANGLING_WARNINGS ( )

Definition at line 48 of file jsonhelper.hpp.

◆ REENABLE_DANGLING_WARNINGS

#define REENABLE_DANGLING_WARNINGS ( )

Definition at line 49 of file jsonhelper.hpp.