.. _program_listing_file_include_util_db_backends_RocksDbBackend.hpp: Program Listing for File RocksDbBackend.hpp =========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``include\util\db\backends\RocksDbBackend.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include "util/common/Result.hpp" #include "util/db/DbTypes.hpp" #include #include #include #include #include #include namespace PDJE_UTIL::db::backends { struct RocksDbConfig { std::filesystem::path path; OpenOptions open_options{}; }; class RocksDbBackend { public: using config_type = RocksDbConfig; RocksDbBackend(); ~RocksDbBackend(); RocksDbBackend(RocksDbBackend &&other) noexcept; RocksDbBackend & operator=(RocksDbBackend &&other) noexcept; RocksDbBackend(const RocksDbBackend &) = delete; RocksDbBackend & operator=(const RocksDbBackend &) = delete; static common::Result create(const config_type &cfg); static common::Result destroy(const config_type &cfg); common::Result open(const config_type &cfg); common::Result close(); common::Result contains(std::string_view key) const; common::Result get_text(std::string_view key) const; common::Result get_bytes(std::string_view key) const; common::Result put_text(std::string_view key, std::string_view value); common::Result put_bytes(std::string_view key, std::span value); common::Result erase(std::string_view key); common::Result> list_keys(std::string_view prefix = {}) const; private: class Impl; std::unique_ptr impl_; }; } // namespace PDJE_UTIL::db::backends