file
Path.hPath provides various functions for working with filesystem paths.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Typedefs
Functions
- CnxPath cnx_path_user_home_directory(void)
- Returns the path to the home directory of the user running this Program.
- CnxPath cnx_path_user_application_data_directory(void)
- Returns the path to the application data directory for the current user.
- CnxPath cnx_path_user_documents_directory(void)
- Returns the path to the documents directory for the current user.
- CnxPath cnx_path_common_application_data_directory(void)
- Returns the path to the application data directory for the system.
- CnxPath cnx_path_common_documents_directory(void)
- Returns the path to the shared documents directory.
- CnxPath cnx_path_temp_directory(void)
- Returns a path to a directory suitable for storing temporary files.
- CnxPath cnx_path_current_executable_file(void)
- Returns the path to the currently running executable.
- CnxPath cnx_path_current_application_file(void)
- Returns the path to the currently running application.
- CnxPath cnx_path_system_applications_directory(void)
- Returns the path to the system applications directory.
- CnxPath cnx_path_current_working_directory(void)
- Returns the path to the current working directory.
- char cnx_path_separator_char(void)
- Returns the path separator character of the host platform.
Defines
- #define CnxScopedPath
- Declare a
CnxPath
as aCnxScopedPath
for the resources associated with the path to be automaticallyfree
d when the path leaves the scope. - #define cnx_path_free(path_ptr)
- Frees the resources associated with the given path.
- #define CNX_PATHS_CASE_SENSITIVE
TRUE
if filesystem paths are case-sensitive on the host platform,FALSE
otherwise- #define cnx_path_is_valid(path)
- Checks if the given string would be a valid path on the host platform's filesystem.
- #define cnx_path_new(path)
- Creates a new path from the given string, canonicalized so as to be valid on the host platform.
- #define cnx_path_is_absolute(path)
- Checks if the given path is an absolute path.
- #define cnx_path_is_relative(path)
- Checks if the given path is a relative path.
- #define cnx_path_get_absolute_path(path)
- Returns the absolute path of
path
- #define cnx_path_exists(path)
- Checks if the given path exists.
- #define cnx_path_is_file(path)
- Checks if the given path is a path to a file.
- #define cnx_path_is_directory(path)
- Checks if the given path is a path to a directory.
- #define cnx_path_is_fs_root(path)
- Checks if the given path is a path to a filesystem root (ie "C:\\" or "/")
- #define cnx_path_is_symlink(path)
- Checks if the given path is a path to a symbolic link.
- #define cnx_path_get_symlink_target(path)
- Attempts to get the path of the target of the symbolic link
path
- #define cnx_path_has_file_extension(path, extension)
- Checks if the given path is a file with the given file extension.
- #define cnx_path_get_file_extension(path)
- Attempts to get the file extension of the file
path
- #define cnx_path_get_file_name(path)
- Gets the file name of the given path, including file extension.
- #define cnx_path_get_file_name_without_extension(path)
- Gets the file name of the given path, without the file extension.
- #define cnx_path_get_parent_directory(path)
- Returns the parent directory of the given
path
- #define cnx_path_append(path, entry_name)
- Appends the relative path
entry_name
topath
- #define cnx_path_create_file(...)
- Creates a new file with the path and name indicated by
path
- #define cnx_path_create_file_overwriting(file_path)
- Creates a new file with the path and name indicated by
path
- #define cnx_path_create_directory(...)
- Creates a new directory with the path and name indicated by
path
- #define cnx_path_create_directory_overwriting(dir_path)
- Creates a new directory with the path and name indicated by
path
- #define cnx_path_remove_file(file_path)
- Removes the file located at
path
- #define cnx_path_remove_directory(...)
- Removes the directory located at
path
- #define cnx_path_remove_directory_recursive(dir_path)
- Removes the directory located at
path
- #define cnx_path_create_symlink(...)
- Creates a new symbolic link with the name and path indicated by
link_name
that points to the file or directory atlink_target
- #define cnx_path_create_symlink_overwriting(link_name, link_target)
- Creates a new symbolic link with the name and path indicated by
link_name
that points to the file or directory atlink_target
- #define cnx_path_remove_symlink(link_path)
- Removes the symbolic link
link_path