A collection of miscellaneous filesystem-type utilities. More...
#include <vul_file.h>
Static Public Member Functions | |
static vcl_string | get_cwd () |
Return current working directory. | |
static bool | change_directory (char const *dirname) |
change current working directory. | |
static bool | change_directory (vcl_string const &dirname) |
static bool | make_directory (char const *filename) |
Make a writable directory. | |
static bool | make_directory (vcl_string const &filename) |
static bool | make_directory_path (char const *filename) |
Make a writable directory, including any necessary parents. | |
static bool | make_directory_path (vcl_string const &filename) |
static bool | is_directory (char const *filename) |
Return true iff filename is a directory. | |
static bool | is_directory (const vcl_string &filename) |
static vcl_string | expand_tilde (char const *filename) |
Expand any leading ~ escapes in filename. | |
static vcl_string | expand_tilde (vcl_string const &filename) |
static bool | exists (char const *filename) |
Return true iff filename exists. It may be any sort of file. | |
static bool | exists (vcl_string const &filename) |
static unsigned long | size (char const *filename) |
Return size of vul_file. | |
static unsigned long | size (vcl_string filename) |
static vcl_string | dirname (char const *filename) |
Return dirname. | |
static vcl_string | dirname (vcl_string const &filename) |
static vcl_string | extension (char const *filename) |
Return extension (including the '. | |
static vcl_string | extension (vcl_string const &filename) |
static vcl_string | basename (char const *filename, char const *suffix=0) |
Return basename. | |
static vcl_string | basename (vcl_string const &filename, char const *suffix=0) |
static vcl_string | strip_directory (char const *filename) |
Strips away directory of the filename. | |
static vcl_string | strip_directory (vcl_string const &filename) |
static vcl_string | strip_extension (char const *filename) |
Strips away extension of the filename. | |
static vcl_string | strip_extension (vcl_string const &filename) |
static bool | delete_file_glob (vcl_string const &file_glob) |
Delete 1 or more files using the Local OS preferred globbing. | |
static bool | delete_file_glob (char const *file_glob) |
A collection of miscellaneous filesystem-type utilities.
Definition at line 26 of file vul_file.h.
vcl_string vul_file::basename | ( | char const * | filename, |
char const * | suffix = 0 |
||
) | [static] |
static vcl_string vul_file::basename | ( | vcl_string const & | filename, |
char const * | suffix = 0 |
||
) | [inline, static] |
Definition at line 97 of file vul_file.h.
bool vul_file::change_directory | ( | char const * | dirname | ) | [static] |
change current working directory.
Definition at line 55 of file vul_file.cxx.
static bool vul_file::change_directory | ( | vcl_string const & | dirname | ) | [inline, static] |
Definition at line 33 of file vul_file.h.
bool vul_file::delete_file_glob | ( | vcl_string const & | file_glob | ) | [static] |
Delete 1 or more files using the Local OS preferred globbing.
E.g. delete_file_glob
("*"); will delete all the files in the current directory on most operating systems.
E.g. delete_file_glob
("*"); will delete all the files in the current directory on most operating systems. Takes Posix path separators i.e. '/'
Definition at line 230 of file vul_file.cxx.
static bool vul_file::delete_file_glob | ( | char const * | file_glob | ) | [inline, static] |
Definition at line 116 of file vul_file.h.
vcl_string vul_file::dirname | ( | char const * | filename | ) | [static] |
Return dirname.
Definition at line 131 of file vul_file.cxx.
static vcl_string vul_file::dirname | ( | vcl_string const & | filename | ) | [inline, static] |
Definition at line 84 of file vul_file.h.
bool vul_file::exists | ( | char const * | filename | ) | [static] |
Return true iff filename exists. It may be any sort of file.
Definition at line 115 of file vul_file.cxx.
static bool vul_file::exists | ( | vcl_string const & | filename | ) | [inline, static] |
Definition at line 74 of file vul_file.h.
vcl_string vul_file::expand_tilde | ( | char const * | filename | ) | [static] |
Expand any leading ~ escapes in filename.
Definition at line 243 of file vul_file.cxx.
static vcl_string vul_file::expand_tilde | ( | vcl_string const & | filename | ) | [inline, static] |
Definition at line 68 of file vul_file.h.
vcl_string vul_file::extension | ( | char const * | filename | ) | [static] |
static vcl_string vul_file::extension | ( | vcl_string const & | filename | ) | [inline, static] |
Definition at line 90 of file vul_file.h.
vcl_string vul_file::get_cwd | ( | ) | [static] |
Return current working directory.
Definition at line 45 of file vul_file.cxx.
bool vul_file::is_directory | ( | char const * | filename | ) | [static] |
Return true iff filename is a directory.
Definition at line 69 of file vul_file.cxx.
static bool vul_file::is_directory | ( | const vcl_string & | filename | ) | [inline, static] |
Definition at line 54 of file vul_file.h.
bool vul_file::make_directory | ( | char const * | filename | ) | [static] |
Make a writable directory.
You might imagine mkdir would be a better name, and then you might imagine a world w/out ms.
Definition at line 60 of file vul_file.cxx.
static bool vul_file::make_directory | ( | vcl_string const & | filename | ) | [inline, static] |
Definition at line 41 of file vul_file.h.
bool vul_file::make_directory_path | ( | char const * | filename | ) | [static] |
Make a writable directory, including any necessary parents.
Returns true if successful, or if the directory already exists.
Returns true if successful, or if the directory already exists. Implemented by calling itself recursively on the parent directory.
Definition at line 90 of file vul_file.cxx.
static bool vul_file::make_directory_path | ( | vcl_string const & | filename | ) | [inline, static] |
Definition at line 48 of file vul_file.h.
unsigned long vul_file::size | ( | char const * | filename | ) | [static] |
Return size of vul_file.
Definition at line 106 of file vul_file.cxx.
static unsigned long vul_file::size | ( | vcl_string | filename | ) | [inline, static] |
Definition at line 80 of file vul_file.h.
vcl_string vul_file::strip_directory | ( | char const * | filename | ) | [static] |
Strips away directory of the filename.
Definition at line 158 of file vul_file.cxx.
static vcl_string vul_file::strip_directory | ( | vcl_string const & | filename | ) | [inline, static] |
Definition at line 103 of file vul_file.h.
vcl_string vul_file::strip_extension | ( | char const * | filename | ) | [static] |
Strips away extension of the filename.
Definition at line 173 of file vul_file.cxx.
static vcl_string vul_file::strip_extension | ( | vcl_string const & | filename | ) | [inline, static] |
Definition at line 108 of file vul_file.h.