Functions | |
void | clear_error (void) |
void | set_error (const std::string &msg) |
const std::string & | get_error (void) |
Returns the last error message set by a utils:: function. | |
std::string | add_slash (const std::string &filename) |
Returns filename with an appended '/'. More... | |
void | to_upper (std::string &str) |
Converts each character in str to upper case. More... | |
std::string | to_upper (const std::string &str) |
Returns str with each character in str capitalized. | |
bool | stricmp (const std::string &a, const std::string &b) |
Case insensitive string compare. More... | |
bool | check_extension (const std::string &file, const std::string &ext) |
Checks if file ends with the extension ext. More... | |
std::string | trim (const std::string &str) |
Returns str with all white space removed from the front of the string . | |
std::string | rtrim (const std::string &str) |
Returns str with all white space removed from the end of the string . | |
template<class T> std::istream & | read (std::istream &stream, T &in) |
Templated binary stream read. More... | |
template<class T> std::ostream & | write (std::ostream &stream, const T &out) |
Templated binary stream write. More... | |
bool | mkdir (const std::string &filename) |
Creates the directory filename. More... | |
bool | exists (const std::string &filename) |
Checks if filename exists. More... | |
bool | can_read (const std::string &filename) |
Checks if filename can be read. More... | |
bool | is_dir (const std::string &filename) |
Checks if filename is a directory. More... | |
bool | is_link (const std::string &filename) |
Checks if filename is a link. More... | |
bool | chdir (const std::string &filename) |
Changes the current directory to filename. More... | |
std::string | get_valid_absolute_dir (const std::string &filename) |
Returns a string describing a valid abosolute directory. More... | |
std::string | get_absolute_dir (const std::string &filename) |
Returns a cleaned version of the directory filename. More... | |
std::string | get_filename (const std::string &filename) |
Returns the filename (basename) of the filename. More... | |
Variables | |
std::string | error |
Some utility function may set an error message. This error message can be accessed with utils::get_error( ).
|
Returns filename with an appended '/'.
Returns the |
|
Checks if filename can be read.
|
|
Changes the current directory to filename.
|
|
Checks if file ends with the extension ext.
|
|
Checks if filename exists.
|
|
Returns a cleaned version of the directory filename.
This function returns a "clean" absolute directory
|
|
Returns the filename (basename) of the filename.
This function returns the basename of filename. For example, an input of |
|
Returns a This function returns a valid absolute directory. If filename is a plain file, then the directory in which filename resides is returned. This method correctly accounts for "." and "..". "//" is treated as "/./".
|
|
Checks if filename is a directory.
|
|
Checks if filename is a link.
|
|
Creates the directory filename.
|
|
Templated binary stream read.
This function will read
|
|
Case insensitive string compare.
|
|
Converts each character in str to upper case.
|
|
Templated binary stream write.
This function will write
|