Bridges-C++  3.4.2
Bridges(C++ API)
Functions
bridges::JSONUtil Namespace Reference

Functions

template<typename T >
std::string JSONencode (const T &d)
 
template<>
std::string JSONencode< std::string > (const std::string &str)
 
std::string JSONencode (const char *str)
 
std::string JSONencode (const double &d, int precision=-1)
 
std::string JSONencode (const float &d, int precision=-1)
 

Function Documentation

◆ JSONencode() [1/4]

std::string bridges::JSONUtil::JSONencode ( const char *  str)
inline

◆ JSONencode() [2/4]

std::string bridges::JSONUtil::JSONencode ( const double &  d,
int  precision = -1 
)
inline

◆ JSONencode() [3/4]

std::string bridges::JSONUtil::JSONencode ( const float &  d,
int  precision = -1 
)
inline

◆ JSONencode() [4/4]

template<typename T >
std::string bridges::JSONUtil::JSONencode ( const T &  d)
inline

encodes whatever C++ primary type: int, float, double, bool, unsigned long int into its basic proper JSON format.

This also works for std::string and char*: that is to say, for a string, it is escaped properly and surrounded by quotes

◆ JSONencode< std::string >()

template<>
std::string bridges::JSONUtil::JSONencode< std::string > ( const std::string &  str)
inline