27 #include <ghc/filesystem.hpp>
32 return ghc::filesystem::is_directory(
path);
36 return ghc::filesystem::create_directories(
path);
40 std::vector<std::string> ret;
41 for (
const auto& entry : ghc::filesystem::directory_iterator(
path)) {
42 ret.push_back(entry.path().string());
48 return ghc::filesystem::remove(
path);
52 return ghc::filesystem::remove_all(
path);
56 return ghc::filesystem::path(
path).filename().string();
60 return ghc::filesystem::absolute(ghc::filesystem::path(
path)).string();
64 return ghc::filesystem::path(
path).parent_path().string();
68 return ghc::filesystem::path(
path).has_parent_path();
72 int CASADI_FILESYSTEM_GHC_EXPORT
76 plugin->version = CASADI_VERSION;
79 plugin->exposed.remove = &
remove;
81 plugin->exposed.filename = &
filename;
85 plugin->exposed.absolute = &
absolute;
static const std::string meta_doc
A documentation string.
static void registerPlugin(const Plugin &plugin, bool needs_lock=true)
Register an integrator in the factory.
int CASADI_FILESYSTEM_GHC_EXPORT casadi_register_filesystem_ghc(Filesystem::Plugin *plugin)
std::string parent_path(const std::string &path)
std::vector< std::string > iterate_directory_names(const std::string &path)
void CASADI_FILESYSTEM_GHC_EXPORT casadi_load_filesystem_ghc()
std::string absolute(const std::string &path)
bool create_directories(const std::string &path)
bool has_parent_path(const std::string &path)
casadi_int remove_all(const std::string &path)
bool remove(const std::string &path)
std::vector< casadi_int > path(const std::vector< casadi_int > &map, casadi_int i_start)
bool is_directory(const std::string &path)
std::string filename(const std::string &path)