Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,17 @@ endif ()
#####################################
# simdjson
FetchContent_Declare(
simdjson
GIT_REPOSITORY https://github.com/simdjson/simdjson.git
GIT_TAG v4.0.7
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.12.0
)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG v3.0.1
)

set(SIMDJSON_IMPLEMENTATION fallback CACHE STRING "" FORCE)
FetchContent_MakeAvailable(simdjson pybind11)
FetchContent_MakeAvailable(nlohmann_json pybind11)

#####################################
# Sources and headers
Expand All @@ -64,10 +63,9 @@ add_library(libcapio_cl STATIC ${CAPIO_SRC} ${CAPIO_CL_HEADERS})
target_include_directories(libcapio_cl PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src
${simdjson_SOURCE_DIR}
${nlohmann_json_SOURCE_DIR}/include
)

target_link_libraries(libcapio_cl PUBLIC simdjson)

#####################################
# Install rules
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ At runtime, CAPIO-CL’s parser and engine components analyze, track, and manage
### Requirements & dependencies
- C++17 or greater
- Cmake 3.15 or newer
- [simdjson](https://github.com/simdjson/simdjson) to parse JSON config files
- [nlohmann/json](https://github.com/nlohmann/json) to parse JSON config files
- [GoogleTest](https://github.com/google/googletest) for automated testing

All dependencies are fetched automatically by CMake — no manual setup required.
Expand Down
1 change: 1 addition & 0 deletions bindings/python_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ PYBIND11_MODULE(py_capio_cl, m) {
.def("isDirectory", &capiocl::Engine::isDirectory)
.def("isStoredInMemory", &capiocl::Engine::isStoredInMemory)
.def("isPermanent", &capiocl::Engine::isPermanent)
.def("setAllStoreInMemory", &capiocl::Engine::setAllStoreInMemory)
.def("__str__", &capiocl::Engine::print)
.def("__repr__", [](const capiocl::Engine &e) {
return "<Engine repr at " + std::to_string(reinterpret_cast<uintptr_t>(&e)) + ">";
Expand Down
5 changes: 4 additions & 1 deletion capiocl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ class Engine {
*/
void setStoreFileInMemory(const std::filesystem::path &path);

/// @brief set all files to be stored in memory
void setAllStoreInMemory();

/**
* @brief Store the file on the file system.
*
Expand Down Expand Up @@ -430,7 +433,7 @@ class Parser {
* the config file
*/
static std::tuple<std::string, Engine *> parse(const std::filesystem::path &source,
const std::filesystem::path &resolve_prexix,
const std::filesystem::path &resolve_prexix = "",
bool store_only_in_memory = false);
};
} // namespace capiocl
Expand Down
5 changes: 5 additions & 0 deletions src/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,11 @@ void capiocl::Engine::setStoreFileInMemory(const std::filesystem::path &path) {
this->newFile(path);
std::get<10>(_locations.at(path)) = true;
}
void capiocl::Engine::setAllStoreInMemory() {
for (const auto &[fst, snd] : _locations) {
this->setStoreFileInMemory(fst);
}
}

void capiocl::Engine::setStoreFileInFileSystem(const std::filesystem::path &path) {
this->newFile(path);
Expand Down
Loading
Loading