OpenStudio:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Functions
openstudio::filesystem Namespace Reference

Functions

bool copy_file_no_throw (const openstudio::path &t_src, const openstudio::path &t_dest)
 Copies file from src to dest. If there is an error, false is returned. More...
 
openstudio::path create_temporary_directory (const openstudio::path &base_name)
 Creates a new temporary directory in the form of "/systemtemppath/{base_name}-id" where id is unique identifier determined by the runtime. More...
 
std::vector< openstudio::pathdirectory_directories (const openstudio::path &t_path)
 Returns all dir paths (non recursively) in the directory t_path. More...
 
std::vector< openstudio::pathdirectory_files (const openstudio::path &t_path)
 Returns all file paths (non recursively) in the directory t_path. More...
 
openstudio::path home_path ()
 Returns the current user's home path. More...
 
time_t last_write_time_as_time_t (const openstudio::path &t_path)
 
std::vector< char > read (openstudio::filesystem::ifstream &t_path)
 reads entire file from the current read position until the end of file and returns as std::vector<char> More...
 
std::vector< char > read (const openstudio::path &t_path)
 reads entire file from the current read position until the end of file and returns as std::vector<char> More...
 
std::string read_as_string (openstudio::filesystem::ifstream &t_file)
 reads entire file from the current read position until the end of file and returns as std::string More...
 
std::string read_as_string (const openstudio::path &t_path)
 reads entire file from the current read position until the end of file and returns as std::string More...
 
std::vector< openstudio::pathrecursive_directory_files (const openstudio::path &t_path)
 Returns all file paths (recursively) in the directory t_path. More...
 

Function Documentation

bool openstudio::filesystem::copy_file_no_throw ( const openstudio::path t_src,
const openstudio::path t_dest 
)

Copies file from src to dest. If there is an error, false is returned.

openstudio::path openstudio::filesystem::create_temporary_directory ( const openstudio::path base_name)

Creates a new temporary directory in the form of "/systemtemppath/{base_name}-id" where id is unique identifier determined by the runtime.

Returns
path created or empty path if creation failed
std::vector<openstudio::path> openstudio::filesystem::directory_directories ( const openstudio::path t_path)

Returns all dir paths (non recursively) in the directory t_path.

Result values are relative to t_path

std::vector<openstudio::path> openstudio::filesystem::directory_files ( const openstudio::path t_path)

Returns all file paths (non recursively) in the directory t_path.

Result values are relative to t_path

openstudio::path openstudio::filesystem::home_path ( )

Returns the current user's home path.

time_t openstudio::filesystem::last_write_time_as_time_t ( const openstudio::path t_path)
std::vector<char> openstudio::filesystem::read ( openstudio::filesystem::ifstream &  t_path)

reads entire file from the current read position until the end of file and returns as std::vector<char>

std::vector<char> openstudio::filesystem::read ( const openstudio::path t_path)

reads entire file from the current read position until the end of file and returns as std::vector<char>

std::string openstudio::filesystem::read_as_string ( openstudio::filesystem::ifstream &  t_file)

reads entire file from the current read position until the end of file and returns as std::string

std::string openstudio::filesystem::read_as_string ( const openstudio::path t_path)

reads entire file from the current read position until the end of file and returns as std::string

std::vector<openstudio::path> openstudio::filesystem::recursive_directory_files ( const openstudio::path t_path)

Returns all file paths (recursively) in the directory t_path.

Result values are relative to t_path