20 const bool optional =
true,
21 std::uint64_t *mtime_ns =
nullptr)
24 if (!bp || bp->empty())
30 const bool optional =
true,
31 std::uint64_t *mtime_ns =
nullptr)
33 Json::Value jret =
read_fast(fn, optional, mtime_ns);
37 throw json_parse(
"read_fast_dict: json file " + fn +
" does not contain a top-level dictionary");
42 const std::string &tmpdir,
44 const std::uint64_t mtime_ns,
45 const Json::Value &root,
46 const size_t size_hint,
56 const std::uint64_t mtime_ns,
57 const Json::Value &root,
58 const size_t size_hint)
static Ptr Create(ArgsT &&...args)
Creates a new instance of RcEnable with the given arguments.
Abstract base class for cryptographically strong random number generators.
constexpr BufferFlags GROW(1u<< 2)
if enabled, buffer will grow (otherwise buffer_full exception will be thrown)
void write_fast(const std::string &fn, const mode_t mode, const std::uint64_t mtime_ns, const Json::Value &root, const size_t size_hint)
void write_atomic(const std::string &fn, const std::string &tmpdir, const mode_t mode, const std::uint64_t mtime_ns, const Json::Value &root, const size_t size_hint, StrongRandomAPI &rng)
Json::Value read_fast(const std::string &fn, const bool optional=true, std::uint64_t *mtime_ns=nullptr)
Json::Value read_fast_dict(const std::string &fn, const bool optional=true, std::uint64_t *mtime_ns=nullptr)
void format_compact(const Json::Value &root, Buffer &buf)
Json::Value parse_from_buffer(const BUFFER &buf, const TITLE &title)
void write_binary_unix(const std::string &fn, const mode_t mode, const std::uint64_t mtime_ns, const void *buf, const ssize_t size)
BufferPtr read_binary_unix(const std::string &fn, const std::uint64_t max_size=0, const unsigned int enoent_option=0, std::uint64_t *mtime_ns=nullptr)
void write_binary_atomic(const std::string &fn, const std::string &tmpdir, const mode_t mode, const std::uint64_t mtime_ns, const ConstBuffer &buf, StrongRandomAPI &rng)