Utilities
Modules | |
Containers | |
Classes | |
class | csAnsiParser |
Helper to parse a string for ANSI codes. More... | |
struct | csBigEndian |
Big endian to native conversion routines. More... | |
class | csBitmaskToString |
Small helper to get a "pretty" string for a combination of bit masks. More... | |
struct | csCtoW |
Helper class to convert char* (UTF-8 encoded )to wchar_t* strings for use as function parameters. More... | |
class | csFmtDefaultReader< T > |
Standard format string source for csPrintfFormatter. More... | |
class | csFmtDefaultWriter< T > |
Standard formatted string destination for csPrintfFormatter. More... | |
struct | csGetFromAddress |
Sized data type access helpers. More... | |
struct | csIEEEfloat |
Convert IEEE 32-bit floats from or to native machine floats. More... | |
class | csInstallationPathsHelper |
A helper class containing a number of functions to deal with Crystal Space installation paths. More... | |
struct | csLittleEndian |
Little endian to native conversion routines. More... | |
class | csMeasureTime |
Simple helper class to measure execution time of a block. More... | |
struct | csOptionDescription |
Configuration option description. More... | |
class | csPathsList |
Class to manage a list of paths. More... | |
class | csPathsUtilities |
A helper class with path-related utilities. More... | |
class | csPrintfFormatter< Twriter, Treader > |
Templated class for printf()-style string formatting. More... | |
class | csReporterHelper |
Helper class for csReport(). More... | |
struct | csSetToAddress |
Sized data type access helpers. More... | |
struct | csSwapBytes |
Methods to unconditionally swap the byte order of specifically sized types. More... | |
class | csUnicodeTransform |
Contains functions to convert between several UTF encodings. More... | |
struct | csVariant |
Variant, means that type of contained data is set at runtime. More... | |
struct | csWtoC |
Helper class to convert wchar_t* to char* (UTF-8 encoded) strings for use as function parameters. More... | |
struct | iCommandLineParser |
A utility class that makes it easier to parse the command line. More... | |
struct | iConfigFile |
Configuration file interface. More... | |
struct | iConfigIterator |
Iterator which allows sequential access to configuration information contained in an iConfigFile object. More... | |
struct | iConfigManager |
The configuration manager is used to make a number of iConfigFile object appear like a single object. More... | |
struct | iDataBuffer |
The iDataBuffer interface can be used to exchange buffers with abstract data between plugins. More... | |
struct | iDebugHelper |
Some object that wants to implement unit testing, debugging and/or benchmarking can implement this interface. More... | |
struct | iDocument |
Representation of a document containing a hierarchical structure of nodes. More... | |
struct | iDocumentAttribute |
An attribute for an iDocumentNode. More... | |
struct | iDocumentAttributeIterator |
An iterator over iDocumentNode attributes. More... | |
struct | iDocumentNode |
Representation of a node in a document. More... | |
struct | iDocumentNodeIterator |
An iterator over iDocumentNode. More... | |
struct | iDocumentSystem |
An iDocument factory. More... | |
struct | iObject |
This interface is an SCF interface for encapsulating csObject. More... | |
struct | iObjectIterator |
This is an iterator for child objects of a csObject. More... | |
struct | iObjectNameChangeListener |
A callback that you can implement to get notified of name changes in an iObject. More... | |
struct | iPluginConfig |
Interface to a configurator object. More... | |
struct | iReporter |
This is the interface for the error/message reporter plugin. More... | |
struct | iReporter |
This is the interface for the error/message reporter plugin. More... | |
struct | iReporterIterator |
An iterator to iterate over all messages in the reporter. More... | |
struct | iReporterIterator |
An iterator to iterate over all messages in the reporter. More... | |
struct | iReporterListener |
Implement this interface if you're interested in hearing about new messages on the reporter. More... | |
struct | iReporterListener |
Implement this interface if you're interested in hearing about new messages on the reporter. More... | |
struct | iSelfDestruct |
An object implementing this interface can remove itself from its 'natural parent'. More... | |
struct | iString |
This is a SCF-compatible interface for csString. More... | |
struct | iStringArray |
This is an SCF-compatible interface for csStringArray. More... | |
struct | iStringSet |
The string set is a collection of unique strings. More... | |
Other types | |
#define | _INTPTR_T_DEFINED |
#define | _PTRDIFF_T_DEFINED |
#define | _UINTPTR_T_DEFINED |
#define | _WCHAR_T_DEFINED |
#define | _WCTYPE_T_DEFINED |
#define | _WINT_T |
#define | CS_WCHAR_T_SIZE 2 |
typedef unsigned int | csTicks |
A time value measured in milliseconds (1/1000 of a second). | |
typedef int64 | intmax_t |
Greatest-width integer. | |
typedef int | intptr_t |
Integer at least as wide as a pointer. | |
typedef long long | longlong |
Type to pass to cs_snprintf() as an argument to the "%lld" format specifier. | |
typedef int | ptrdiff_t |
Difference of 2 pointers. | |
typedef unsigned int | uint |
Shortcut for default unsigned int. | |
typedef uint64 | uintmax_t |
Greatest-width unsigned integer. | |
typedef unsigned int | uintptr_t |
Unsigned integer at least as wide as a pointer. | |
typedef unsigned long long | ulonglong |
Type to pass to cs_snprintf() as an argument to the "%llu" format specifier. | |
typedef uint16 | wchar_t |
typedef wchar_t | wint_t |
Specific sized types | |
These types should be used ONLY when you need a variable of an explicit number of bits. For all other cases, you should use normal char, short, int, long, etc., types since they are treated as "natural" types and will generally have better performance characteristics than the explicitly-sized types. Use the explicitly-sized types sparingly. | |
#define | CONST_INT64(x) INT64_C(x) |
Specify a 64 bit integer constant. | |
#define | CONST_UINT64(x) UINT64_C(x) |
Specify 64 bit unsigned integer constant. | |
typedef short | int16 |
signed 16-bit integer (-32 768..32 767) | |
typedef int | int32 |
signed 32-bit integer (-2 147 483 648..2 147 483 647) | |
typedef long long | int64 |
signed 64-bit integer | |
typedef char | int8 |
signed 8-bit integer (-128..127) | |
typedef unsigned short | uint16 |
unsigned 16-bit integer (0..65 535) | |
typedef unsigned int | uint32 |
unsigned 32-bit integer (0..4 294 967 295) | |
typedef unsigned long long | uint64 |
unsigned 64-bit integer | |
typedef unsigned char | uint8 |
unsigned 8-bit integer (0..255) | |
Document changeabilty | |
#define | CS_CHANGEABLE_NEVER 0 |
The document can not be changed, CreateRoot() is not supported. | |
#define | CS_CHANGEABLE_NEWROOT 1 |
The document only allows changes with a newly created root. | |
#define | CS_CHANGEABLE_YES 2 |
The document can be changed. | |
iDebugHelper implementation support flags | |
#define | CS_DBGHELP_BENCHMARK 2 |
supports Benchmark(). | |
#define | CS_DBGHELP_GFXDUMP 8 |
supports graphical Dump(). | |
#define | CS_DBGHELP_STATETEST 16 |
supports StateTest(). | |
#define | CS_DBGHELP_TXTDUMP 4 |
supports non graphical Dump(). | |
#define | CS_DBGHELP_UNITTEST 1 |
supports UnitTest(). | |
Token list helper macros | |
The macros here provide an easy way to automatically build a token list useful for e.g. parsers. The list of tokens have to be declared in an external file, with each token the argument to a 'CS_TOKEN_LIST_TOKEN()' invocation. The name of the file (full path!) has to be put in a macro named CS_TOKEN_ITEM_FILE. Optionally, the name of the function to initialize the token table can be set via CS_INIT_TOKEN_TABLE_NAME; the default is 'InitTokenTable'. In addition to invoking the initialization function to populate the string hash, an enumeration is also created. Elements of the enumeration are named XMLTOKEN_FOO (where 'FOO' represents the argument to CS_TOKEN_LIST_TOKEN()). If you prefer a prefix other than 'XMLTOKEN_', define CS_TOKEN_LIST_TOKEN_PREFIX with the prefix of your choice. As a convenience, in addition to entries for each CS_TOKEN_LIST_TOKEN invocation, a final item is added to the enumeration with the name provided by CS_TOKEN_LIST_TOKEN_LAST. If you do not #define this macro, then the name XMLTOKEN_TOKEN_COUNT is given to the last item in the enumeration. This value will equate to the count of items in the enumeration (not including this automatically added item). Note that the client defines CS_TOKEN_ITEM_FILE, CS_INIT_TOKEN_TABLE_NAME, CS_TOKEN_LIST_TOKEN_PREFIX, and CS_TOKEN_LIST_TOKEN_LAST, and they will not be undefined by this file; hence, if you want to build multiple token lists, you may redefine those macros and include <cstool/tokenlist.h> again. Example (from a real-world use): fire.tok: CS_TOKEN_LIST_TOKEN(PALETTE) ... class csFireLoader { csStringHash tokens; #define CS_TOKEN_ITEM_FILE "plugins/proctex/standard/fire.tok" #include "cstool/tokenlist.h" ... }; fire.cpp: csFireLoader::csFireLoader(iBase *p) { InitTokenTable (tokens); // ... } csPtr<iBase> csFireLoader::Parse (iDocumentNode* node, iLoaderContext* ldr_context, iBase* context) { // ... csStringID id = tokens.Request (child->GetValue ()); switch (id) { case XMLTOKEN_PALETTE: // ... break; } // ... } | |
#define | CS_INIT_TOKEN_TABLE_NAME InitTokenTable |
Name of the token table initialization method. | |
#define | CS_INIT_TOKEN_TABLE_NAME_DEFAULT |
Name of the token table initialization method. | |
#define | CS_TOKEN_LIST_PASTE(X, Y) CS_TOKEN_LIST_PASTE1(X,Y) |
Name of the token table initialization method. | |
#define | CS_TOKEN_LIST_PASTE1(X, Y) X ## Y |
Name of the token table initialization method. | |
#define | CS_TOKEN_LIST_TOKEN(X) |
A token list entry. | |
#define | CS_TOKEN_LIST_TOKEN(X) CS_TOKEN_LIST_PASTE(CS_TOKEN_LIST_TOKEN_PREFIX,X), |
A token list entry. | |
#define | CS_TOKEN_LIST_TOKEN_FINAL(X) CS_TOKEN_LIST_PASTE(CS_TOKEN_LIST_TOKEN_PREFIX,X) |
Name of the token table initialization method. | |
#define | CS_TOKEN_LIST_TOKEN_LAST TOKEN_COUNT |
Name for the "token count" enumeration value. | |
#define | CS_TOKEN_LIST_TOKEN_LAST_DEFAULT |
Name of the token table initialization method. | |
#define | CS_TOKEN_LIST_TOKEN_PREFIX XMLTOKEN_ |
Prefix for the generated enumeration value. | |
#define | CS_TOKEN_LIST_TOKEN_PREFIX_DEFAULT |
Name of the token table initialization method. | |
enum | |
Name of the token table initialization method. More... | |
static void | CS_INIT_TOKEN_TABLE_NAME (csStringHash &t) |
Name of the token table initialization method. | |
iReporter severity levels | |
#define | CS_REPORTER_SEVERITY_BUG 0 |
BUG severity level. | |
#define | CS_REPORTER_SEVERITY_DEBUG 4 |
DEBUG severity level. | |
#define | CS_REPORTER_SEVERITY_ERROR 1 |
ERROR severity level. | |
#define | CS_REPORTER_SEVERITY_NOTIFY 3 |
NOTIFY severity level. | |
#define | CS_REPORTER_SEVERITY_WARNING 2 |
WARNING severity level. | |
Special character codes | |
#define | CS_UC_BOM 0xFFFE |
Byte-order mark. | |
#define | CS_UC_CHAR_HIGH_SURROGATE_FIRST 0xD800 |
First char in the "high surrogate" range. | |
#define | CS_UC_CHAR_HIGH_SURROGATE_LAST 0xDBFF |
Last char in the "high surrogate" range. | |
#define | CS_UC_CHAR_LOW_SURROGATE_FIRST 0xDC00 |
First char in the "low surrogate" range. | |
#define | CS_UC_CHAR_LOW_SURROGATE_LAST 0xDFFF |
Last char in the "low surrogate" range. | |
#define | CS_UC_CHAR_REPLACER 0xFFFD |
Replacer char. | |
#define | CS_UC_INVALID 0xFFFF |
Invalid char. | |
#define | CS_UC_IS_HIGH_SURROGATE(C) (((C) & 0xFFFFFC00) == 0x0000DC00) |
Check whether a code is in the "high surrogate" range. | |
#define | CS_UC_IS_LOW_SURROGATE(C) (((C) & 0xFFFFFC00) == 0x0000D800) |
Check whether a code is in the "low surrogate" range. | |
#define | CS_UC_IS_NONCHARACTER(C) |
Test whether a code point is a Unicode noncharacter. | |
#define | CS_UC_IS_SURROGATE(C) (((C) & 0xFFFFF800) == 0x0000D800) |
Check whether a code is in the "high" or "low surrogate" range. | |
#define | CS_UC_LAST_CHAR 0x10FFFF |
Highest valid Unicode codepoint. | |
Low-level shared library support | |
typedef void * | csLibraryHandle |
void * | csGetLibrarySymbol (csLibraryHandle Handle, char const *iName) |
Return a pointer to a symbol within given shared library. | |
bool | csGetLoadLibraryVerbose () |
Query if failed dynamic library loads generate verbose messages. | |
csRef< iString > | csGetPluginMetadata (const char *fullPath, csRef< iDocument > &metadata) |
Retrive a plugin's metadata. | |
csLibraryHandle | csLoadLibrary (char const *iName) |
Load a shared library and return a library handle, which is used later to query and unload the library. | |
void | csPrintLibraryError (char const *iModule) |
Print out the latest dynamic loader error. | |
csRef< iStringArray > | csScanPluginDir (const char *dir, csRef< iStringArray > &plugins, bool recursive=true) |
Scan a given directory for plugins and return a list of the plugin native file names and their respective metadata. | |
csRef< iStringArray > | csScanPluginDirs (csPathsList *dirs, csRef< iStringArray > &plugins) |
Scan some given directories for plugins. | |
void | csSetLoadLibraryVerbose (bool) |
Control whether dynamic library loading messages are verbose or terse. | |
bool | csUnloadLibrary (csLibraryHandle Handle) |
Unload a shared library given its handle. | |
Deprecated endian conversion routines | |
It is recommended to use csLittleEndian, csBigEndian, csIEEEfloat, csGetFromAddress or csSetToAddress for the tasks below. | |
static float | csBigEndianFloat (float f) |
Convert a big-endian floating-point number to machine format. | |
static uint32 | csBigEndianLong (uint32 l) |
Convert a long from big-endian to machine format. | |
static uint64 | csBigEndianLongLong (uint64 l) |
Convert a longlong from big-endian to machine format. | |
static uint16 | csBigEndianShort (uint16 s) |
Convert a short from big-endian to machine format. | |
static int64 | csDoubleToLongLong (double d) |
Convert a double to a cross-platform 64-bit format (no endianess adjustments!). | |
static int32 | csFloatToLong (float f) |
Convert a float to a cross-platform 32-bit format (no endianess adjustments!). | |
static short | csFloatToShort (float f) |
Convert a float to a cross-platform 16-bit format (no endianess adjustments!). | |
static float | csLittleEndianFloat (float f) |
Convert a little-endian floating-point number to machine format. | |
static uint32 | csLittleEndianLong (uint32 l) |
Convert a long from little-endian to machine format. | |
static uint64 | csLittleEndianLongLong (uint64 l) |
Convert a longlong from little-endian to machine format. | |
static uint16 | csLittleEndianShort (uint16 s) |
Convert a short from little-endian to machine format. | |
static double | csLongLongToDouble (int64 i) |
Convert a 64-bit cross-platform double to native format (no endianess adjustments!). | |
static float | csLongToFloat (int32 l) |
Convert a 32-bit cross-platform float to native format (no endianess adjustments!). | |
static float | csShortToFloat (short s) |
Convert a 16-bit cross-platform float to native format (no endianess adjustments!). | |
System functions | |
bool | csDefaultRunLoop (iObjectRegistry *) |
Implements a default run-loop for stand-alone applications. | |
int | csFPrintf (FILE *file, const char *str,...) |
CS version of fprintf (file, str, . | |
int | csFPrintfV (FILE *file, const char *str, va_list arg) |
CS version of vfprintf (stderr, str, . | |
csPtr< iConfigFile > | csGetPlatformConfig (const char *key) |
Get a platform-specific per-user config object. | |
csString | csGetPlatformConfigPath (const char *key, bool local=false) |
Get a platform-specific path to store per-user configuration data. | |
csTicks | csGetTicks () |
Get the current tick count. | |
csString | csGetUsername () |
Get the username of the account running the program. | |
bool | csPlatformShutdown (iObjectRegistry *) |
Platform-specific shutdown. | |
bool | csPlatformStartup (iObjectRegistry *) |
Platform-specific startup. | |
int | csPrintf (const char *str,...) |
CS version of printf. | |
int | csPrintfErr (const char *str,...) |
CS version of fprintf (stderr, str, . | |
int | csPrintfErrV (const char *str, va_list arg) |
CS version of vfprintf (stderr, str, . | |
int | csPrintfV (const char *str, va_list arg) |
CS version of vprintf. | |
void | csSleep (int) |
This function will freeze your application for given number of 1/1000 seconds. | |
Helpers to deal with native paths | |
char * | csExpandPath (const char *path) |
csRef< iStringArray > | csFindSystemRoots () |
csString | csGetAppDir (const char *argv0) |
csString | csGetAppPath (const char *argv0) |
csString | csGetConfigPath () |
Get the installation path. | |
csPathsList * | csGetPluginPaths (const char *argv0) |
Get a list of directories where plugins are installed. | |
csString | csGetResourceDir (const char *argv0) |
bool | csPathsIdentical (const char *path1, const char *path2) |
Defines | |
#define | CS_BITMASKTOSTR_MASK_TABLE_BEGIN(tableName) static const csBitmaskToString::MaskNames tableName[] = { |
Helper macro to begin a bitmask-to-name table suitable for csBitmaskToString::GetStr();. | |
#define | CS_BITMASKTOSTR_MASK_TABLE_DEFINE(def) {def, #def}, |
Helper macro to add an entry to a bitmask-to-name table that is a #define. | |
#define | CS_BITMASKTOSTR_MASK_TABLE_END |
Helper macro to enf a bitmask-to-name table. | |
#define | CS_GET_CHILD_OBJECT(object, Interface) |
You can use this macro to get a child object from a csObject. | |
#define | CS_GET_FIRST_NAMED_CHILD_OBJECT(object, Interface, name) |
This is the same as CS_GET_CHILD_OBJECT, but stops at the first object with the given name, even if it does not implement the requested interface. | |
#define | CS_GET_NAMED_CHILD_OBJECT(object, Interface, name) |
You can use this macro to get a child object with the given name and interface from a csObject. | |
#define | CS_UC_MAX_MAPPED 3 |
A complex mapping (uppercase, lowercase, fold) for a Unicode code point expands to at maximum this number of code points. | |
#define | CS_UC_MAX_UTF16_ENCODED 2 |
An Unicode code point as UTF16 is at maximum encoded to this number of code units. | |
#define | CS_UC_MAX_UTF32_ENCODED 1 |
An Unicode code point as UTF32 is at maximum encoded to this number of code units. | |
#define | CS_UC_MAX_UTF8_ENCODED 4 |
An Unicode code point as UTF8 is at maximum encoded to this number of code units. | |
#define | csQroundSure(x) (int ((x) + ((x < 0) ? -0.5 : +0.5))) |
#define | csReport csReporterHelper::Report |
Helper macro to use a reporter easily. | |
#define | csReportV csReporterHelper::ReportV |
Helper macro to use a reporter easily. | |
Typedefs | |
typedef unsigned long | csStringID |
An identifier for a string. | |
typedef uint16 | utf16_char |
A single char in a UTF16 encoded string. | |
typedef uint32 | utf32_char |
A single char in a UTF32 encoded string. | |
typedef uint8 | utf8_char |
A single char in a UTF8 encoded string. | |
Enumerations | |
enum | { csUcMapSimple = (1 << 0) } |
Flags influencing the behaviour of MapToUpper, MapToLower and MapToFold. More... | |
enum | csDocumentNodeType { CS_NODE_DOCUMENT = 1, CS_NODE_ELEMENT, CS_NODE_COMMENT, CS_NODE_UNKNOWN, CS_NODE_TEXT, CS_NODE_DECLARATION } |
Possible node types for iDocumentNode. More... | |
enum | csVariantType { CSVAR_LONG, CSVAR_BOOL, CSVAR_CMD, CSVAR_FLOAT, CSVAR_STRING } |
Types that can be contained within a variant. More... | |
Functions | |
int | cs_asprintf (char **, const char *,...) |
Portable implementation of asprintf(). | |
int | cs_snprintf (char *buf, size_t bufSize, const char *format,...) |
Portable implementation of snprintf(). | |
int | cs_vasprintf (char **, const char *, va_list) |
Portable implementation of asprintf().
| |
int | cs_vsnprintf (char *, size_t, const char *, va_list) |
Portable implementation of vsnprintf(). | |
static float | csConvertEndian (float f) |
Convert bytes in a float value from host byte order to little-endian. | |
static uint16 | csConvertEndian (uint16 s) |
Convert a uint16 value from host byte order to little-endian. | |
static int16 | csConvertEndian (int16 s) |
Convert a int16 value from host byte order to little-endian. | |
static int32 | csConvertEndian (int32 l) |
Convert a int32 value from host byte order to little-endian. | |
static uint32 | csConvertEndian (uint32 l) |
Convert a uint32 value from host byte order to little-endian. | |
static int64 | csConvertEndian (int64 l) |
Convert a int64 value from host byte order to little-endian. | |
static uint64 | csConvertEndian (uint64 l) |
Convert a uint64 value from host byte order to little-endian. | |
char * | csExpandName (const char *iName) |
Expand a filename if it contains shortcuts. | |
int | csFindNearestPowerOf2 (int n) |
Finds the smallest number that is a power of two and is larger or equal to n. | |
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 . | |
float | csGetLittleEndianFloat16 (const void *buff) |
Read a little-endian 16-bit float from address. | |
float | csGetLittleEndianFloat32 (const void *buff) |
Read a little-endian 32-bit float from address. | |
uint32 | csGetLittleEndianLong (const void *buff) |
Read a little-endian long from address. | |
uint16 | csGetLittleEndianShort (const void *buff) |
Read a little-endian short from address. | |
bool | csGlobMatches (const char *fName, const char *fMask) |
Perform shell-like filename globbing (pattern matching). | |
bool | csIsPowerOf2 (int n) |
Returns true if n is a power of two. | |
static int | csLog2 (int n) |
Find the log2 of 32bit argument. | |
void | csReplaceAll (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 . | |
void | csSplitPath (const char *iPathName, char *oPath, size_t iPathSize, char *oName, size_t iNameSize) |
Split a pathname into separate path and name. | |
int | csStrCaseCmp (char const *str1, char const *str2) |
Perform case-insensitive string comparison. | |
int | csStrNCaseCmp (char const *str1, char const *str2, size_t n) |
Perform case-insensitive string comparison of the first n characters of str1 and str2 . | |
char * | csStrNew (const wchar_t *s) |
Allocate a new char [] and copy an UTF-8 version of the string into the newly allocated storage. | |
char * | csStrNew (const char *s) |
Allocate a new char [] and copy the string into the newly allocated storage. | |
wchar_t * | csStrNewW (const char *s) |
Allocate a new widechar [] and copy the string converted from UTF-8 into the newly allocated storage. | |
wchar_t * | csStrNewW (const wchar_t *s) |
Allocate a new widechar [] and the string into the newly allocated storage. | |
static void | csReporterHelper::Report (iObjectRegistry *reg, int severity, char const *msgId, char const *description,...) |
Helper function to use a reporter easily. | |
void | iReporter::ReportBug (const char *msgId, const char *description,...) |
Report bug. | |
void | iReporter::ReportDebug (const char *msgId, const char *description,...) |
Report debug. | |
void | iReporter::ReportError (const char *msgId, const char *description,...) |
Report error. | |
void | iReporter::ReportNotify (const char *msgId, const char *description,...) |
Report notification. | |
static void | csReporterHelper::ReportV (iObjectRegistry *reg, int severity, char const *msgId, char const *description, va_list args) |
Helper function to use a reporter easily. | |
void | iReporter::ReportWarning (const char *msgId, const char *description,...) |
Report warning. | |
Variables | |
csStringID const | csInvalidStringID = (csStringID) ~0 |
An invalid csStringID. |
Notes about string formatting in Crystal Space
printf()-style formatting in Crystal Space is usually backed by csPrintfFormatter<>, thus you can generally expect consistent behaviour for string formatting across all platforms supported by CS.The format specifiers supported by csPrintfFormatter<> are basically the same as supported by glibc. Some notable aspects are summed up here.
- For
size_t
,intmax_t
,ptrdiff_t
andlonglong
arguments, the 'z
', 'j
', 't
' and 'll
' modifiers are supported. - char* strings (
"%s"
) are expected to be UTF-8 encoded - likewise, char* formatting results will usually be encoded in UTF-8. - To format explicitly sized types (like
uint32
) the PRIX99 macros should be used, e.g.:
Define Documentation
|
Specify a 64 bit integer constant. Compilers differ in 64-bit wide number specification. Employ this macro to use the appropriate mechanism automatically. |
|
Specify 64 bit unsigned integer constant. Compilers differ in 64-bit wide number specification. Employ this macro to use the appropriate mechanism automatically. |
|
Helper macro to begin a bitmask-to-name table suitable for csBitmaskToString::GetStr();.
Definition at line 84 of file bitmasktostr.h. |
|
Helper macro to add an entry to a bitmask-to-name table that is a #define.
Definition at line 90 of file bitmasktostr.h. |
|
Value: {0, 0} \ }
Definition at line 93 of file bitmasktostr.h. |
|
The document can not be changed, CreateRoot() is not supported.
Definition at line 60 of file document.h. |
|
The document only allows changes with a newly created root.
Definition at line 62 of file document.h. |
|
The document can be changed.
Definition at line 64 of file document.h. |
|
supports Benchmark().
Definition at line 42 of file dbghelp.h. Referenced by csTiledCoverageBuffer::GetSupportedTests(), and csKDTree::GetSupportedTests(). |
|
supports graphical Dump().
Definition at line 50 of file dbghelp.h. Referenced by csTiledCoverageBuffer::GetSupportedTests(). |
|
supports StateTest().
Definition at line 54 of file dbghelp.h. Referenced by csKDTree::GetSupportedTests(). |
|
supports non graphical Dump().
Definition at line 46 of file dbghelp.h. Referenced by csTiledCoverageBuffer::GetSupportedTests(), and csKDTree::GetSupportedTests(). |
|
supports UnitTest().
Definition at line 38 of file dbghelp.h. Referenced by csTiledCoverageBuffer::GetSupportedTests(), csGeomDebugHelper::GetSupportedTests(), and csKDTree::GetSupportedTests(). |
|
Value: scfQueryInterfaceSafe<Interface>((object)->GetChild( \ scfInterfaceTraits<Interface>::GetID(), \ scfInterfaceTraits<Interface>::GetVersion())) The returned object will be IncRef'ed. This version requires a correctly set-up interface ID variable. |
|
Value: scfQueryInterfaceSafe<Interface>((object)->GetChild( \ scfInterfaceTraits<Interface>::GetID(), \ scfInterfaceTraits<Interface>::GetVersion(), \ name, true))
|
|
Value: scfQueryInterfaceSafe<Interface>((object)->GetChild( \ scfInterfaceTraits<Interface>::GetID(), \ scfInterfaceTraits<Interface>::GetVersion(), \ name)) The returned object will be IncRef'ed. |
|
Name of the token table initialization method. Can be overridden by the user by defining it prior to CS_TOKEN_LIST_TOKEN use. Definition at line 153 of file tokenlist.h. |
|
Name of the token table initialization method. Can be overridden by the user by defining it prior to CS_TOKEN_LIST_TOKEN use. Definition at line 148 of file tokenlist.h. |
|
BUG severity level. This is the worst thing that can happen. It means that some code detected a bug in Crystal Space. Definition at line 43 of file reporter.h. Referenced by iReporter::ReportBug(), and csReporterHelper::ReportV(). |
|
DEBUG severity level. This is for debugging and it will usually generate an entry in some log. Definition at line 69 of file reporter.h. Referenced by iReporter::ReportDebug(), and csReporterHelper::ReportV(). |
|
ERROR severity level. There was an error of some kind. Usually this is an error while reading data. Definition at line 50 of file reporter.h. Referenced by csDebugImageWriter::DebugImageWrite(), iReporter::ReportError(), csApplicationFramework::ReportError(), and csReporterHelper::ReportV(). |
|
NOTIFY severity level. Just a notification message. Definition at line 62 of file reporter.h. Referenced by csApplicationFramework::ReportInfo(), iReporter::ReportNotify(), and csReporterHelper::ReportV(). |
|
WARNING severity level. There was some condition which is non fatal but is suspicious. Definition at line 56 of file reporter.h. Referenced by csReporterHelper::ReportV(), iReporter::ReportWarning(), and csApplicationFramework::ReportWarning(). |
|
Name of the token table initialization method. Can be overridden by the user by defining it prior to CS_TOKEN_LIST_TOKEN use. Definition at line 123 of file tokenlist.h. |
|
Name of the token table initialization method. Can be overridden by the user by defining it prior to CS_TOKEN_LIST_TOKEN use. Definition at line 124 of file tokenlist.h. |
|
Value: s = #X; s.Downcase(); \ t.Register(s, CS_TOKEN_LIST_PASTE(CS_TOKEN_LIST_TOKEN_PREFIX,X));
Definition at line 144 of file tokenlist.h. |
|
A token list entry.
Definition at line 144 of file tokenlist.h. |
|
Name of the token table initialization method. Can be overridden by the user by defining it prior to CS_TOKEN_LIST_TOKEN use. Definition at line 127 of file tokenlist.h. |
|
Name for the "token count" enumeration value. Can be overridden by the user by defining it prior to CS_TOKEN_LIST_TOKEN use. Definition at line 116 of file tokenlist.h. |
|
Name of the token table initialization method. Can be overridden by the user by defining it prior to CS_TOKEN_LIST_TOKEN use. Definition at line 111 of file tokenlist.h. |
|
Prefix for the generated enumeration value. Can be overridden by the user by defining it prior to CS_TOKEN_LIST_TOKEN use. Definition at line 107 of file tokenlist.h. |
|
Name of the token table initialization method. Can be overridden by the user by defining it prior to CS_TOKEN_LIST_TOKEN use. Definition at line 102 of file tokenlist.h. |
|
Byte-order mark.
Definition at line 53 of file csunicode.h. |
|
First char in the "high surrogate" range.
Definition at line 71 of file csunicode.h. Referenced by csUnicodeTransform::EncodeUTF16(). |
|
Last char in the "high surrogate" range.
Definition at line 73 of file csunicode.h. |
|
First char in the "low surrogate" range.
Definition at line 75 of file csunicode.h. Referenced by csUnicodeTransform::EncodeUTF16(). |
|
Last char in the "low surrogate" range.
Definition at line 77 of file csunicode.h. |
|
Replacer char.
Definition at line 49 of file csunicode.h. |
|
Invalid char.
Definition at line 51 of file csunicode.h. |
|
Check whether a code is in the "high surrogate" range.
Definition at line 60 of file csunicode.h. Referenced by csUnicodeTransform::UTF16Decode(), csUnicodeTransform::UTF16Rewind(), and csUnicodeTransform::UTF16Skip(). |
|
Check whether a code is in the "low surrogate" range.
Definition at line 62 of file csunicode.h. Referenced by csUnicodeTransform::UTF16Decode(). |
|
Value: (((C) == CS_UC_INVALID) || \ ((C) == CS_UC_BOM) || \ (((C) >= 0xFDD0) && ((C) <= 0xFDEF)) \ || ((C) > CS_UC_LAST_CHAR))
Definition at line 65 of file csunicode.h. Referenced by csUnicodeTransform::EncodeUTF16(), csUnicodeTransform::EncodeUTF32(), csUnicodeTransform::EncodeUTF8(), csUnicodeTransform::UTF16Decode(), and csUnicodeTransform::UTF32Decode(). |
|
Check whether a code is in the "high" or "low surrogate" range.
Definition at line 58 of file csunicode.h. Referenced by csUnicodeTransform::EncodeUTF16(), csUnicodeTransform::EncodeUTF32(), csUnicodeTransform::EncodeUTF8(), csUnicodeTransform::UTF16Decode(), csUnicodeTransform::UTF16Rewind(), and csUnicodeTransform::UTF32Decode(). |
|
Highest valid Unicode codepoint.
Definition at line 55 of file csunicode.h. Referenced by csUnicodeTransform::EncodeUTF16(), csUnicodeTransform::EncodeUTF32(), csUnicodeTransform::EncodeUTF8(), and csUnicodeTransform::UTF32Decode(). |
|
A complex mapping (uppercase, lowercase, fold) for a Unicode code point expands to at maximum this number of code points.
Definition at line 50 of file csuctransform.h. |
|
An Unicode code point as UTF16 is at maximum encoded to this number of code units.
Definition at line 40 of file csuctransform.h. |
|
An Unicode code point as UTF32 is at maximum encoded to this number of code units.
Definition at line 45 of file csuctransform.h. |
|
An Unicode code point as UTF8 is at maximum encoded to this number of code units.
Definition at line 35 of file csuctransform.h. |
|
Helper macro to use a reporter easily.
Definition at line 383 of file reporter.h. |
|
Helper macro to use a reporter easily.
Definition at line 387 of file reporter.h. Referenced by csApplicationFramework::ReportError(), csApplicationFramework::ReportInfo(), and csApplicationFramework::ReportWarning(). |
Typedef Documentation
|
An identifier for a string. This identifier is equivalent to the contents of a string: If two strings have the same content, they have get the same identifier. If they have different content, they get different identifiers. |
|
A time value measured in milliseconds (1/1000 of a second). Ticks do not represent wall clock time or any other Epoch-based time. Instead, ticks are useful only for measuring differences between points on a timeline, or for specifying intervals. |
|
signed 16-bit integer (-32 768..32 767)
|
|
signed 32-bit integer (-2 147 483 648..2 147 483 647)
|
|
signed 64-bit integer
|
|
signed 8-bit integer (-128..127)
|
|
Greatest-width integer.
|
|
Integer at least as wide as a pointer.
|
|
Type to pass to cs_snprintf() as an argument to the "%lld" format specifier.
|
|
Difference of 2 pointers.
|
|
Shortcut for default unsigned int.
|
|
unsigned 16-bit integer (0..65 535)
|
|
unsigned 32-bit integer (0..4 294 967 295)
|
|
unsigned 64-bit integer
|
|
unsigned 8-bit integer (0..255)
|
|
Greatest-width unsigned integer.
|
|
Unsigned integer at least as wide as a pointer.
|
|
Type to pass to cs_snprintf() as an argument to the "%llu" format specifier.
|
|
A single char in a UTF16 encoded string.
Definition at line 42 of file csunicode.h. |
|
A single char in a UTF32 encoded string.
Definition at line 44 of file csunicode.h. |
|
A single char in a UTF8 encoded string.
Definition at line 40 of file csunicode.h. |
Enumeration Type Documentation
|
Flags influencing the behaviour of MapToUpper, MapToLower and MapToFold.
Definition at line 55 of file csuctransform.h. |
|
Name of the token table initialization method. Can be overridden by the user by defining it prior to CS_TOKEN_LIST_TOKEN use. Definition at line 130 of file tokenlist.h. |
|
Possible node types for iDocumentNode.
Definition at line 40 of file document.h. |
|
Types that can be contained within a variant.
Definition at line 30 of file pluginconfig.h. |
Function Documentation
|
Portable implementation of asprintf().
|
|
Name of the token table initialization method. Can be overridden by the user by defining it prior to CS_TOKEN_LIST_TOKEN use. Definition at line 156 of file tokenlist.h. |
|
Portable implementation of snprintf().
Referenced by csevJoystick(). |
|
Portable implementation of asprintf().
|
|
Portable implementation of vsnprintf().
|
|
Convert a big-endian floating-point number to machine format.
Definition at line 275 of file csendian.h. References csBigEndian::Convert(). |
|
Convert a long from big-endian to machine format.
Definition at line 267 of file csendian.h. References csBigEndian::Convert(). |
|
Convert a longlong from big-endian to machine format.
Definition at line 263 of file csendian.h. References csBigEndian::Convert(). |
|
Convert a short from big-endian to machine format.
Definition at line 271 of file csendian.h. References csBigEndian::Convert(). |
|
Convert bytes in a float value from host byte order to little-endian.
Definition at line 442 of file csendian.h. References csLittleEndianFloat(). |
|
Convert a uint16 value from host byte order to little-endian.
Definition at line 438 of file csendian.h. References csLittleEndianShort(). |
|
Convert a int16 value from host byte order to little-endian.
Definition at line 434 of file csendian.h. References csLittleEndianShort(). |
|
Convert a int32 value from host byte order to little-endian.
Definition at line 430 of file csendian.h. References csLittleEndianLong(). |
|
Convert a uint32 value from host byte order to little-endian.
Definition at line 426 of file csendian.h. References csLittleEndianLong(). |
|
Convert a int64 value from host byte order to little-endian.
Definition at line 422 of file csendian.h. References csLittleEndianLongLong(). |
|
Convert a uint64 value from host byte order to little-endian.
Definition at line 418 of file csendian.h. References csLittleEndianLongLong(). |
|
Implements a default run-loop for stand-alone applications. This function implements a run-loop for stand-alone applications which do not provide their own run-loop. You only need to call this function if your application does not otherwise implement its own run-loop. For example, an existing Microsoft Windows-based application will already have a run-loop which processes the Windows event-queue, among other tasks. Such an application should not call this function, since doing so would interrupt the existing run-loop and prevent it from running. For each iteration of the run-loop, this function increments the Crystal Space virtual clock (if it is present in the shared-object registry at the time of the call to this function) and processes the Crystal Space event queue (which must be present in the shared-object registry at the time of the call to this function). This function only returns after a csevBroadcast message has been received in the Crystal Space event queue with command code csevQuit. The return value of this function indicates whether or not the run-loop was actually able to run. If there was a problem starting the run-loop, then `false' is returned, otherwise `true' is returned. Referenced by csApplicationFramework::Run(). |
|
Convert a double to a cross-platform 64-bit format (no endianess adjustments!).
Definition at line 355 of file csendian.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
But, do not copy
Definition at line 211 of file util.h. References csReplaceAll(). |
|
Convert a float to a cross-platform 32-bit format (no endianess adjustments!).
Definition at line 320 of file csendian.h. References csQroundSure. |
|
Convert a float to a cross-platform 16-bit format (no endianess adjustments!).
Definition at line 392 of file csendian.h. References csQroundSure. |
|
CS version of fprintf (file, str, . ..). CS version of printf. It accepts UTF-8 strings and converts it, if required, to the platforms native codepage.
|
|
CS version of vfprintf (stderr, str, . ..). CS version of printf. It accepts UTF-8 strings and converts it, if required, to the platforms native codepage.
|
|
Get the installation path. This returns the path where the system has been installed to. It has a limited use because mostly everything should be done through VFS which is installation directory - independent; but some initialization tasks still need this. May return the empty string if unable to determine the installation path. |
|
Return a pointer to a symbol within given shared library. Note that generally Crystal Space needs just one exported symbol from every shared library; the symbol is called {library}_scfInitialize. If your OS is short on features, you may implement querying of just this symbol. |
|
Read a little-endian 16-bit float from address.
Definition at line 462 of file csendian.h. References csGetLittleEndianShort(), and csShortToFloat(). |
|
Read a little-endian 32-bit float from address.
Definition at line 458 of file csendian.h. References csGetLittleEndianLong(), and csLongToFloat(). |
|
Read a little-endian long from address.
Definition at line 452 of file csendian.h. References csLittleEndian::Convert(), and csGetFromAddress::UInt32(). Referenced by csGetLittleEndianFloat32(). |
|
Read a little-endian short from address.
Definition at line 446 of file csendian.h. References csLittleEndian::Convert(), and csGetFromAddress::UInt16(). Referenced by csGetLittleEndianFloat16(). |
|
Query if failed dynamic library loads generate verbose messages.
|
|
Get a platform-specific per-user config object. The data is stored in a platform-specific manner - e.g. in "Documents and Settings\Application Data" on Windows, or $HOME on Unix.
|
|
Get a platform-specific path to store per-user configuration data. The path is in a platform-specific place - e.g. in "Documents and Settings\Application Data" on Windows, or $HOME on Unix.
|
|
Retrive a plugin's metadata.
|
|
Get a list of directories where plugins are installed.
|
|
Get the current tick count. Warning! Do NOT use this function for controlling game logic speed. To do that you should use the virtual clock (iVirtualClock) which you can get from the object registry. By using the virtual clock it will be possible to control the speed of your game and also to pause it if needed. Referenced by csMeasureTime::csMeasureTime(), csMeasureTime::PrintIntermediate(), and csMeasureTime::~csMeasureTime(). |
|
Get the username of the account running the program. Returns the username of the owner of the process running the program. If the username can not be determined, then an empty string is returned. |
|
Perform shell-like filename globbing (pattern matching).
The special token
|
|
Returns true if n is a power of two.
|
|
Convert a little-endian floating-point number to machine format.
Definition at line 294 of file csendian.h. References csLittleEndian::Convert(). Referenced by csConvertEndian(). |
|
Convert a long from little-endian to machine format.
Definition at line 286 of file csendian.h. References csLittleEndian::Convert(). Referenced by csConvertEndian(). |
|
Convert a longlong from little-endian to machine format.
Definition at line 282 of file csendian.h. References csLittleEndian::Convert(). Referenced by csConvertEndian(). |
|
Convert a short from little-endian to machine format.
Definition at line 290 of file csendian.h. References csLittleEndian::Convert(). Referenced by csConvertEndian(). |
|
Load a shared library and return a library handle, which is used later to query and unload the library. iName is the FULL path to the library. |
|
Find the log2 of 32bit argument.
|
|
Convert a 64-bit cross-platform double to native format (no endianess adjustments!).
Definition at line 370 of file csendian.h. |
|
Convert a 32-bit cross-platform float to native format (no endianess adjustments!).
Definition at line 334 of file csendian.h. Referenced by csGetLittleEndianFloat32(). |
|
Definition at line 345 of file syspath.h. References csPathsUtilities::PathsIdentical(). |
|
Platform-specific shutdown. Some platforms on which Crystal Space runs need to perform their own shutdown processing. Typically, this function is automatically called by the higher-level csInitializer::DestroyApplication(), however if you are performing application shutdown manually, you should call it yourself. Returns `true' if shutdown processing was successful, otherwise `false'. |
|
Platform-specific startup. Some platforms on which Crystal Space runs need to perform their own startup processing. For instance, on some platforms, platform-specific "helper" objects may be placed in the shared-object registry for use by other platform-specific components. Typically, this function is automatically called by the higher-level csInitializer::CreateEnvironment(), however if you are performing application initialization manually, you should call it yourself. Returns `true' if startup initialization was successful, otherwise `false'. |
|
CS version of printf. It accepts UTF-8 strings and converts it, if required, to the platforms native codepage. Referenced by csMeasureTime::PrintIntermediate(), csReporterHelper::ReportV(), and csMeasureTime::~csMeasureTime(). |
|
CS version of fprintf (stderr, str, . ..). CS version of printf. It accepts UTF-8 strings and converts it, if required, to the platforms native codepage.
Referenced by csBlockAllocator< csBSPTree >::Alloc(), and csBlockAllocator< csBSPTree >::DestroyObject(). |
|
CS version of vfprintf (stderr, str, . ..). CS version of printf. It accepts UTF-8 strings and converts it, if required, to the platforms native codepage.
|
|
CS version of vprintf. CS version of printf. It accepts UTF-8 strings and converts it, if required, to the platforms native codepage. Referenced by csMeasureTime::PrintIntermediate(), and csReporterHelper::ReportV(). |
|
Print out the latest dynamic loader error. This is not strictly required (and on some platforms its just a empty routine) but sometimes it helps to find problems. |
|
Given
But, do not copy Referenced by csFindReplace(). |
|
Scan a given directory for plugins and return a list of the plugin native file names and their respective metadata.
|
|
Scan some given directories for plugins.
Accepts the same parameters as csScanPluginDir(), with the exception of |
|
Control whether dynamic library loading messages are verbose or terse. When verbose, and a library fails to load, csPrintLibraryError() is invoked to emit detailed diagnostic information regarding the failure. If terse, then a simple message is emitted stating that the library failed to load and instructing the user to use the -verbose command-line option for more details. Verbose messages are enabled by default for debug builds; terse messages for optimized builds. |
|
Convert a 16-bit cross-platform float to native format (no endianess adjustments!).
Definition at line 406 of file csendian.h. Referenced by csGetLittleEndianFloat16(). |
|
This function will freeze your application for given number of 1/1000 seconds. The function is very inaccurate, so don't use it for accurate timing. It may be useful when the application is idle, to explicitly release CPU for other tasks in multi-tasking operating systems. |
|
Split a pathname into separate path and name.
|
|
Perform case-insensitive string comparison.
Returns a negative number if Referenced by csStringArray::CaseInsensitiveCompare(), csStringBase::CompareNoCase(), csStringArray::FindCaseInsensitive(), CrystalSpace::DocumentHelper::NodeAttributeCompare::operator()(), and CrystalSpace::DocumentHelper::NodeNameCompare::operator()(). |
|
Perform case-insensitive string comparison of the first
Returns a negative number if the n-character prefix of Referenced by csStringBase::CompareNoCase(), csReporterHelper::ReportV(), and csStringBase::StartsWith(). |
|
Allocate a new char [] and copy an UTF-8 version of the string into the newly allocated storage.
|
|
Allocate a new char [] and copy the string into the 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 csStringArrayElementHandler::Construct(), csPluginLoadRec::csPluginLoadRec(), csStrKey::csStrKey(), csWtoC::csWtoC(), csStringFast< LEN >::Detach(), DirectDetectionDevice::DirectDetectionDevice(), csStrKey::operator=(), csImageBase::SetName(), and csVariant::SetString(). |
|
Allocate a new widechar [] and copy the string converted from UTF-8 into the newly allocated storage.
|
|
Allocate a new widechar [] and the string into the newly allocated storage.
Referenced by csCtoW::csCtoW(). |
|
Unload a shared library given its handle. The function returns false on error. |
|
Helper function to use a reporter easily. This function will also work if no reporter is present and use stdout in that case.
Definition at line 369 of file reporter.h. References csReporterHelper::ReportV(). |
|
Report bug.
Definition at line 282 of file reporter.h. References CS_REPORTER_SEVERITY_BUG. |
|
Report debug.
Definition at line 291 of file reporter.h. References CS_REPORTER_SEVERITY_DEBUG. |
|
Report error.
Definition at line 255 of file reporter.h. References CS_REPORTER_SEVERITY_ERROR. |
|
Report notification.
Definition at line 273 of file reporter.h. References CS_REPORTER_SEVERITY_NOTIFY. |
|
Helper function to use a reporter easily. This function will also work if no reporter is present and use stdout in that case.
Definition at line 330 of file reporter.h. References CS_ANSI_BK, CS_ANSI_FI, CS_ANSI_FM, CS_ANSI_FR, CS_ANSI_FW, CS_ANSI_FY, CS_ANSI_RST, CS_QUERY_REGISTRY, CS_REPORTER_SEVERITY_BUG, CS_REPORTER_SEVERITY_DEBUG, CS_REPORTER_SEVERITY_ERROR, CS_REPORTER_SEVERITY_NOTIFY, CS_REPORTER_SEVERITY_WARNING, csPrintf(), csPrintfV(), and csStrNCaseCmp(). Referenced by csReporterHelper::Report(). |
|
Report warning.
Definition at line 264 of file reporter.h. References CS_REPORTER_SEVERITY_WARNING. |
Variable Documentation
|
An invalid csStringID.
Definition at line 38 of file strset.h. Referenced by csStringHash::Contains(), csGetShaderVariableFromStack(), and csSimpleRenderMesh::csSimpleRenderMesh(). |
Generated for Crystal Space by doxygen 1.4.6