HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
filesystem.h File Reference

Utilities for dealing with file names and files portably. More...

#include <cstdint>
#include <cstdio>
#include <ctime>
#include <fstream>
#include <mutex>
#include <string>
#include <vector>
#include <OpenImageIO/span.h>
#include <OpenImageIO/export.h>
#include <OpenImageIO/oiioversion.h>
#include <OpenImageIO/string_view.h>
+ Include dependency graph for filesystem.h:

Go to the source code of this file.

Classes

class  Filesystem::IOProxy
 
class  Filesystem::IOFile
 
class  Filesystem::IOVecOutput
 
class  Filesystem::IOMemReader
 IOProxy subclass for reading that wraps an cspan<char>. More...
 

Namespaces

 Filesystem
 Platform-independent utilities for manipulating file names, files, directories, and other file system miscellany.
 

Macros

#define OIIO_FILESYSTEM_SUPPORTS_IOPROXY   1
 

Typedefs

typedef std::ofstream ofstream
 

Functions

OIIO_API std::string Filesystem::filename (const std::string &filepath)
 
OIIO_API std::string Filesystem::extension (const std::string &filepath, bool include_dot=true)
 
OIIO_API std::string Filesystem::parent_path (const std::string &filepath)
 
OIIO_API std::string Filesystem::replace_extension (const std::string &filepath, const std::string &new_extension)
 
OIIO_API void Filesystem::searchpath_split (const std::string &searchpath, std::vector< std::string > &dirs, bool validonly=false)
 
OIIO_API std::string Filesystem::searchpath_find (const std::string &filename, const std::vector< std::string > &dirs, bool testcwd=true, bool recursive=false)
 
OIIO_API bool Filesystem::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 Filesystem::path_is_absolute (const std::string &path, bool dot_is_absolute=false)
 
OIIO_API bool Filesystem::exists (const std::string &path)
 
OIIO_API bool Filesystem::is_directory (const std::string &path)
 
OIIO_API bool Filesystem::is_regular (const std::string &path)
 
OIIO_API bool Filesystem::create_directory (string_view path, std::string &err)
 
bool Filesystem::create_directory (string_view path)
 
OIIO_API bool Filesystem::copy (string_view from, string_view to, std::string &err)
 
bool Filesystem::copy (string_view from, string_view to)
 
OIIO_API bool Filesystem::rename (string_view from, string_view to, std::string &err)
 
bool Filesystem::rename (string_view from, string_view to)
 
OIIO_API bool Filesystem::remove (string_view path, std::string &err)
 
bool Filesystem::remove (string_view path)
 
OIIO_API unsigned long long Filesystem::remove_all (string_view path, std::string &err)
 
unsigned long long Filesystem::remove_all (string_view path)
 
OIIO_API std::string Filesystem::temp_directory_path ()
 
OIIO_API std::string Filesystem::unique_path (string_view model="%%%%-%%%%-%%%%-%%%%")
 
OIIO_API FILE * Filesystem::fopen (string_view path, string_view mode)
 
OIIO_API std::string Filesystem::current_path ()
 
OIIO_API void Filesystem::open (OIIO::ifstream &stream, string_view path, std::ios_base::openmode mode=std::ios_base::in)
 
OIIO_API void Filesystem::open (OIIO::ofstream &stream, string_view path, std::ios_base::openmode mode=std::ios_base::out)
 
OIIO_API bool Filesystem::read_text_file (string_view filename, std::string &str)
 
OIIO_API size_t Filesystem::read_bytes (string_view path, void *buffer, size_t n, size_t pos=0)
 
OIIO_API std::time_t Filesystem::last_write_time (const std::string &path)
 
OIIO_API void Filesystem::last_write_time (const std::string &path, std::time_t time)
 
OIIO_API uint64_t Filesystem::file_size (string_view path)
 
OIIO_API void Filesystem::convert_native_arguments (int argc, const char *argv[])
 
OIIO_API bool Filesystem::enumerate_sequence (string_view desc, std::vector< int > &numbers)
 
OIIO_API bool Filesystem::parse_pattern (const char *pattern, int framepadding_override, std::string &normalized_pattern, std::string &framespec)
 
OIIO_API bool Filesystem::enumerate_file_sequence (const std::string &pattern, const std::vector< int > &numbers, std::vector< std::string > &filenames)
 
OIIO_API bool Filesystem::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 Filesystem::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 Filesystem::scan_for_matching_filenames (const std::string &pattern, std::vector< int > &numbers, std::vector< std::string > &filenames)
 

Variables

OIIO_NAMESPACE_BEGIN typedef
std::ifstream 
ifstream
 

Detailed Description

Utilities for dealing with file names and files portably.

Some helpful nomenclature:

  • "filename" - a file or directory name, relative or absolute
  • "searchpath" - a list of directories separated by ':' or ';'.

Definition in file filesystem.h.

Macro Definition Documentation

#define OIIO_FILESYSTEM_SUPPORTS_IOPROXY   1

Definition at line 66 of file filesystem.h.

Typedef Documentation

typedef std::ofstream ofstream

Definition at line 81 of file filesystem.h.

Variable Documentation

OIIO_NAMESPACE_BEGIN typedef std::ifstream ifstream

Definition at line 80 of file filesystem.h.