26 #ifndef CASADI_FILESYSTEM_IMPL_HPP
27 #define CASADI_FILESYSTEM_IMPL_HPP
29 #include "filesystem.hpp"
30 #include "plugin_interface.hpp"
45 Filesystem :
public PluginInterface<Filesystem> {
47 typedef bool (* IsDirectory)(
const std::string& path);
48 typedef bool (* CreateDirectories)(
const std::string& path);
49 typedef bool (* Remove)(
const std::string& path);
50 typedef casadi_int (* RemoveAll)(
const std::string& path);
51 typedef std::string (* Filename)(
const std::string& path);
52 typedef bool (* HasParentPath)(
const std::string& path);
53 typedef std::string (* ParentPath)(
const std::string& path);
54 typedef std::vector<std::string> (* IterateDirectoryNames)(
const std::string& path);
55 typedef std::string (* Absolute)(
const std::string& path);
58 typedef Filesystem* (*Creator)();
60 static const std::string meta_doc;
64 IsDirectory is_directory;
65 CreateDirectories create_directories;
69 HasParentPath has_parent_path;
70 ParentPath parent_path;
71 IterateDirectoryNames iterate_directory_names;
76 static std::map<std::string, Plugin> solvers_;
78 static void assert_enabled();
79 static bool is_directory(
const std::string& path);
80 static bool remove(
const std::string& path);
81 static casadi_int remove_all(
const std::string& path);
82 static std::string filename(
const std::string& path);
83 static bool is_enabled();
84 static bool has_parent_path(
const std::string& path);
85 static std::string parent_path(
const std::string& path);
86 static std::string absolute(
const std::string& path);
87 static bool ensure_directory_exists(
const std::string& path);
88 static bool create_directories(
const std::string& path);
89 static std::vector<std::string> iterate_directory_names(
const std::string& path);
92 static void open(std::ofstream&,
const std::string& path,
93 std::ios_base::openmode mode = std::ios_base::out);
95 static std::ofstream* ofstream_ptr(
const std::string& path,
96 std::ios_base::openmode mode = std::ios_base::out);
98 #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
99 static std::mutex mutex_solvers_;
103 static const std::string infix_;