![]() |
Public API Reference |
#include <stdio.h>
Go to the source code of this file.
Functions | |
char * | csStrNew (const char *s) |
Allocate a new char [] and copy the string into newly allocated storage. More... | |
char * | csExpandName (const char *iName) |
Expand a filename if it contains shortcuts. More... | |
void | csSplitPath (const char *iPathName, char *oPath, size_t iPathSize, char *oName, size_t iNameSize) |
Split a pathname into separate path and name. More... | |
bool | csGlobMatches (const char *fName, const char *fMask) |
This is a really simple function that does very nice "filename against filemask" comparisons. More... | |
int | csFindNearestPowerOf2 (int n) |
Finds the smallest number that is a power of two and is larger or equal to n. More... | |
bool | csIsPowerOf2 (int n) |
returns true if n is a power of two. More... | |
int | csLog2 (int n) |
Find the log2 of argument. More... | |
void | csFindReplace (char *dest, const char *src, const char *search, const char *replace, int max) |
given src and dest, which are already allocated, copy source to dest. More... |
Definition in file util.h.
|
Expand a filename if it contains shortcuts. Currently the following macros are recognised and expanded: '.', '~', '..', 'drive:' (on DOS/Win32/OS2)The returned filename is always absolute, i.e. it always starts from root. Return a string allocated with csStrNew(). |
|
Finds the smallest number that is a power of two and is larger or equal to n.
|
|
given src and dest, which are already allocated, copy source to dest. But, do not copy 'search', instead replace that with 'replace' string. max is size of dest. |
|
This is a really simple function that does very nice "filename against filemask" comparisons. It understands even such things like "*a*.txt" or "*a?b*" or even "*" (wish I DOS could do it ...). No "[]" wildcards though :-) NOTE: If you want case-insensitive comparison, upcase strings first. |
|
returns true if n is a power of two.
|
|
Find the log2 of argument.
|
|
Split a pathname into separate path and name. Path delimiters are either '/', PATH_SEPARATOR and, for OS/2, MS-DOS and Win32 targets, ':'. |
|
Allocate a new char [] and copy the string into newly allocated storage. This is a handy method for copying strings, in fact it is the C++ analogue of the strdup() function from string.h (strdup() is not present on some platforms). To free the pointer the caller should call delete[]. Referenced by csVariant::SetString. |