|
static const ON_wString | CleanPath (bool bTrimLeft, bool bTrimRight, bool bAllowWindowsUNCHostNameOrDiskLetter, bool bDeleteWindowsUNCHostNameOrDiskLetter, bool bExpandUser, const wchar_t directory_separator, const wchar_t *dirty_path) |
|
static const ON_wString | CleanPath (bool bTrimLeft, bool bTrimRight, bool bAllowWindowsUNCHostNameOrDiskLetter, bool bDeleteWindowsUNCHostNameOrDiskLetter, const wchar_t directory_separator, const wchar_t *dirty_path) |
|
static const ON_wString | CleanPath (const wchar_t *dirty_path) |
|
static const ON_wString | CombinePaths (const wchar_t *left_side, bool bLeftSideContainsFileName, const wchar_t *right_side, bool bRightSideContainsFileName, bool bAppendTrailingDirectorySeparator) |
|
static const ON_wString | CurrentDirectory (bool bWithTrailingDirectorySeparator) |
|
static const ON_wString | DirectoryFromPath (const wchar_t *path) |
|
static const ON_wString | ExpandUser (const char *dirty_path) |
|
static const ON_wString | ExpandUser (const wchar_t *dirty_path) |
|
static const ON_wString | FileNameExtensionFromPath (const wchar_t *path) |
|
static const ON_wString | FileNameFromPath (const wchar_t *path, bool bIncludeExtension) |
|
static bool | FilePathHas3dmExtension (const char *file_path, bool bAllow3dmbakExtension) |
|
static bool | FilePathHas3dmExtension (const wchar_t *file_path, bool bAllow3dmbakExtension) |
|
static const ON_wString | FullPathFromRelativePath (const wchar_t *base_path, bool bBasePathIncludesFileName, const wchar_t *relative_path) |
|
static bool | IsDirectory (const char *path) |
|
static bool | IsDirectory (const wchar_t *path) |
|
static bool | IsDirectorySeparator (char c, bool bAllowAlternate) |
|
static bool | IsDirectorySeparator (wchar_t c, bool bAllowAlternate) |
|
static bool | IsFile (const char *path) |
|
static bool | IsFile (const wchar_t *path) |
|
static bool | IsRelativePath (const wchar_t *path) |
|
static bool | IsRelativePath (const wchar_t *path, const wchar_t directory_separator) |
|
static bool | IsValidFileName (const char *file_name, bool bAllPlatforms) |
|
static bool | IsValidFileName (const wchar_t *file_name, bool bAllPlatforms) |
|
static bool | PathExists (const char *path) |
|
static bool | PathExists (const wchar_t *path) |
|
static const ON_wString | PlatformPath (ON_FileSystemPath::PathId path_id) |
|
static bool | PlatformPathIgnoreCase () |
|
static const ON_wString | RelativePath (const wchar_t *full_path, bool bFullPathIncludesFileName, const wchar_t *base_path, bool bBasePathIncludesFileName) |
|
static const ON_wString | RemoveFileName (const wchar_t *path, ON_wString *file_name) |
|
static const ON_wString | RemoveVolumeName (const wchar_t *path, ON_wString *volume_name) |
|
static void | SplitPath (const char *path, ON_String *volume, ON_String *dir, ON_String *file_name_stem, ON_String *file_name_ext) |
|
static void | SplitPath (const char *path, ON_wString *volume, ON_wString *dir, ON_wString *file_name_stem, ON_wString *file_name_ext) |
|
static void | SplitPath (const wchar_t *path, ON_wString *volume, ON_wString *dir, ON_wString *file_name_stem, ON_wString *file_name_ext) |
|
static void | SplitPath (const wchar_t *path, ON_wString *volume, ON_wString *dir, ON_wString *file_name_stem_and_extension) |
|
static const ON_wString | VolumeAndDirectoryFromPath (const wchar_t *path) |
|
static const ON_wString | VolumeFromPath (const wchar_t *path) |
|
static const ON_wString ON_FileSystemPath::CleanPath |
( |
bool |
bTrimLeft, |
|
|
bool |
bTrimRight, |
|
|
bool |
bAllowWindowsUNCHostNameOrDiskLetter, |
|
|
bool |
bDeleteWindowsUNCHostNameOrDiskLetter, |
|
|
bool |
bExpandUser, |
|
|
const wchar_t |
directory_separator, |
|
|
const wchar_t * |
dirty_path |
|
) |
| |
|
static |
Description: Condenses ///< to / Condenses /./ to / Condenses /sfsdf/../ to / Sets all directory separators to directory_separator. Parameters: bAllowWindowsUNCHostNameOrDiskLetter - [in] If bAllowWindowsUNCHostNameOrDiskLetter and the path begins with \HostName followed by a directory separator, then the initial \ is not condensed. If the path begins with X: followed by a directory separator, where "X" is a single letter in the range A to Z or a to z, then the path is considered valid. bDeleteWindowsUNCHostNameOrDiskLetter - [in] If bAllowWindowsUNCHostNameOrDiskLetter is true and the path begins with a UNC host name or disk letter followed by a directory separator, then host name or disk letter is deleted. This is useful when using paths from a Windows platform on a non-Windows platform. bExpandUser - [in] If the path begins with ~ and ON_FileSystemPath::PlatformPath( ON_FileSystemPath::PathId::UserHomeDirectory ) is not empty, then the ~ is replaced with absolute path of user's home directory. directory_separator - [in] If 0 == directory_separator, then the first directory separator is kept when condensing occurs. ON_wString::FileSystemPathSeparator is a good choice if you want to use the current runtime's separator. dirty_path - [in] path to clean. Return: Cleaned path.
static const ON_wString ON_FileSystemPath::RelativePath |
( |
const wchar_t * |
full_path, |
|
|
bool |
bFullPathIncludesFileName, |
|
|
const wchar_t * |
base_path, |
|
|
bool |
bBasePathIncludesFileName |
|
) |
| |
|
static |
Description: Get a the relative path from base_path to full_path. Parameters: full_path - [in] base_path - [in]
Example full_path = L"c:/a/b/c/d/somefile.txt"; base_path = L"C:/A/B/X/Y/Z/model.3dm"; ON_wString::GetRelativePath(full_path,base_path) returns L"../../../c/d/somefile.txt"
Example full_path = L"c:/a/b/somefile.txt"; base_path = L"C:/A/B/model.3dm"; ON_wString::GetRelativePath(full_path,base_path) returns L"./somefile.txt"
Remarks: Path separators on the input can be mixed. Path separators on the returned relative path are ON_wString::FileSystemPathSeparator
Description: Find the locations in a path the specify the drive, directory, file name and file extension. Parameters: path - [in] path to split volume - [out] (pass null if you don't need the volume) If volume is not null and the path parameter begins with a Windows volume specification, *volume will either be the Windows volume letter followed by the trailing colon or a Windows UNC \<hostname>. Otherwise volume will be the empty string. dir - [out] (pass null if you don't need the directory) If dir is not null and the path parameter contains a directory specification, then the returned value of *dir will be the directory specification including the trailing slash. file_name_stem - [out] (pass null if you don't need the file name stem) If file_name_stem is not null and the path parameter contains a file name specification, then the returned value of *file_name_stem will be the file name stem. file_name_ext - [out] (pass null if you don't need the extension) If file_name_ext is not null and the path parameter contains a file name extension specification, then the returned value of file_name_ext will be the file name extension including the initial '.' character. Remarks: This function will treat a front slash ( / ) and a back slash ( \ ) as directory separators. Because this function parses file names store in .3dm files and the .3dm file may have been written on a Windows computer and then read on a another computer, it looks for a volume specification even when the operating system is not Windows. This function will not return an directory that does not end with a trailing slash. This function will not return an empty filename and a non-empty extension. This function parses the path string according to these rules. It does not check the actual file system to see if the answer is correct. See Also: on_splitpath