|
| static void * | alloc (size_t len) |
| | Allocates the requested number of bytes. More...
|
| |
| static void | free (void *ptr) |
| | Deallocates a pointer that was allocated using alloc(). More...
|
| |
| static char * | setString (char *&strVar, const char *value, size_t len=(size_t) -1) |
| | Sets a string to another string after cleaning up the previous string. More...
|
| |
|
static unsigned short * | setString_u16 (unsigned short *&strVar, const unsigned short *value, size_t len=(size_t) -1) |
| |
| static size_t | strlen_u16 (const unsigned short *str) |
| | Returns the length of the given string in 2-byte characters. More...
|
| |
| static size_t | strlen_XMOG_WCHAR (const XMOG_WCHAR *str) |
| | Returns the length of the given string . More...
|
| |
| static void | strncpy_u16 (unsigned short *dest, const unsigned short *src, size_t len) |
| | Copies up to len 2-byte characters from the source string to the target location. More...
|
| |
| static bool | to_bool (const char *strVal) |
| | Returns the bool value represented by the passed in string. More...
|
| |
| static void * | to_funptr (const char *strVal) |
| | Returns an entry point represented by its string'ized representation. More...
|
| |
| static char * | concatStrings (const char *str1, const char *str2) |
| | Concatenates two strings and returns the result. More...
|
| |
| static bool | endsWith (const char *str, const char *suffix, bool bCaseSensitive=true) |
| | Returns true if a given string ends with a given substring. More...
|
| |
| static int | hasFileAccess (const char *name, xmog_privileges priv) |
| | Returns 0 if we have the requested privileges for a given file, -1 otherwise. More...
|
| |
| static bool | hasProperType (const char *name) |
| | Returns true if the specified file is of the proper binary type to be used with this module. More...
|
| |
|
static bool | isWindows () |
| | Returns true if we're running on a Windows platform.
|
| |
|
static int | readLine (FILE *file, char *&line) |
| | Reads a line from a file.
|
| |
| static void | sleep (int ms) |
| | Sleeps for the specified number of milliseconds. More...
|
| |
| static unsigned short * | utf8_to_u16 (const char *utf8) |
| | Converts a UTF8 string to a dynamically allocated 16bit character string. More...
|
| |
| static unsigned char * | utf16_to_u8 (const unsigned short *utf16) |
| | Converts a UTF16 string to a dynamically allocated 8bit character string. More...
|
| |
A utility class providing several commonly useful methods.
| static bool xmog_util::hasProperType |
( |
const char * |
name | ) |
|
|
static |
Returns true if the specified file is of the proper binary type to be used with this module.
This function is mostly used on Windows to perform 64-bit vs. 32-bit testing of DLLs. A DLL might not be processor architecture compatible with the process into which it should be loaded. By testing the DLL prior to loading it, we can provide a better diagnostic message.
On platforms where we don't know how to find out the compatibility status, we always return true.
- Parameters
-
| name | the file which we want to test. |
| static void* xmog_util::to_funptr |
( |
const char * |
strVal | ) |
|
|
static |
Returns an entry point represented by its string'ized representation.
An entry point is defined by its module (optional) and its name (required). The two parts are separated by a semicolon. Examples of legal string representations are:
Example 1
The following example looks for an entry point named MyFunction that is expected to be found in the runtime library itself:
Example 2
The following example looks for an entry point named MyFunction that is expected to be found in a dynamic library called myutil.dll or libmyutil.so or whatever the platform-dependent name of a dynamic library called myutil resolves to:
- Parameters
-
| strVal | the string'ized form of the entry point. |