Wildmeshing Toolkit
Loading...
Searching...
No Matches
export_cache.cpp
Go to the documentation of this file.
1
#include "
export_cache.hpp
"
2
3
#include <
wmtk/components/utils/resolve_path.hpp
>
4
#include <
wmtk/utils/Logger.hpp
>
5
6
#include "
ExportCacheOptions.hpp
"
7
8
namespace
wmtk::components
{
9
10
void
export_cache
(
const
utils::Paths& paths,
const
nlohmann::json& j,
io::Cache
& cache)
11
{
12
using namespace
internal
;
13
14
ExportCacheOptions
options = j.get<
ExportCacheOptions
>();
15
16
std::string export_location =
17
wmtk::utils::resolve_path(options.
folder
.string(), paths.root_path);
18
19
if
(std::filesystem::exists(export_location)) {
20
log_and_throw_error
(
"Cannot export cache, folder {} already exists"
, export_location);
21
}
22
23
if
(!cache.
export_cache
(export_location)) {
24
log_and_throw_error
(
"Could not export cache from {}"
, export_location);
25
}
26
}
27
}
// namespace wmtk::components
ExportCacheOptions.hpp
Logger.hpp
wmtk::io::Cache
Definition
Cache.hpp:13
wmtk::io::Cache::export_cache
bool export_cache(const std::filesystem::path &export_location)
Export the cache to the given location.
Definition
Cache.cpp:232
export_cache.hpp
internal
Definition
local_switch_tuple.hpp:11
wmtk::components
Definition
bicubic_interpolation.cpp:5
wmtk::components::export_cache
void export_cache(const utils::Paths &paths, const nlohmann::json &j, io::Cache &cache)
Definition
export_cache.cpp:10
wmtk::log_and_throw_error
void log_and_throw_error(const std::string &msg)
Definition
Logger.cpp:101
resolve_path.hpp
wmtk::components::internal::ExportCacheOptions
Definition
ExportCacheOptions.hpp:12
wmtk::components::internal::ExportCacheOptions::folder
std::filesystem::path folder
Definition
ExportCacheOptions.hpp:13
components
export_cache
wmtk
components
export_cache
export_cache.cpp
Generated by
1.9.8