1#ifndef TAKANE_RDS_FILE_HPP
2#define TAKANE_RDS_FILE_HPP
4#include "utils_files.hpp"
5#include "ritsuko/ritsuko.hpp"
33 const std::string type_name =
"rds_file";
34 const auto& rdsmap = internal_json::extract_typed_object_from_metadata(metadata.
other, type_name);
36 const std::string version_name =
"version";
37 const std::string& vstring = internal_json::extract_string_from_typed_object(rdsmap, version_name, type_name);
38 auto version = ritsuko::parse_version_string(vstring.c_str(), vstring.size(),
true);
39 if (version.major != 1) {
40 throw std::runtime_error(
"unsupported version string '" + vstring +
"'");
43 auto fpath = path /
"file.rds";
46 internal_files::check_gzip_signature(fpath);
47 internal_files::check_gunzipped_signature(fpath,
"X\n", 2,
"RDS");
void validate(const std::filesystem::path &path, const ObjectMetadata &metadata, Options &options)
Definition rds_file.hpp:32
takane validation functions.
Definition _derived_from.hpp:15
Validation options.
Definition utils_public.hpp:93
std::function< void(const std::filesystem::path &, const ObjectMetadata &, Options &)> rds_file_strict_check
Definition utils_public.hpp:228