/** copy from to self */
void filepath_copy(String **self, String *from);
/** appends slash and name to self */
void filepath_append(String **self, char *name);
/** convience function for allocating new string appending path for c strings */
char *filepath_append_cstr(char *path, char *name);
/** removes everything after last slash including the slash */
void filepath_remove_last(String *self);
/** remove the last element in the path, and replace with newname */
void filepath_replace_last(String **self, char *newname);
/** returns true if self includes a slash as first character, false otherwise */
bool filepath_isabsolute(String *self);
/** returns !filepath_isabsolute */
bool filepath_isrelative(String *self);
/** make self an absolute path if it's not already one by prepending getwd() */
void filepath_make_absolute(String **self);
/** convience function that return a newly allocated absolute path */
char *filepath_make_absolute_cstr(char *path);
enum { FILEPATH_BUFFER_MAX = 4096 };
|