44 #ifndef OPENIMAGEIO_FILESYSTEM_H
45 #define OPENIMAGEIO_FILESYSTEM_H
65 namespace Filesystem {
69 OIIO_API std::string filename (
const std::string &filepath);
73 OIIO_API std::string extension (
const std::string &filepath,
74 bool include_dot=
true);
77 inline std::string file_extension (
const std::string &filepath) {
78 return extension (filepath,
false);
84 OIIO_API std::string parent_path (
const std::string &filepath);
89 OIIO_API std::string replace_extension (
const std::string &filepath,
90 const std::string &new_extension);
97 OIIO_API
void searchpath_split (
const std::string &searchpath,
98 std::vector<std::string> &dirs,
99 bool validonly =
false);
110 OIIO_API std::string searchpath_find (
const std::string &filename,
111 const std::vector<std::string> &dirs,
113 bool recursive =
false);
122 OIIO_API
bool get_directory_entries (
const std::string &dirname,
123 std::vector<std::string> &filenames,
124 bool recursive =
false,
125 const std::string &filter_regex=std::string());
129 OIIO_API
bool path_is_absolute (
const std::string &path,
130 bool dot_is_absolute=
false);
134 OIIO_API
bool exists (
const std::string &path);
139 OIIO_API
bool is_directory (
const std::string &path);
143 OIIO_API
bool is_regular (
const std::string &path);
147 OIIO_API FILE *fopen (
const std::string &path,
148 const std::string &mode);
152 OIIO_API
void open (std::ifstream &stream,
153 const std::string &path,
154 std::ios_base::openmode mode = std::ios_base::in);
158 OIIO_API
void open (std::ofstream &stream,
159 const std::string &path,
160 std::ios_base::openmode mode = std::ios_base::out);
164 OIIO_API std::time_t last_write_time (
const std::string& path);
168 OIIO_API
void last_write_time (
const std::string& path, std::time_t time);
172 OIIO_API
void convert_native_arguments (
int argc,
const char *argv[]);
179 #endif // OPENIMAGEIO_FILESYSTEM_H