21 namespace foreign_storage {
23 void set_value(rapidjson::Value& json_val,
24 const FileRegion& file_region,
25 rapidjson::Document::AllocatorType& allocator) {
28 json_val, file_region.first_row_file_offset,
"first_row_file_offset", allocator);
30 json_val, file_region.first_row_index,
"first_row_index", allocator);
32 json_val, file_region.region_size,
"region_size", allocator);
34 json_val, file_region.row_count,
"row_count", allocator);
35 if (file_region.file_path.size()) {
37 json_val, file_region.file_path,
"file_path", allocator);
41 void get_value(
const rapidjson::Value& json_val, FileRegion& file_region) {
42 CHECK(json_val.IsObject());
44 json_val, file_region.first_row_file_offset,
"first_row_file_offset");
46 json_val, file_region.first_row_index,
"first_row_index");
49 if (json_val.HasMember(
"file_path")) {
51 }
else if (json_val.HasMember(
"filename")) {
void get_value_from_object(const rapidjson::Value &object, T &value, const std::string &name)
void get_value(const rapidjson::Value &json_val, FileRegion &file_region)
void add_value_to_object(rapidjson::Value &object, const T &value, const std::string &name, rapidjson::Document::AllocatorType &allocator)
void set_value(rapidjson::Value &json_val, const FileRegion &file_region, rapidjson::Document::AllocatorType &allocator)