File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ project(kvdb-cpp VERSION 0.1.0 LANGUAGES CXX)
44
55option (ORYX_KVDB_ENABLE_TESTS "Build Tests" ON )
66option (ORYX_KVDB_BUILD_DEPS "Build Dependencies from source" ON )
7+ option (ORYX_KVDB_INSTALL "Install the project" ${PROJECT_IS_TOP_LEVEL} )
78
89set (CMAKE_CXX_STANDARD_REQUIRED ON )
910if (NOT DEFINED CMAKE_CXX_STANDARD )
@@ -18,7 +19,7 @@ if(ORYX_KVDB_BUILD_DEPS)
1819 FetchContent_Declare (
1920 reflectcpp
2021 GIT_REPOSITORY https://github.com/getml/reflect-cpp.git
21- GIT_TAG v0.19.0
22+ GIT_TAG 2a0fdeabe35bdab0e07e05d4f869ca88bd6d2b8c
2223 OVERRIDE_FIND_PACKAGE
2324 )
2425
@@ -31,7 +32,8 @@ if(ORYX_KVDB_BUILD_DEPS)
3132
3233 option (LEVELDB_BUILD_BENCHMARKS "Build LevelDB benchmarks" OFF )
3334 option (LEVELDB_BUILD_TESTS "Build LevelDB tests" OFF )
34- #option(REFLECTCPP_INSTALL "Install ReflectCpp" ON)
35+ option (LEVELDB_INSTALL "Install LevelDB" ${ORYX_KVDB_INSTALL} )
36+ option (REFLECTCPP_INSTALL "Install ReflectCpp" ${ORYX_KVDB_INSTALL} )
3537 FetchContent_MakeAvailable (reflectcpp leveldb)
3638
3739 add_library (reflectcpp::reflectcpp ALIAS reflectcpp )
@@ -66,7 +68,7 @@ target_include_directories(${PROJECT_NAME} INTERFACE
6668
6769target_compile_options (${PROJECT_NAME } INTERFACE $<$<CONFIG :Debug >:-Wall -Wextra >)
6870
69- if (PROJECT_IS_TOP_LEVEL )
71+ if (ORYX_KVDB_INSTALL )
7072 include (GNUInstallDirs )
7173 include (CMakePackageConfigHelpers )
7274
Original file line number Diff line number Diff line change @@ -118,7 +118,8 @@ class KeyValueDatabase {
118118 return handle_->Delete (opts, key);
119119 }
120120
121- [[nodiscard]] auto IsOpen () const { return handle_ != nullptr ; }
121+ [[nodiscard]] auto IsOpen () const -> bool { return static_cast <bool >(handle_); }
122+ [[nodiscard]] auto handle () const -> leveldb::DB& { return *handle_; }
122123
123124 static auto DefaultOptions () -> leveldb::Options {
124125 leveldb::Options opts{};
Original file line number Diff line number Diff line change 11#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
2- #include " doctest.hpp"
2+ #include " doctest.hpp"
3+
4+ #include < rfl/Result.hpp>
5+ #include < rfl/json/write.hpp>
6+ #include < rfl/json/read.hpp>
You can’t perform that action at this time.
0 commit comments