path.h File Reference
Wrapper functions for path manipulation class. More...
#include "translations.h"
Go to the source code of this file.
Functions | |
DLLIMPORT dar_path * | dar_path_create (char *path) |
Creates a new path object from c string. | |
DLLIMPORT dar_path * | dar_path_copy (dar_path *ref) |
Copy constructor. | |
DLLIMPORT void | dar_path_destroy (dar_path *ref) |
Frees memory used by path object. | |
DLLIMPORT bool | dar_path_compare (dar_path *ref, dar_path *path) |
Returns true if paths are exactly alike. | |
DLLIMPORT bool | dar_path_is_relative (dar_path *ref) |
Returns true if the path is relative, false if absolute. | |
DLLIMPORT bool | dar_path_is_subdir_of (dar_path *ref, dar_path *path, bool case_sensit) |
Returns true if reference is a subdirectory of path . | |
DLLIMPORT char * | dar_path_iterate_next (dar_path *ref) |
Gets c string containing the name of the next child directory. | |
DLLIMPORT void | dar_path_iterate_reset (dar_path *ref) |
Resets iteration position at the root or shallowest child. | |
DLLIMPORT bool | dar_path_stack_push (dar_path *ref, dar_path *path) |
Adds another relative path to the end of the reference path. | |
DLLIMPORT bool | dar_path_stack_peek (dar_path *ref, char **name) |
Returns deepest child directory name without removing it from the stack. | |
DLLIMPORT bool | dar_path_stack_pop (dar_path *ref, char **name) |
Pops the deepest child directory off the stack, or returns false if there are no more children left (only one element on the stack). | |
DLLIMPORT bool | dar_path_stack_pop_front (dar_path *ref, char **name) |
Pops the root or topmost directory. | |
DLLIMPORT char * | dar_path_get_string (dar_path *ref) |
Returns full path name. | |
DLLIMPORT unsigned int | dar_path_get_depth (dar_path *ref) |
Returns the number of elements left in the path. |
Detailed Description
Wrapper functions for path manipulation class.
Definition in file path.h.
Function Documentation
|
Copy constructor. Creates a fresh path object. |
|
Creates a new path object from c string.
Returns |
|
Returns the number of elements left in the path. An absolute path adds one for the root directory itself.
foo/bar/directory 3 /foo/bar/directory 4 |
|
Returns full path name. String will represent either an absolute or relative path. |
|
Returns true if reference is a subdirectory of
For example, |
|
Returns deepest child directory name without removing it from the stack. Will always output a string, but will return false if the output is the last possible element (no more parent directories).
This method should be used whenever the deepest child is desired. This is equivalent to |
|
Pops the root or topmost directory. Returns false when only the deepest child is left or path is equal to the root directory. |
|
Adds another relative path to the end of the reference path. Returns false if pushed path is not relative (can't add an absolute path to another absolute path!) |