|
STIR 6.4.0
|
#include "stir/FilePath.h"
Public Member Functions | |
| FilePath (const std::string &__str, bool _run_checks=true) | |
FilePath If the initial path exists in the disk _check should be left true. It will check that the path is writable If you want to initialize to an arbitary string then set _run_checks false. | |
| bool | is_directory () const |
| Returns true if my_string points to a directory. | |
| bool | is_regular_file () const |
Returns true if my_string points to a regular file Returns true if the path is writable. | |
| bool | is_writable () const |
| On Windows the attribute INVALID_FILE_ATTRIBUTES is used. Which is not quite the same. | |
| FilePath | append (const FilePath &p) |
| Create a new folder,by FilePath, and return its path as FilePath. | |
| FilePath | append (const std::string &p) |
| Create a new folder,by string, and return its path. | |
| void | prepend_directory_name (const std::string &p) |
If path is no absolute then prepend the p string. | |
| void | add_extension (const std::string &e) |
Append extension e if none is present. | |
| void | replace_extension (const std::string &e) |
| Replace extension. | |
| std::string | get_path () const |
| Get path from string. | |
| std::string | get_path_only () const |
| Get the path from string. If no path in string returns empty string. | |
| std::string | get_filename () const |
| Get only the filename An inherent functionality from utilities is that on Windows all separators will be checked. | |
| std::string | get_filename_no_extension () const |
| Convinience function which returns the filename withouth the extension. | |
| std::string | get_extension () const |
| Get the extension of the filename. | |
| std::string | get_as_string () const |
| Return the current full string. | |
| std::string | get_string () const |
| bool | operator== (const FilePath &other) |
| bool | operator== (const std::string &other) |
| void | operator= (const FilePath &other) |
| void | operator= (const std::string &other) |
The FilePath class.
The old pathname operations are supported.
| bool stir::FilePath::is_regular_file | ( | ) | const |
Returns true if my_string points to a regular file Returns true if the path is writable.
References stir::error(), stir::info(), is_regular_file(), and my_string.
Referenced by append(), and is_regular_file().
| FilePath stir::FilePath::append | ( | const std::string & | p | ) |
Create a new folder,by string, and return its path.
This functions creates appends path p to my_string. It supports multiple new folder levels.It will try to avoid errors as permissions and non existing root path.
References append(), append_separator(), stir::error(), exists(), get_path(), is_directory(), is_regular_file(), is_writable(), my_string, separator, and stir::warning().
|
inline |
References my_string.