noos::misc Namespace Reference
common misc helper functions More...
Functions | |
std::string | decode64 (const std::string &val) |
decode base64 More... | |
std::string | encode64 (const std::string &val) |
encode base64 More... | |
std::string | random_boundary () |
Create a random boundary for the multipart/form in HTTP. | |
std::string | escape_string (const std::string &str) |
escape JSON strings when sending them over the socket More... | |
template<class F , class... Args> | |
void | for_each_arg (F &&f, Args &&...args) |
expand variadic arguments using a fold expression More... | |
template<typename T > | |
T | get_json_value (const std::string key, const nlohmann::json &json_f) |
method to check if the string exists in the actual json | |
bool | check_json (nlohmann::json &json, const std::string json_str) |
method to check if JSON data is correct | |
bool | check_error (const nlohmann::json json, const std::string error_str="error") |
function to check if an error has been received from | |
bool | save_dec_image (std::string data, std::string filename) |
take decoded data and save it into an image More... | |
Detailed Description
common misc helper functions
- Version
- 0.7.3
- Date
- 10 June 2017
Function Documentation
|
inline |
decode base64
- Parameters
-
val must be encoded using base64
Here is the caller graph for this function:
|
inline |
encode base64
- Parameters
-
val must be plain-text string
- Returns
- a base64 encoded string
|
inline |
escape JSON strings when sending them over the socket
- Parameters
-
str will be escaped and returned
template<class F , class... Args>
void noos::misc::for_each_arg | ( | F && | f, |
Args &&... | args | ||
) |
expand variadic arguments using a fold expression
- Parameters
-
f of template parameter F is the function (a lambda) receiving the expanded object args is the variadic list of args
|
inline |
take decoded data and save it into an image
- Parameters
-
std::string data is the image data before decoding filename is path where to save the image
Here is the call graph for this function: