Go to the source code of this file.
Classes | |
| struct | gi_path |
Defines | |
| #define | GI_PATH_SEPARATOR_WIN32 '\\' |
| #define | GI_PATH_SEPARATOR_UNIX '/' |
| #define | GI_PATH_SEPARATOR GI_PATH_SEPARATOR_UNIX |
| #define | gi_path_native(gipath) gi_path_fmt (gipath, GI_PATH_NATIVE) |
| #define | gi_path_std(gipath) gi_path_fmt (gipath, GI_PATH_STD) |
Typedefs | |
| typedef gi_path | GiPath |
Enumerations | |
| enum | gi_path_style { GI_PATH_UNIX, GI_PATH_WIN32, GI_PATH_NATIVE = GI_PATH_UNIX, GI_PATH_STD = GI_PATH_UNIX } |
Functions | |
| EXTERN_C_BEGIN LIBGIFT_EXPORT GiPath * | gi_path_new (enum gi_path_style style, const char *path) |
| LIBGIFT_EXPORT GiPath * | gi_path_newn (enum gi_path_style style, const char *path, size_t len) |
| LIBGIFT_EXPORT void | gi_path_free (GiPath *gipath) |
| LIBGIFT_EXPORT GiPath * | gi_path_dup (GiPath *source) |
| LIBGIFT_EXPORT char * | gi_path_set (GiPath *gipath, enum gi_path_style style, const char *path) |
| LIBGIFT_EXPORT char * | gi_path_setn (GiPath *gipath, enum gi_path_style style, const char *path, size_t len) |
| LIBGIFT_EXPORT char * | gi_path_expand (GiPath *gipath) |
| LIBGIFT_EXPORT GiPath * | gi_path_dirname (GiPath *gipath) |
| LIBGIFT_EXPORT char * | gi_path_basename (GiPath *gipath) |
| LIBGIFT_EXPORT char * | gi_path_extname (GiPath *gipath) |
| LIBGIFT_EXPORT int | gi_path_append (GiPath *gipath, const char *delem) |
| LIBGIFT_EXPORT int | gi_path_appendn (GiPath *gipath, const char *delem, size_t len) |
| LIBGIFT_EXPORT char * | gi_path_fmt (GiPath *gipath, enum gi_path_style style) |
| LIBGIFT_EXPORT char * | gi_path_native_s (GiPath *gipath) |
| LIBGIFT_EXPORT size_t | gi_path_fmtlen (GiPath *gipath, enum gi_path_style style) |
| LIBGIFT_EXPORT size_t | gi_path_len (GiPath *gipath) |
| LIBGIFT_EXPORT bool | gi_path_eq (GiPath *a, GiPath *b) |
| LIBGIFT_EXPORT int | gi_path_cmp (GiPath *a, GiPath *b) |
| LIBGIFT_EXPORT int | gi_path_cmpn (GiPath *a, GiPath *b, size_t n) |
| LIBGIFT_EXPORT bool | gi_path_leads_with (GiPath *path, GiPath *lead) |
| LIBGIFT_EXPORT bool | gi_path_absolute (GiPath *gipath) |
These routines provide an abstraction for platform-specific path specifiers and allows for transport of those paths in a single libgift-wide standard.
|
|
Simple path object which acts as a platform-independent path specifier. This object always manages it's own internal string buffer. |
|
|
|
Tests if a path is absolute or relative. If the path is initialized to NULL, the path will be claimed to be relative.
|
|
||||||||||||
|
Add a new directory element to the end of the path. The directory element will be appended according to the rules of the current path style.
|
|
||||||||||||||||
|
Extended interface to gi_path_append wihch allows you to explicitly set the length of `delem'. No more than `len' bytes will be copied from the source. |
|
|
Access the "base" name of the path object. That is, the very last directory element, which usually represents a filename.
|
|
||||||||||||
|
Compare two paths borrowing from the current platform's semantics where applicable. |
|
||||||||||||||||
|
Compare two paths borrowing from the current platform's semantics where applicable. No more than `n' characters will be compared from either `a' or `b'. |
|
|
Access the directory portion of a path object. For example, given a path object that describes "/foo/bar/baz", a new path object would be returned describing "/foo/bar". No trailing '/' will be found in the result unless that is the only directory component that exists.
|
|
|
Produce a deep copy of `source'. This call is similar to gi_path_new (source->style, gi_path_fmt (source, source->style)). |
|
||||||||||||
|
Functionally equivalent to gi_path_cmp, but with the possibility to micro-optimize by first evaluating the length of the underlying path. |
|
|
Expand the underlying path string using shell-like expansion rules. Currently this only understands what to do with "~", which it expands to $HOME when it appears at the beginning of the path. It does not support the extended usage "~user". |
|
|
Access the extension of the base filename. The extension is defined as any characters following the last '.' character which occurs in the basename.
|
|
||||||||||||
|
Format the internal buffer to the specified style and return the conversion as a pointer to internally managed memory. |
|
||||||||||||
|
Simple convenience for calling gi_path_fmt, and then returning the result of gi_path_len. |
|
|
Destroy the gipath object as well as the internally managed copy of the path element. |
|
||||||||||||
|
Tests if the supplied path has leading components of the path supplied by `lead'. This is essentially a sugary wrapper for gi_path_cmpn. |
|
|
Access the length of the current path string. |
|
|
Similar to the ::gi_path_native macro except that this function will never allow NULL to be returned. This may be useful for lazily printing the underlying path without first checking or asserting that it is non-NULL.
|
|
||||||||||||
|
Construct a new path object from the specified string path. No conversion will be immediately applied, however an allocated copy of `path' will be made for internal management.
|
|
||||||||||||||||
|
Extended interface to gi_path_new which allows you to explicitly set the length of `path'. No more than `len' bytes will be copied from the source. |
|
||||||||||||||||
|
Assign or re-assign a path object with an initial path. If a path was previously set, the original memory segment will be reused for efficiency.
|
|
||||||||||||||||||||
|
Extended interface to gi_path_set wihch allows you to explicitly set the length of `path'. No more than `len' bytes will be copied from the source. |
1.3.7