CoolProp 8.0.0
An open-source fluid property and humid air property database
Namespaces | Enumerations | Functions
json.h File Reference
#include "CoolProp/Exceptions.h"
#include "CoolProp/detail/tools.h"
#include <cstddef>
#include <cstdint>
#include <exception>
#include <limits>
#include <stdexcept>
#include <string>
#include <string_view>
#include <vector>
#include <nlohmann/json.hpp>
#include <valijson/adapters/nlohmann_json_adapter.hpp>
#include <valijson/schema.hpp>
#include <valijson/schema_parser.hpp>
#include <valijson/validator.hpp>

Go to the source code of this file.

Namespaces

namespace  cpjson
 

Enumerations

enum  cpjson::schema_validation_code { cpjson::SCHEMA_VALIDATION_OK = 0 , cpjson::SCHEMA_INVALID_JSON , cpjson::INPUT_INVALID_JSON , cpjson::SCHEMA_NOT_VALIDATED }
 Result of validate_schema() below. More...
 

Functions

nlohmann::json cpjson::parse (std::string_view text)
 
nlohmann::json cpjson::from_cbor (const std::uint8_t *data, std::size_t size)
 
std::string cpjson::json2string (const nlohmann::json &v)
 Serialize an nlohmann::json value to a pretty-printed string. More...
 
int cpjson::get_integer (const nlohmann::json &v, const std::string &m)
 
double cpjson::get_double (const nlohmann::json &v, const std::string &m)
 
bool cpjson::get_bool (const nlohmann::json &v, const std::string &m)
 
std::string cpjson::get_string (const nlohmann::json &v, const std::string &m)
 
std::vector< double > cpjson::get_double_array (const nlohmann::json &v)
 
std::vector< double > cpjson::get_double_array (const nlohmann::json &v, const std::string &m)
 
std::vector< CoolPropDblcpjson::get_long_double_array (const nlohmann::json &v)
 
std::vector< CoolPropDblcpjson::get_long_double_array (const nlohmann::json &v, const std::string &name)
 
std::vector< std::vector< double > > cpjson::get_double_array2D (const nlohmann::json &v)
 
std::vector< std::vector< CoolPropDbl > > cpjson::get_long_double_array2D (const nlohmann::json &v)
 
std::vector< std::string > cpjson::get_string_array (const nlohmann::json &v)
 
std::vector< std::string > cpjson::get_string_array (const nlohmann::json &v, const std::string &m)
 
schema_validation_code cpjson::validate_schema (std::string_view schemaJson, std::string_view inputJson, std::string &errstr)