.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "PMEMKV_JSON_CONFIG" "3" "2021-07-26" "PMEMKV - pmemkv_json_config version 1.5.0-rc1" "PMEMKV Programmer's Manual" .hy .\" SPDX-License-Identifier: BSD-3-Clause .\" Copyright 2019-2021, Intel Corporation .SH NAME .PP \f[B]pmemkv_json_config\f[R] - helper configuration API for libpmemkv .SH SYNOPSIS .IP .nf \f[C] #include int pmemkv_config_from_json(pmemkv_config *config, const char *jsonconfig); const char *pmemkv_config_from_json_errormsg(void); \f[R] .fi .PP For general description of pmemkv and available engines see \f[B]libpmemkv\f[R](7). For description of pmemkv core API see \f[B]libpmemkv\f[R](3). For description of configuration API for libpmemkv see \f[B]libpmemkv_config\f[R](3). .SH DESCRIPTION .PP pmemkv_json_config is a helper library that provides two functions: .TP \f[B]\f[CB]int pmemkv_config_from_json(pmemkv_config *config, const char *jsonconfig);\f[B]\f[R] Parses JSON string and puts all items found in JSON into \f[C]config\f[R]. Allowed types in JSON strings and their corresponding types in pmemkv_config are: + \f[B]number\f[R] \[en] int64 or uint64 + \f[B]string\f[R] \[en] const char * + \f[B]object\f[R] \[en] (another JSON string) -> pointer to pmemkv_config (can be obtained using pmemkv_config_get_object) + \f[B]True\f[R], \f[B]False\f[R] \[en] int64 .TP \f[B]\f[CB]const char *pmemkv_config_from_json_errormsg(void);\f[B]\f[R] Returns a human readable string describing the last error. .PP The \f[C]pmemkv_config_from_json\f[R] function depends on RapidJSON library what is the direct cause of the creation of this small library. .PP The building of this library is enabled by default. It can be disabled by setting the \f[B]BUILD_JSON_CONFIG\f[R] CMake variable to OFF: .IP .nf \f[C] cmake .. -DBUILD_JSON_CONFIG=OFF \f[R] .fi .SS ERRORS .PP The \f[C]pmemkv_config_from_json()\f[R] function returns status. Possible return values are: .IP \[bu] 2 \f[B]PMEMKV_STATUS_OK\f[R] \[en] no error .IP \[bu] 2 \f[B]PMEMKV_STATUS_UNKNOWN_ERROR\f[R] \[en] unknown error .IP \[bu] 2 \f[B]PMEMKV_STATUS_CONFIG_PARSING_ERROR\f[R] \[en] parsing config data failed .SH EXAMPLE .PP An example using this API can be found in \f[B]libpmemkv_config\f[R](3). .SH SEE ALSO .PP \f[B]libpmemkv\f[R](7), \f[B]libpmemkv\f[R](3), \f[B]libpmemkv_config\f[R](3) and \f[B]\f[R]