|
ubit
|
useful functions for C strings. More...
#include <ustr.hpp>
Static Public Member Functions | |
| static char * | dup (const char *s) |
| creates a duplicate of s. | |
| static char * | dup (const char *s1, const char *s2) |
| creates a duplicate of s1 + s2. | |
| static char * | dup (const char *s1, char sep, const char *s2) |
| creates a duplicate of s1 + sep + s2. | |
| static bool | equals (const char *s1, const char *s2, bool ignore_case=false) |
| checks if string contents are the same, ignores case if last argument is true. | |
| static int | compare (const char *s1, const char *s2, bool ignore_case=false) |
| compare strings lexicographically, ignores case if last argument is true. | |
| static int | compareN (const char *s1, const char *s2, unsigned int n, bool ignore_case=false) |
| compare the N first chars of strings, ignores case if last argument is true. | |
| static const char * | suffix (const char *pathname) |
| finds the suffix in a pathname. More... | |
| static void | parsePath (char *path_name, int path_len, char *&dir_name, int &dir_len, char *&base_name, int &base_len, char *&suffix, int &suffix_len) |
| transforms a path name into its dirname, basename and suffix components. More... | |
useful functions for C strings.
these functions may already exist on some OS.
|
static |
transforms a path name into its dirname, basename and suffix components.
the returned pointers points inside the path name and should not be freed.
|
static |
finds the suffix in a pathname.
the returned value is null or points inside the original string (its is not duplicated and thus, can't be freed)
1.8.12