Rosetta
|
Classes | |
class | FileName |
File name class supporting Windows and UN*X/Linux format names. More... | |
class | PathName |
Path name class supporting Windows and UN*X/Linux format names. More... | |
Functions | |
bool | file_exists (std::string const &path) |
Does File Exist? More... | |
bool | is_directory (std::string const &path) |
Is the given path a directory? More... | |
int | file_delete (std::string const &path) |
Delete File. More... | |
std::string | file_extension (std::string const &filename) |
Extension of a File Name. More... | |
std::string | file_basename (std::string const &filename) |
Basename of a File Name. More... | |
long | file_size (std::string const &filename) |
Platform independent way of getting file size. More... | |
bool | create_blank_file (std::string const &blank_file) |
Create a blank file if it doesn't already exist. More... | |
std::string | create_temp_filename (std::string const &dir, std::string const &prefix) |
Find an unused random tempfile name with a given prefix (which may include a directory) More... | |
bool | create_directory (std::string const &dir_path) |
Create a directory if it doesn't already exist. More... | |
bool | create_directory_recursive (std::string const &dir_path) |
Create a directory and its parent directories if they doesn't already exist. More... | |
bool | trytry_ifstream_open (std::ifstream &ifstream_, std::string const &name, std::ios_base::openmode open_mode) |
Try to open file a few times just in case it is locked (from BOINC LIB) More... | |
bool | trytry_ofstream_open (std::ofstream &ofstream_, std::string const &name, std::ios_base::openmode open_mode) |
Try to open file a few times just in case it is locked (from BOINC LIB) More... | |
int | list_dir (std::string dir, utility::vector1< std::string > &files) |
FileName | combine_names (utility::vector1< std::string > file_name_strings) |
std::istream & | operator>> (std::istream &stream, FileName &name) |
Input from stream. More... | |
std::ostream & | operator<< (std::ostream &stream, FileName const &name) |
Output to stream. More... | |
bool | char_equali (char c, char d) |
Characters equal case-insensitively? More... | |
bool | equali (std::string const &s, std::string const &t) |
Strings equal case-insensitively? More... | |
bool | operator== (FileName const &name1, FileName const &name2) |
FileName == FileName. More... | |
bool | operator!= (FileName const &name1, FileName const &name2) |
FileName != FileName. More... | |
bool | operator< (FileName const &name1, FileName const &name2) |
FileName < FileName. More... | |
bool | operator<= (FileName const &name1, FileName const &name2) |
FileName <= FileName. More... | |
bool | operator>= (FileName const &name1, FileName const &name2) |
FileName >= FileName. More... | |
bool | operator> (FileName const &name1, FileName const &name2) |
FileName > FileName. More... | |
long | gzip (std::string const &uncompressedfile, bool overwrite) |
gzip: file compression More... | |
long | gunzip (std::string const &compressedfile, bool overwrite) |
gunzip: file decompression More... | |
std::istream & | operator>> (std::istream &stream, PathName &name) |
Input from stream. More... | |
std::ostream & | operator<< (std::ostream &stream, PathName const &name) |
Output to stream. More... | |
bool | operator== (PathName const &name1, PathName const &name2) |
PathName == PathName. More... | |
bool | operator!= (PathName const &name1, PathName const &name2) |
PathName != PathName. More... | |
bool | operator< (PathName const &name1, PathName const &name2) |
PathName < PathName. More... | |
bool | operator<= (PathName const &name1, PathName const &name2) |
PathName <= PathName. More... | |
bool | operator>= (PathName const &name1, PathName const &name2) |
PathName >= PathName. More... | |
bool | operator> (PathName const &name1, PathName const &name2) |
PathName > PathName. More... | |
|
inline |
Characters equal case-insensitively?
Definition at line 156 of file FileName.cc.
Referenced by equali().
FileName utility::file::combine_names | ( | utility::vector1< std::string > | file_name_strings | ) |
Definition at line 497 of file file_sys_util.cc.
References begin.
bool utility::file::create_blank_file | ( | std::string const & | blank_file | ) |
Create a blank file if it doesn't already exist.
Definition at line 218 of file file_sys_util.cc.
References utility::io::oc::cerr, utility::io::oc::cout, trytry_ofstream_open(), and utility_exit.
bool utility::file::create_directory | ( | std::string const & | dir_path | ) |
Create a directory if it doesn't already exist.
Code is based on a discussion on this web site:
http://www.brainbell.com/tutorials/C++/Creating_A_Directory.htm
On non-Windows systems, the permissions are solely determined by the umask. If directory creation is successful, the function returns true.
*** Currently untested on Windows! If you find it works, remove this warning. Thanks. ***
Definition at line 295 of file file_sys_util.cc.
Referenced by create_directory_recursive(), and RunPepSpec().
bool utility::file::create_directory_recursive | ( | std::string const & | dir_path | ) |
Create a directory and its parent directories if they doesn't already exist.
Based on the above create_directory() function. If directory creation is successful or the directory already exists, the function returns true.
*** Currently untested on Windows! If you find it works, remove this warning. Thanks. ***
Definition at line 318 of file file_sys_util.cc.
References create_directory(), utility::file::PathName::name(), utility::file::PathName::parent(), and loops_kic::success.
Referenced by basic::database::find_cache_file(), and write_base_pair_step_to_silent_struct().
std::string utility::file::create_temp_filename | ( | std::string const & | dir, |
std::string const & | prefix | ||
) |
Find an unused random tempfile name with a given prefix (which may include a directory)
Definition at line 237 of file file_sys_util.cc.
References app.surface_docking.surface_docking::dir.
Referenced by basic::database::find_cache_file().
|
inline |
Strings equal case-insensitively?
Definition at line 165 of file FileName.cc.
References char_equali(), and ObjexxFCL::equal().
Referenced by utility::file::PathName::equal(), and utility::file::FileName::equal().
std::string utility::file::file_basename | ( | std::string const & | filename | ) |
Basename of a File Name.
Prefix of a file name.
Definition at line 178 of file file_sys_util.cc.
References utility::filename().
int utility::file::file_delete | ( | std::string const & | path | ) |
Delete File.
Delete file.
Definition at line 131 of file file_sys_util.cc.
References file_exists(), and utility::rand_sleep().
Referenced by basic::database::find_cache_file(), gunzip(), gzip(), and main().
bool utility::file::file_exists | ( | std::string const & | path | ) |
Does File Exist?
Does file exist?
Definition at line 89 of file file_sys_util.cc.
References utility::Inline_File_Provider::file_exists(), and utility::SingletonBase< Inline_File_Provider >::get_instance().
Referenced by composite_sequences_from_cmd_line(), file_delete(), file_size(), filter_combine_long_loop(), basic::database::find_cache_file(), basic::database::full_name(), utility::io::get_lines_from_file_data(), gunzip(), gzip(), import_and_dump_pdb(), main(), utility::io::ozstream::open_append_if_existed(), poses_from_cmd_line(), sequences_from_cmd_line(), swa_rna_cluster(), trytry_ifstream_open(), trytry_ofstream_open(), and write_base_pair_step_to_silent_struct().
std::string utility::file::file_extension | ( | std::string const & | filename | ) |
Extension of a File Name.
Extension of a file name.
Definition at line 153 of file file_sys_util.cc.
Referenced by basic::resource_manager::locator::FileStream::FileStream(), gunzip(), gzip(), utility::io::izstream::open(), utility::io::ozstream::open(), and utility::io::ozstream::open_append().
long utility::file::file_size | ( | std::string const & | filename | ) |
Platform independent way of getting file size.
File size.
Definition at line 193 of file file_sys_util.cc.
References utility::io::oc::cerr, end, tools.CppParser::file_, file_exists(), and trytry_ifstream_open().
Referenced by gzip().
long utility::file::gunzip | ( | std::string const & | compressedfile, |
bool | overwrite | ||
) |
gunzip: file decompression
Definition at line 139 of file gzip_util.cc.
References utility::io::oc::cerr, utility::io::oc::cout, file_delete(), file_exists(), file_extension(), utility::io::ocstream::rdbuf(), and trytry_ofstream_open().
long utility::file::gzip | ( | std::string const & | uncompressedfile, |
bool | overwrite | ||
) |
gzip: file compression
Definition at line 42 of file gzip_util.cc.
References utility::io::oc::cerr, utility::io::oc::cout, file_delete(), file_exists(), file_extension(), file_size(), utility::io::ocstream::rdbuf(), and trytry_ifstream_open().
Referenced by utility::exit(), and main().
bool utility::file::is_directory | ( | std::string const & | path | ) |
Is the given path a directory?
Is the file a directory?
Definition at line 119 of file file_sys_util.cc.
References S_ISDIR.
Referenced by trytry_ifstream_open().
int utility::file::list_dir | ( | std::string | dir, |
utility::vector1< std::string > & | files | ||
) |
Definition at line 462 of file file_sys_util.cc.
bool utility::file::operator!= | ( | PathName const & | name1, |
PathName const & | name2 | ||
) |
Definition at line 243 of file PathName.hh.
References utility::file::PathName::equal().
bool utility::file::operator!= | ( | FileName const & | name1, |
FileName const & | name2 | ||
) |
Definition at line 423 of file FileName.hh.
References utility::file::FileName::equal().
bool utility::file::operator< | ( | PathName const & | name1, |
PathName const & | name2 | ||
) |
Definition at line 253 of file PathName.hh.
bool utility::file::operator< | ( | FileName const & | name1, |
FileName const & | name2 | ||
) |
Definition at line 433 of file FileName.hh.
std::ostream& utility::file::operator<< | ( | std::ostream & | stream, |
FileName const & | name | ||
) |
Output to stream.
Definition at line 87 of file FileName.cc.
References utility::file::FileName::name().
std::ostream& utility::file::operator<< | ( | std::ostream & | stream, |
PathName const & | name | ||
) |
Output to stream.
Definition at line 103 of file PathName.cc.
References utility::file::PathName::name().
bool utility::file::operator<= | ( | PathName const & | name1, |
PathName const & | name2 | ||
) |
Definition at line 263 of file PathName.hh.
bool utility::file::operator<= | ( | FileName const & | name1, |
FileName const & | name2 | ||
) |
Definition at line 443 of file FileName.hh.
bool utility::file::operator== | ( | PathName const & | name1, |
PathName const & | name2 | ||
) |
Definition at line 233 of file PathName.hh.
References utility::file::PathName::equal().
bool utility::file::operator== | ( | FileName const & | name1, |
FileName const & | name2 | ||
) |
Definition at line 413 of file FileName.hh.
References utility::file::FileName::equal().
bool utility::file::operator> | ( | PathName const & | name1, |
PathName const & | name2 | ||
) |
Definition at line 283 of file PathName.hh.
bool utility::file::operator> | ( | FileName const & | name1, |
FileName const & | name2 | ||
) |
Definition at line 463 of file FileName.hh.
bool utility::file::operator>= | ( | PathName const & | name1, |
PathName const & | name2 | ||
) |
Definition at line 273 of file PathName.hh.
bool utility::file::operator>= | ( | FileName const & | name1, |
FileName const & | name2 | ||
) |
Definition at line 453 of file FileName.hh.
std::istream& utility::file::operator>> | ( | std::istream & | stream, |
FileName & | name | ||
) |
Input from stream.
Definition at line 76 of file FileName.cc.
References utility::file::FileName::assign().
std::istream& utility::file::operator>> | ( | std::istream & | stream, |
PathName & | name | ||
) |
Input from stream.
Definition at line 92 of file PathName.cc.
References utility::file::PathName::assign().
bool utility::file::trytry_ifstream_open | ( | std::ifstream & | ifstream_, |
std::string const & | name, | ||
std::ios_base::openmode | open_mode | ||
) |
Try to open file a few times just in case it is locked (from BOINC LIB)
Try to open file for read a few times just in case it is locked (from BOINC LIB)
Definition at line 337 of file file_sys_util.cc.
References file_exists(), is_directory(), and utility::rand_sleep().
Referenced by file_size(), gzip(), utility::io::izstream::open(), and utility::io::izstream::open_ifstream().
bool utility::file::trytry_ofstream_open | ( | std::ofstream & | ofstream_, |
std::string const & | name, | ||
std::ios_base::openmode | open_mode | ||
) |
Try to open file a few times just in case it is locked (from BOINC LIB)
Try to open file for write a few times just in case it is locked (from BOINC LIB)
Definition at line 404 of file file_sys_util.cc.
References file_exists(), and utility::rand_sleep().
Referenced by create_blank_file(), gunzip(), utility::io::ozstream::open(), and utility::io::ozstream::open_append().