Platform-independent utilities for manipulating file names, files, directories, and other file system miscellany.
More...
|
OIIO_API std::string | filename (const std::string &filepath) noexcept |
|
OIIO_API std::string | extension (const std::string &filepath, bool include_dot=true) noexcept |
|
OIIO_API std::string | parent_path (const std::string &filepath) noexcept |
|
OIIO_API std::string | replace_extension (const std::string &filepath, const std::string &new_extension) noexcept |
|
OIIO_API std::string | generic_filepath (string_view filepath) noexcept |
| Return the filepath in generic format, not any OS-specific conventions. More...
|
|
OIIO_API void | searchpath_split (const std::string &searchpath, std::vector< std::string > &dirs, bool validonly=false) |
|
OIIO_API std::string | searchpath_find (const std::string &filename, const std::vector< std::string > &dirs, bool testcwd=true, bool recursive=false) |
|
OIIO_API bool | get_directory_entries (const std::string &dirname, std::vector< std::string > &filenames, bool recursive=false, const std::string &filter_regex=std::string()) |
|
OIIO_API bool | path_is_absolute (string_view path, bool dot_is_absolute=false) |
|
OIIO_API bool | exists (string_view path) noexcept |
|
OIIO_API bool | is_directory (string_view path) noexcept |
|
OIIO_API bool | is_regular (string_view path) noexcept |
|
OIIO_API bool | create_directory (string_view path, std::string &err) |
|
bool | create_directory (string_view path) |
|
OIIO_API bool | copy (string_view from, string_view to, std::string &err) |
|
bool | copy (string_view from, string_view to) |
|
OIIO_API bool | rename (string_view from, string_view to, std::string &err) |
|
bool | rename (string_view from, string_view to) |
|
OIIO_API bool | remove (string_view path, std::string &err) |
|
bool | remove (string_view path) |
|
OIIO_API unsigned long long | remove_all (string_view path, std::string &err) |
|
unsigned long long | remove_all (string_view path) |
|
OIIO_API std::string | temp_directory_path () |
|
OIIO_API std::string | unique_path (string_view model="%%%%-%%%%-%%%%-%%%%") |
|
OIIO_API FILE * | fopen (string_view path, string_view mode) |
|
OIIO_API int | fseek (FILE *file, int64_t offset, int whence) |
| Version of fseek that works with 64 bit offsets on all systems. More...
|
|
OIIO_API int64_t | ftell (FILE *file) |
| Version of ftell that works with 64 bit offsets on all systems. More...
|
|
OIIO_API std::string | current_path () |
|
OIIO_API void | open (OIIO::ifstream &stream, string_view path, std::ios_base::openmode mode=std::ios_base::in) |
|
OIIO_API void | open (OIIO::ofstream &stream, string_view path, std::ios_base::openmode mode=std::ios_base::out) |
|
OIIO_API int | open (string_view path, int flags) |
|
OIIO_API bool | read_text_file (string_view filename, std::string &str) |
|
OIIO_API bool | write_text_file (string_view filename, string_view str) |
|
OIIO_API size_t | read_bytes (string_view path, void *buffer, size_t n, size_t pos=0) |
|
OIIO_API std::time_t | last_write_time (string_view path) noexcept |
|
OIIO_API void | last_write_time (string_view path, std::time_t time) noexcept |
|
OIIO_API uint64_t | file_size (string_view path) noexcept |
|
OIIO_API void | convert_native_arguments (int argc, const char *argv[]) |
|
OIIO_API bool | enumerate_sequence (string_view desc, std::vector< int > &numbers) |
|
OIIO_API bool | parse_pattern (const char *pattern, int framepadding_override, std::string &normalized_pattern, std::string &framespec) |
|
OIIO_API bool | enumerate_file_sequence (const std::string &pattern, const std::vector< int > &numbers, std::vector< std::string > &filenames) |
|
OIIO_API bool | enumerate_file_sequence (const std::string &pattern, const std::vector< int > &numbers, const std::vector< string_view > &views, std::vector< std::string > &filenames) |
|
OIIO_API bool | scan_for_matching_filenames (const std::string &pattern, const std::vector< string_view > &views, std::vector< int > &frame_numbers, std::vector< string_view > &frame_views, std::vector< std::string > &filenames) |
|
OIIO_API bool | scan_for_matching_filenames (const std::string &pattern, std::vector< int > &numbers, std::vector< std::string > &filenames) |
|
Platform-independent utilities for manipulating file names, files, directories, and other file system miscellany.
Given a normalized pattern (such as "foo_%V.%04d.tif") and a list of frame numbers, generate a list of filenames. "views" is list of per-frame views, or empty. In each frame filename, "%V" is replaced with the view, and "%v" is replaced with the first character of the view.
Return true upon success, false if the description was too malformed to generate a sequence.
Given a pattern (such as "foo.#.tif" or "bar.1-10#.exr"), return a normalized pattern in printf format (such as "foo.%04d.tif") and a framespec (such as "1-10").
If framepadding_override is > 0, it overrides any specific padding amount in the original pattern.
Return true upon success, false if the description was too malformed to generate a sequence.
Find the first instance of a filename existing in a vector of directories, returning the full path as a string. If the file is not found in any of the listed directories, return an empty string. If the filename is absolute, the directory list will not be used. If testcwd is true, "." will be tested before the searchpath; otherwise, "." will only be tested if it's explicitly in dirs. If recursive is true, the directories will be searched recursively, finding a matching file in any subdirectory of the directories listed in dirs; otherwise.