26 #include "filesystem_impl.hpp"
32 #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
33 std::mutex Filesystem::mutex_solvers_;
89 "This action requires advanced filesystem access. Compile CasADi with WITH_GHC_FILESYSTEM=ON.");
116 std::ios_base::openmode mode) {
119 "Unable to create the required directory for '" +
path +
"'.");
123 casadi_assert(stream_ptr,
124 "Error opening stream '" +
path +
"'.");
126 casadi_assert(stream_ptr,
127 "Error opening stream '" +
path +
"'. "
128 "Does the directory exits? "
129 "Note that CasADi needs to be compiled with WITH_GHC_FILESYSTEM=ON "
130 "for directories to be automatically created");
136 std::ios_base::openmode mode,
bool fail) {
139 casadi_error(
"Could not open '" +
path +
"'.");
146 return static_cast<bool>(ret);
static bool has_parent_path(const std::string &path)
static casadi_int remove_all(const std::string &path)
static std::string absolute(const std::string &path)
static const std::string infix_
Infix.
static std::string parent_path(const std::string &path)
static std::string filename(const std::string &path)
static std::map< std::string, Plugin > solvers_
Collection of solvers.
static bool is_directory(const std::string &path)
static bool create_directories(const std::string &path)
static bool ensure_directory_exists(const std::string &path)
static std::unique_ptr< std::ostream > ofstream_ptr(const std::string &path, std::ios_base::openmode mode=std::ios_base::out)
static std::unique_ptr< std::istream > ifstream_ptr(const std::string &path, std::ios_base::openmode mode=std::ios_base::in, bool fail=true)
static bool exists(const std::string &path)
static bool remove(const std::string &path)
static std::vector< std::string > iterate_directory_names(const std::string &path)
static void assert_enabled()
static bool has_plugin(const std::string &pname, bool verbose=false)
Check if a plugin is available or can be loaded.
static Plugin & getPlugin(const std::string &pname)
Load and get the creator function.
static Plugin load_plugin(const std::string &pname, bool register_plugin=true, bool needs_lock=true)
Load a plugin dynamically.
void load_filesystem(const std::string &name)
Explicitly load a plugin dynamically.
bool has_filesystem(const std::string &name)
Check if a particular plugin is available.
std::unique_ptr< std::istream > ifstream_compat(const std::string &utf8_path, std::ios::openmode mode)
std::unique_ptr< std::ostream > ofstream_compat(const std::string &utf8_path, std::ios::openmode mode)
std::string doc_filesystem(const std::string &name)
Get the documentation string for a plugin.
std::vector< casadi_int > path(const std::vector< casadi_int > &map, casadi_int i_start)
std::string filename(const std::string &path)