MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
|
A utility class to convert between JSON and user-defined types. 更多...
#include <ob_manifest.h>
静态 Public 成员函数 | |
template<typename T > | |
static Json::Value | to_json (const T &t) |
Converts an object of type T to a JSON value. 更多... | |
template<typename T > | |
static RC | from_json (const Json::Value &v, T &t) |
Converts a JSON value to an object of type T. 更多... | |
template<> | |
Json::Value | to_json (const CompactionType &type) |
Specialization of to_json() for CompactionType . 更多... | |
template<> | |
RC | from_json (const Json::Value &v, CompactionType &type) |
Specialization of from_json() for CompactionType . 更多... | |
A utility class to convert between JSON and user-defined types.
Provides template methods for converting an object to JSON and vice versa. Specialized template functions exist for specific types like CompactionType
.
|
inlinestatic |
Specialization of from_json()
for CompactionType
.
Converts a JSON value representing an integer into a CompactionType
.
v | The JSON value to convert. |
type | The CompactionType value that will be populated from the JSON value. |
|
inlinestatic |
Converts a JSON value to an object of type T.
This function uses the from_json()
method of the type T to convert the JSON value.
T | The type of the object. |
v | The JSON value to be converted. |
t | The object that will be populated from the JSON value. |
|
inlinestatic |
Specialization of to_json()
for CompactionType
.
Converts a CompactionType
value to its integer representation in JSON format.
type | The CompactionType value to convert. |
CompactionType
.
|
inlinestatic |
Converts an object of type T to a JSON value.
This function uses the to_json()
method of the type T to convert it to JSON.
T | The type of the object. |
t | The object to be converted. |