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_GC=ON.");
116 std::ios_base::openmode mode) {
119 "Unable to create the required directory for '" +
filename +
"'.");
121 stream.open(
filename.c_str(), mode);
123 casadi_assert(stream.good(),
124 "Error opening stream '" +
filename +
"'.");
126 casadi_assert(stream.good(),
127 "Error opening stream '" +
filename +
"'. "
128 "Does the directory exits? "
129 "Note that CasADi needs to be compiled with WITH_GC=ON "
130 "for directories to be automatically created");
135 std::ios_base::openmode mode) {
136 std::ofstream* ret =
new std::ofstream();
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 bool remove(const std::string &path)
static void open(std::ofstream &, const std::string &path, std::ios_base::openmode mode=std::ios_base::out)
static std::vector< std::string > iterate_directory_names(const std::string &path)
static std::ofstream * ofstream_ptr(const std::string &path, std::ios_base::openmode mode=std::ios_base::out)
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::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)