![]() |
Max OS 0.3
|
Handles file & directory paths. More...
#include <path.h>
Static Public Member Functions | |
| static bool | valid (const string &path) |
| Check if a path is valid. | |
| static bool | is_file (const string &path) |
| Check if a path is a file. | |
| static string | file_name (const string &path) |
| Get the file name component of a path if it exists or an empty string. | |
| static string | file_extension (const string &path) |
| Try to get the file extension from a path (assumes split by ".") | |
| static string | file_path (const string &path) |
| Finds the path to the directory the file is in. | |
| static string | top_directory (const string &path) |
| Get the top directory of a path. | |
| static string | parent_directory (const string &path) |
| Get the parent directory of the path. | |
| static string | absolute_path (const string &path) |
| Calculates path with out any "../" or "./". | |
| static string | join_path (const string &base, const string &extended) |
| Joins two paths together. | |
Calculates path with out any "../" or "./".
| path | The path |
Definition at line 170 of file path.cpp.
References absolute_path(), and is_file().
Referenced by absolute_path(), MaxOS::filesystem::VFSResourceRegistry::create_resource(), and MaxOS::filesystem::VFSResourceRegistry::get_resource().
Try to get the file extension from a path (assumes split by ".")
| path | The path to get the file extension from |
Definition at line 77 of file path.cpp.
References file_extension().
Referenced by file_extension(), and is_file().
Get the file name component of a path if it exists or an empty string.
| path | The path to get the file name from |
Definition at line 54 of file path.cpp.
References file_name().
Referenced by MaxOS::filesystem::VirtualFileSystem::create_directory(), MaxOS::filesystem::VirtualFileSystem::create_file(), MaxOS::filesystem::VirtualFileSystem::delete_directory(), MaxOS::filesystem::VirtualFileSystem::delete_file(), MaxOS::filesystem::FileSystem::exists(), file_name(), is_file(), and MaxOS::filesystem::VirtualFileSystem::open_file().
Finds the path to the directory the file is in.
| path | The path to get the file path from |
Definition at line 101 of file path.cpp.
References file_path().
Referenced by MaxOS::filesystem::FileSystem::exists(), file_path(), and MaxOS::filesystem::VirtualFileSystem::open_directory().
Check if a path is a file.
| path | The path to check |
Definition at line 42 of file path.cpp.
References file_extension(), and file_name().
Referenced by absolute_path(), MaxOS::filesystem::VFSResourceRegistry::create_resource(), and MaxOS::filesystem::VFSResourceRegistry::get_resource().
Joins two paths together.
| base | The base path |
| extended | What to add to the base path (if its from root, "/", then it will just return this) |
Definition at line 208 of file path.cpp.
Referenced by MaxOS::filesystem::VFSResourceRegistry::create_resource(), and MaxOS::filesystem::VFSResourceRegistry::get_resource().
Get the parent directory of the path.
| path | The path to either the file or the directory |
Definition at line 148 of file path.cpp.
Referenced by MaxOS::filesystem::FileResource::write(), and MaxOS::filesystem::DirectoryResource::write().
Get the top directory of a path.
| path | The path to get the top directory from |
Definition at line 125 of file path.cpp.
References top_directory().
Referenced by MaxOS::filesystem::FileSystem::get_directory(), and top_directory().
Check if a path is valid.
| path | The path to check |
Definition at line 21 of file path.cpp.
Referenced by MaxOS::filesystem::VirtualFileSystem::create_directory(), MaxOS::filesystem::VirtualFileSystem::create_file(), MaxOS::filesystem::VirtualFileSystem::delete_directory(), MaxOS::filesystem::VirtualFileSystem::delete_file(), MaxOS::filesystem::VirtualFileSystem::open_directory(), and MaxOS::filesystem::VirtualFileSystem::open_file().