Utilities (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

Classes | Namespaces | Modules | Defines | Typedefs | Enumerations | Functions | Variables
Utilities

## 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...
struct | csOptionDescription
| Description of a configuration option, to be used by the iPluginConfig interfaces. 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, ie a value whose type 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 | iConfigListener
| Configuration listener interface. More...
struct | iConfigManager
| The configuration manager is used to make a number of iConfigFile object appear like a single object. More...
struct | iConfigNotifier
| Configuration notifier interface. 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 | 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 | 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
| General string ID string set. More...
struct | iStringSetBase< Tag >
| The string set is a collection of unique strings. More...
class | CS::MeasureTime
| Simple helper class to measure execution time of a block. More...
## Namespaces
namespace | CS
| Main namespace for CrystalSpace.
## Modules
| Containers
| Memory Management
## 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) (CS_GET_CHILD_OBJECT_is_deprecated<Interface> (Object))
#define | CS_GET_FIRST_NAMED_CHILD_OBJECT(Object, Interface, Name) (CS_GET_FIRST_NAMED_CHILD_OBJECT_is_deprecated<Interface> (Object, Name))
#define | CS_GET_NAMED_CHILD_OBJECT(Object, Interface, Name) (CS_GET_NAMED_CHILD_OBJECT_is_deprecated<Interface> (Object, Name))
#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 /* 6 to encode 32 bit */
| An Unicode code point as UTF8 is at maximum encoded to this number of code units.
#define | csReport csReporterHelper::Report
| Helper macro to use a reporter easily.
#define | csReportV csReporterHelper::ReportV
| Helper macro to use a reporter easily.
## Typedefs
typedef CS::StringID < CS::StringSetTag::General > | csStringID
| General string ID.
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 }
| Type of the values that can be contained within a csVariant. 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 vasprintf().
int | cs_vsnprintf (char *, size_t, const char *, va_list)
| Portable implementation of vsnprintf()
static int64 | csDoubleToLongLong (double d)
| Convert a double to a cross-platform 64-bit format (no endianess adjustments!)
char * | csExpandName (const char *iName)
| Expand a filename if it contains shortcuts.
static int | csFindNearestPowerOf2 (int n)
| Finds the smallest number that is a power of two and is larger or equal to n.
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!)
bool | csGlobMatches (const char *fName, const char *fMask)
| Perform shell-like filename globbing (pattern matching).
static bool | csIsPowerOf2 (int n)
| Returns true if n is a power of two.
int | csLog2 (int n)
| Find the log2 of 32bit argument.
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!)
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`.
static float | csShortToFloat (short s)
| Convert a 16-bit cross-platform float to native format (no endianess adjustments!)
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 char *s)
| Allocate a new char [] and copy the string into the newly allocated storage.
char * | csStrNew (const wchar_t *s)
| Allocate a new char [] and copy an UTF-8 version of the string into the newly allocated storage.
wchar_t * | csStrNewW (const wchar_t *s)
| Allocate a new widechar [] 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.
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 = CS::InvalidStringID<CS::StringSetTag::General> ()
| Invalid string ID.
## 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. The code generated by the macros has a dependency on csString, thus the <csutil/csstring.h> header must be included in files that use the token list helpers. Example (from a real-world use): fire.tok:
     CS_TOKEN_LIST_TOKEN(PALETTE)
     ...
fire.h:
     #include <csutil/csstring.h>

     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;
       }
     // ...
     }
enum |
static void | csShaderProgram::CS_INIT_TOKEN_TABLE_NAME (csStringHash &t)
## 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. The code generated by the macros has a dependency on csString, thus the <csutil/csstring.h> header must be included in files that use the token list helpers. Example (from a real-world use): fire.tok:
     CS_TOKEN_LIST_TOKEN(PALETTE)
     ...
fire.h:
     #include <csutil/csstring.h>

     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;
       }
     // ...
     }
enum |
| A token list entry. More...
static void | CS_INIT_TOKEN_TABLE_NAME (csStringHash &t)
| A token list entry.
#define | CS_TOKEN_LIST_PASTE(X, Y) CS_TOKEN_LIST_PASTE1(X,Y)
| A token list entry.
#define | CS_TOKEN_LIST_PASTE1(X, Y) X ## Y
| 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(X)
| A token list entry.
#define | CS_TOKEN_LIST_TOKEN_FINAL(X) CS_TOKEN_LIST_PASTE(CS_TOKEN_LIST_TOKEN_PREFIX,X)
| A token list entry.
#define | CS_INIT_TOKEN_TABLE_NAME_DEFAULT
| A token list entry.
#define | CS_INIT_TOKEN_TABLE_NAME InitTokenTable
| Name of the token table initialization method.
## 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.
typedef uint8_t | uint8
typedef int8_t | int8
typedef uint16_t | uint16
typedef int16_t | int16
typedef uint32_t | uint32
typedef int32_t | int32
typedef uint64_t | uint64
typedef int64_t | int64
#define | CONST_INT64(x) x ## LL
#define | CONST_UINT64(x) x ## ULL
## Other types
typedef long long | longlong
| Type to pass to cs_snprintf() as an argument to the "%lld" format specifier.
typedef unsigned long long | ulonglong
| Type to pass to cs_snprintf() as an argument to the "%llu" format specifier.
typedef unsigned int | csTicks
| A time value measured in milliseconds (1/1000 of a second).
typedef unsigned int | uint
| Shortcut for default unsigned int.
## Low-level shared library support
typedef void * | csLibraryHandle
| Load a shared library and return a library handle, which is used later to query and unload the library.
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 * | csGetLibrarySymbol (csLibraryHandle Handle, char const *iName)
| Return a pointer to a symbol within given shared library.
bool | csUnloadLibrary (csLibraryHandle Handle)
| Unload a shared library given its handle.
void | csPrintLibraryError (char const *iModule)
| Print out the latest dynamic loader error.
void | csSetLoadLibraryVerbose (bool)
| Control whether dynamic library loading messages are verbose or terse.
bool | csGetLoadLibraryVerbose ()
| Query if failed dynamic library loads generate verbose messages.
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.
csRef< iString > | csGetPluginMetadata (const char *fullPath, csRef< iDocument > &metadata)
| Retrive a plugin's metadata.
## Special character codes
#define | CS_UC_CHAR_REPLACER 0xFFFD
| Replacer char.
#define | CS_UC_INVALID 0xFFFF
| Invalid char.
#define | CS_UC_BOM 0xFFFE
| Byte-order mark.
#define | CS_UC_LAST_CHAR 0x10FFFF
| Highest valid Unicode codepoint.
#define | CS_UC_IS_SURROGATE(C) (((C) & 0xFFFFF800) == 0x0000D800)
| Check whether a code is in the "high" or "low surrogate" range.
#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_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.
## System functions
bool | csDefaultRunLoop (iObjectRegistry *)
| Implements a default run-loop for stand-alone applications.
bool | csPlatformStartup (iObjectRegistry *)
| Platform-specific startup.
bool | csPlatformShutdown (iObjectRegistry *)
| Platform-specific shutdown.
int | csPrintf (const char *str,...)
| CS version of printf.
int | csPrintfV (const char *str, va_list arg)
| CS version of vprintf.
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, ...).
int | csPrintfErrV (const char *str, va_list arg)
| CS version of vfprintf (stderr, str, ...).
int | csPrintfErr (const char *str,...)
| CS version of fprintf (stderr, str, ...).
csTicks | csGetTicks ()
| Get the current tick count.
int64 | csGetMicroTicks ()
| Get the current elapsed time in microseconds (us).
void | csSleep (int)
| This function will freeze your application for given number of 1/1000 seconds.
csString | csGetUsername ()
| Get the username of the account running the program.
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.
## Helpers to deal with native paths
csString | csGetConfigPath ()
| Get the installation path.
csPathsList * | csGetPluginPaths (const char *argv0)
| Get a list of directories where plugins are installed.
## iDebugHelper implementation support flags
enum | { CS_DBGHELP_BENCHMARK = 0x1, CS_DBGHELP_TXTDUMP = 0x2, CS_DBGHELP_GFXDUMP = 0x4, CS_DBGHELP_STATETEST = 0x8 }
## 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.
## iReporter severity levels
#define | CS_REPORTER_SEVERITY_BUG 0
| BUG severity level.
#define | CS_REPORTER_SEVERITY_ERROR 1
| ERROR severity level.
#define | CS_REPORTER_SEVERITY_WARNING 2
| WARNING severity level.
#define | CS_REPORTER_SEVERITY_NOTIFY 3
| NOTIFY severity level.
#define | CS_REPORTER_SEVERITY_DEBUG 4
| DEBUG severity level.

### 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` and `longlong` 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.:

         uint16 myUI16 = 0xabcd;
         csPrintf ("%" PRIu16, myUI16);

## Define Documentation

#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();.

Definition at line 84 of file bitmasktostr.h.

#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.

Definition at line 90 of file bitmasktostr.h.

#define CS_BITMASKTOSTR_MASK_TABLE_END

Value:

    {0, 0}                                                \
      }

Helper macro to enf a bitmask-to-name table.

Definition at line 93 of file bitmasktostr.h.

#define CS_CHANGEABLE_NEVER 0

The document can not be changed, CreateRoot() is not supported.

Definition at line 60 of file document.h.

#define CS_CHANGEABLE_NEWROOT 1

The document only allows changes with a newly created root.

Definition at line 62 of file document.h.

#define CS_CHANGEABLE_YES 2

The document can be changed.

Definition at line 64 of file document.h.

#define CS_GET_CHILD_OBJECT | ( |  | Object,
|  |  | Interface
| ) |  | (CS_GET_CHILD_OBJECT_is_deprecated<Interface> (Object))

Deprecated:
  Compatibility macro.

Use CS::GetChildObject() instead

See also:
  CS::GetChildObject

Definition at line 217 of file object.h.

#define CS_GET_FIRST_NAMED_CHILD_OBJECT | ( |  | Object,
|  |  | Interface,
|  |  | Name
| ) |  | (CS_GET_FIRST_NAMED_CHILD_OBJECT_is_deprecated<Interface> (Object, Name))

Deprecated:
  Compatibility macro.

Use CS::GetNamedChildObject() instead

See also:
  CS::GetNamedChildObject

Definition at line 248 of file object.h.

#define CS_GET_NAMED_CHILD_OBJECT | ( |  | Object,
|  |  | Interface,
|  |  | Name
| ) |  | (CS_GET_NAMED_CHILD_OBJECT_is_deprecated<Interface> (Object, Name))

Deprecated:
  Compatibility macro.

Use iObject->GetChild() and scfQueryInterface().

See also:
  iObject::GetChild

Definition at line 233 of file object.h.

#define CS_INIT_TOKEN_TABLE_NAME InitTokenTable

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 160 of file tokenlist.h.

#define CS_INIT_TOKEN_TABLE_NAME_DEFAULT

A token list entry.

Definition at line 155 of file tokenlist.h.

#define CS_REPORTER_SEVERITY_BUG 0

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 45 of file reporter.h.

#define CS_REPORTER_SEVERITY_DEBUG 4

DEBUG severity level.

This is for debugging and it will usually generate an entry in some log.

Definition at line 71 of file reporter.h.

#define CS_REPORTER_SEVERITY_ERROR 1

ERROR severity level.

There was an error of some kind. Usually this is an error while reading data.

Definition at line 52 of file reporter.h.

#define CS_REPORTER_SEVERITY_NOTIFY 3

NOTIFY severity level.

Just a notification message.

Definition at line 64 of file reporter.h.

#define CS_REPORTER_SEVERITY_WARNING 2

WARNING severity level.

There was some condition which is non fatal but is suspicious.

Definition at line 58 of file reporter.h.

#define CS_TOKEN_LIST_PASTE | ( |  | X,
|  |  | Y
| ) |  | CS_TOKEN_LIST_PASTE1(X,Y)

A token list entry.

Definition at line 130 of file tokenlist.h.

#define CS_TOKEN_LIST_PASTE1 | ( |  | X,
|  |  | Y
| ) |  | X ## Y

A token list entry.

Definition at line 131 of file tokenlist.h.

#define CS_TOKEN_LIST_TOKEN | ( |  | X | ) | CS_TOKEN_LIST_PASTE(CS_TOKEN_LIST_TOKEN_PREFIX,X),

A token list entry.

Definition at line 151 of file tokenlist.h.

#define CS_TOKEN_LIST_TOKEN | ( |  | X | ) |

Value:

    s = #X; s.Downcase(); \
      t.Register(s, CS_TOKEN_LIST_PASTE(CS_TOKEN_LIST_TOKEN_PREFIX,X));

A token list entry.

Definition at line 151 of file tokenlist.h.

#define CS_TOKEN_LIST_TOKEN_FINAL | ( |  | X | ) | CS_TOKEN_LIST_PASTE(CS_TOKEN_LIST_TOKEN_PREFIX,X)

A token list entry.

Definition at line 134 of file tokenlist.h.

#define CS_UC_BOM 0xFFFE

Byte-order mark.

Definition at line 53 of file csunicode.h.

#define CS_UC_CHAR_HIGH_SURROGATE_FIRST 0xD800

First char in the "high surrogate" range.

Definition at line 71 of file csunicode.h.

#define CS_UC_CHAR_HIGH_SURROGATE_LAST 0xDBFF

Last char in the "high surrogate" range.

Definition at line 73 of file csunicode.h.

#define CS_UC_CHAR_LOW_SURROGATE_FIRST 0xDC00

First char in the "low surrogate" range.

Definition at line 75 of file csunicode.h.

#define CS_UC_CHAR_LOW_SURROGATE_LAST 0xDFFF

Last char in the "low surrogate" range.

Definition at line 77 of file csunicode.h.

#define CS_UC_CHAR_REPLACER 0xFFFD

Replacer char.

Definition at line 49 of file csunicode.h.

#define CS_UC_INVALID 0xFFFF

Invalid char.

Definition at line 51 of file csunicode.h.

#define CS_UC_IS_HIGH_SURROGATE | ( |  | C | ) | (((C) & 0xFFFFFC00) == 0x0000DC00)

Check whether a code is in the "high surrogate" range.

Definition at line 60 of file csunicode.h.

#define CS_UC_IS_LOW_SURROGATE | ( |  | C | ) | (((C) & 0xFFFFFC00) == 0x0000D800)

Check whether a code is in the "low surrogate" range.

Definition at line 62 of file csunicode.h.

#define CS_UC_IS_NONCHARACTER | ( |  | C | ) |

Value:

    (((C) == CS_UC_INVALID) || \
                                             ((C) == CS_UC_BOM) || \
                                             (((C) >= 0xFDD0) && ((C) <= 0xFDEF)) \
                                             || ((C) > CS_UC_LAST_CHAR))

Test whether a code point is a Unicode noncharacter.

Definition at line 65 of file csunicode.h.

#define CS_UC_IS_SURROGATE | ( |  | C | ) | (((C) & 0xFFFFF800) == 0x0000D800)

Check whether a code is in the "high" or "low surrogate" range.

Definition at line 58 of file csunicode.h.

#define CS_UC_LAST_CHAR 0x10FFFF

Highest valid Unicode codepoint.

Definition at line 55 of file csunicode.h.

#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.

Definition at line 61 of file csuctransform.h.

#define CS_UC_MAX_UTF16_ENCODED 2

An Unicode code point as UTF16 is at maximum encoded to this number of code units.

Definition at line 40 of file csuctransform.h.

#define CS_UC_MAX_UTF32_ENCODED 1

An Unicode code point as UTF32 is at maximum encoded to this number of code units.

Definition at line 45 of file csuctransform.h.

#define CS_UC_MAX_UTF8_ENCODED 4 /* 6 to encode 32 bit */

An Unicode code point as UTF8 is at maximum encoded to this number of code units.

Definition at line 35 of file csuctransform.h.

#define csReport csReporterHelper::Report

Helper macro to use a reporter easily.

Definition at line 385 of file reporter.h.

#define csReportV csReporterHelper::ReportV

Helper macro to use a reporter easily.

Definition at line 389 of file reporter.h.

## Typedef Documentation

typedef void* csLibraryHandle

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.

Definition at line 42 of file csshlib.h.

typedef CS::StringID<CS::StringSetTag::General> csStringID

General string ID.

Definition at line 205 of file strset.h.

typedef unsigned int csTicks

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.

Definition at line 230 of file cstypes.h.

typedef long long longlong

Type to pass to cs_snprintf() as an argument to the "%lld" format specifier.

Definition at line 202 of file cstypes.h.

typedef unsigned int uint

Shortcut for default unsigned int.

Definition at line 233 of file cstypes.h.

typedef unsigned long long ulonglong

Type to pass to cs_snprintf() as an argument to the "%llu" format specifier.

Definition at line 206 of file cstypes.h.

typedef uint16 utf16_char

A single char in a UTF16 encoded string.

Definition at line 42 of file csunicode.h.

typedef uint32 utf32_char

A single char in a UTF32 encoded string.

Definition at line 44 of file csunicode.h.

typedef uint8 utf8_char

A single char in a UTF8 encoded string.

Definition at line 40 of file csunicode.h.

## Enumeration Type Documentation

anonymous enum

Enumerator:

  CS_DBGHELP_BENCHMARK | Supports Benchmark()
  CS_DBGHELP_TXTDUMP | Supports non graphical Dump().
  CS_DBGHELP_GFXDUMP | Supports graphical Dump().
  CS_DBGHELP_STATETEST | Supports StateTest().

Definition at line 35 of file dbghelp.h.

anonymous enum

A token list entry.

Definition at line 137 of file tokenlist.h.

anonymous enum

Flags influencing the behaviour of MapToUpper, MapToLower and MapToFold.

Enumerator:

  csUcMapSimple | Force 'simple' mappings, that is, at most one code point is returned. The default 'complex' mappings can return more than one code point in some cases. See also: CS_UC_MAX_MAPPED

Definition at line 66 of file csuctransform.h.

enum csDocumentNodeType

Possible node types for iDocumentNode.

Enumerator:

  CS_NODE_DOCUMENT | Document.
  CS_NODE_ELEMENT | Element.
  CS_NODE_COMMENT | Comment.
  CS_NODE_UNKNOWN | Unknown type.
  CS_NODE_TEXT | Text.
  CS_NODE_DECLARATION | Declaration.

Definition at line 40 of file document.h.

enum csVariantType

Type of the values that can be contained within a csVariant.

Enumerator:

  CSVAR_LONG | Long type, obviously also valid for integers.
  CSVAR_BOOL | Boolean type.
  CSVAR_CMD | A command. A command has no value, it is just a flag which can be set or not.
  CSVAR_FLOAT | Float type.
  CSVAR_STRING | String type.

Definition at line 31 of file pluginconfig.h.

## Function Documentation

int cs_asprintf | ( | char ** | ,
|  | const char * | ,
|  |  | ...
| ) |  |

Portable implementation of asprintf().

Remarks:
  Like asprintf(), the string was allocated with cs_malloc() and needs to be cs_freed with cs_free().

See also:
  Notes about string formatting in Crystal Space

static void CS_INIT_TOKEN_TABLE_NAME | ( | csStringHash & | t | ) | `[static]`

A token list entry.

Definition at line 163 of file tokenlist.h.

int cs_snprintf | ( | char * | buf,
|  | size_t | bufSize,
|  | const char * | format,
|  |  | ...
| ) |  |

Portable implementation of snprintf()

See also:
  Notes about string formatting in Crystal Space

int cs_vasprintf | ( | char ** | ,
|  | const char * | ,
|  | va_list |
| ) |  |

Portable implementation of vasprintf().

Portable implementation of asprintf().

Remarks:
  Like asprintf(), the string was allocated with cs_malloc() and needs to be cs_freed with cs_free().

See also:
  Notes about string formatting in Crystal Space

See also:
  Notes about string formatting in Crystal Space

int cs_vsnprintf | ( | char * | ,
|  | size_t | ,
|  | const char * | ,
|  | va_list |
| ) |  |

Portable implementation of vsnprintf()

See also:
  Notes about string formatting in Crystal Space

bool csDefaultRunLoop | ( | iObjectRegistry * |  | ) |

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.

static int64 csDoubleToLongLong | ( | double | d | ) | `[inline, static]`

Convert a double to a cross-platform 64-bit format (no endianess adjustments!)

Deprecated:
  Deprecated in 2.0.

Use csIEEEfloat methods instead.

Definition at line 482 of file csendian.h.

char* csExpandName | ( | const char * | iName | ) |

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().

static int csFindNearestPowerOf2 | ( | int | n | ) | `[inline, static]`

Finds the smallest number that is a power of two and is larger or equal to n.

Definition at line 246 of file util.h.

static int32 csFloatToLong | ( | float | f | ) | `[inline, static]`

Convert a float to a cross-platform 32-bit format (no endianess adjustments!)

Deprecated:
  Deprecated in 2.0.

Use csIEEEfloat methods instead.

Definition at line 443 of file csendian.h.

static short csFloatToShort | ( | float | f | ) | `[inline, static]`

Convert a float to a cross-platform 16-bit format (no endianess adjustments!)

Deprecated:
  Deprecated in 2.0.

Use csIEEEfloat methods instead.

Definition at line 523 of file csendian.h.

int csFPrintf | ( | FILE * | file,
|  | const char * | str,
|  |  | ...
| ) |  |

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.

See also:
  Notes about string formatting in Crystal Space

Remarks:
  Will not flush file.

See also:
  Notes about string formatting in Crystal Space

int csFPrintfV | ( | FILE * | file,
|  | const char * | str,
|  | va_list | arg
| ) |  |

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.

See also:
  Notes about string formatting in Crystal Space

Remarks:
  Will not flush file.

See also:
  Notes about string formatting in Crystal Space

csString csGetConfigPath | ( |  | ) |

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.

void* csGetLibrarySymbol | ( | csLibraryHandle | Handle,
|  | char const * | iName
| ) |  |

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.

bool csGetLoadLibraryVerbose | ( |  | ) |

Query if failed dynamic library loads generate verbose messages.

int64 csGetMicroTicks | ( |  | ) |

Get the current elapsed time in microseconds (us).

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.

The first call to this or csGetTicks() must complete before multiple threads may call this function.

csPtr<iConfigFile> csGetPlatformConfig | ( | const char * | key | ) |

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.

Parameters:

  key | Used to distinguish different stored configurations. Should be the application ID, e.g. "MyGames.ClickFrenzy2".

Returns:
  A config 'file'. Might return 0 on some platforms or in case an error occured.

csString csGetPlatformConfigPath | ( | const char * | key,
|  | bool | local = `false`
| ) |  |

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.

Parameters:

  key | Used to distinguish different stored configurations. Should be the application ID, e.g. "MyGames.ClickFrenzy2".
  local | Some platforms also support "local" per-user configuration data, that is, when the per-user data is roamed over the network, such local data is still stored on the local machine(s). While unsuitable for for actual configuration data, it is useful e.g. in case the application does caching of some data on disk, and storing such data locally would reduce the network load in case the per-user data is roamed.

Returns:
  A native path suitable to store per-user configuration data, in the form of e.g. "...\MyGames\ClickFrenzy2". The path could then be used as a directory name or a base for a file name.

Remarks:
  The returned path may not exist. The caller has to ensure its existance before using it.

csRef<iString> csGetPluginMetadata | ( | const char * | fullPath,
|  | csRef< iDocument > & | metadata
| ) |  |

Retrive a plugin's metadata.

Remarks:
  ``fullPath'` should be either a string returned from csScanPluginDir() or csScanPluginDirs(), or a fully qualified native path of the plugin module. The path suffix should be either .csplugin if the plugin metadata is stored in an external .csplugin file, or it should be the standard suffix of shared libraries or bundles for the platform (for example, .so for Unix; .dll for Windows). If metadata is retrieved successfully for the specified plugin module, metadata.IsValid() will return true, and the `metadata' argument will reference an iDocument containing the data. If no metadata is located or an error occurrs while attempting to retrieve the metadata, metadata.IsValid() return false. If some type of reportable error or warning is encountered, it will be returned from the function as an iString. It is possible for a warning to be issued even if metadata was successfully retrieved. Finally, if metadata.IsValid() returns false and the returned iString is empty, then that indicates simply that the specified path does not correspond to a Crystal Space plugin module. This is a valid condition.

csPathsList* csGetPluginPaths | ( | const char * | argv0 | ) |

Get a list of directories where plugins are installed.

Remarks:
  Caller is responsible to free the list with delete after using it.

csTicks csGetTicks | ( |  | ) |

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.

csString csGetUsername | ( |  | ) |

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.

bool csGlobMatches | ( | const char * | fName,
|  | const char * | fMask
| ) |  |

Perform shell-like filename globbing (pattern matching).

The special token `*` matches zero or more characters, and the token ``? matches exactly one character. Examples: "*a*.txt", "*a?b*", "*" Character-classes ``[a-z] are not understood by this function.

Remarks:
  If you want case-insensitive comparison, convert `fName` and `fMask` to upper- or lower-case first.

static bool csIsPowerOf2 | ( | int | n | ) | `[inline, static]`

Returns true if n is a power of two.

Definition at line 262 of file util.h.

csLibraryHandle csLoadLibrary | ( | char const * | iName | ) |

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.

int csLog2 | ( | int | n | ) |

Find the log2 of 32bit argument.

static double csLongLongToDouble | ( | int64 | i | ) | `[inline, static]`

Convert a 64-bit cross-platform double to native format (no endianess adjustments!)

Deprecated:
  Deprecated in 2.0.

Use csIEEEfloat methods instead.

Definition at line 499 of file csendian.h.

static float csLongToFloat | ( | int32 | l | ) | `[inline, static]`

Convert a 32-bit cross-platform float to native format (no endianess adjustments!)

Deprecated:
  Deprecated in 2.0.

Use csIEEEfloat methods instead.

Definition at line 459 of file csendian.h.

bool csPlatformShutdown | ( | iObjectRegistry * |  | ) |

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'.

bool csPlatformStartup | ( | iObjectRegistry * |  | ) |

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'.

int csPrintf | ( | const char * | str,
|  |  | ...
| ) |  |

CS version of printf.

It accepts UTF-8 strings and converts it, if required, to the platforms native codepage.

See also:
  Notes about string formatting in Crystal Space

int csPrintfErr | ( | const char * | str,
|  |  | ...
| ) |  |

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.

See also:
  Notes about string formatting in Crystal Space

Remarks:
  Will flush stderr.

See also:
  Notes about string formatting in Crystal Space

int csPrintfErrV | ( | const char * | str,
|  | va_list | arg
| ) |  |

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.

See also:
  Notes about string formatting in Crystal Space

Remarks:
  Will flush stderr.

See also:
  Notes about string formatting in Crystal Space

int csPrintfV | ( | const char * | str,
|  | va_list | arg
| ) |  |

CS version of vprintf.

CS version of printf.

It accepts UTF-8 strings and converts it, if required, to the platforms native codepage.

See also:
  Notes about string formatting in Crystal Space

See also:
  Notes about string formatting in Crystal Space

void csPrintLibraryError | ( | char const * | iModule | ) |

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.

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`.

But, do not copy `search`, instead replace that with `replace` string. `max` is size in bytes of `dest`.

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.

Parameters:

  dir | Directory to scan.
  plugins | Native file names.
  recursive | Recursively scan all subdirectories.

Remarks:
  It is the responsibility of the caller to do any cleaning of `metadata` and `plugins`, if desired.
  `plugins` can be 0, a string vector will be created in this case.

Returns:
  If any errors occured, a vector of error descriptions.

csRef<iStringArray> csScanPluginDirs | ( | csPathsList * | dirs,
|  | csRef< iStringArray > & | plugins
| ) |  |

Scan some given directories for plugins.

Accepts the same parameters as csScanPluginDir(), with the exception of `dirs`.

void csSetLoadLibraryVerbose | ( | bool |  | ) |

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.

static float csShortToFloat | ( | short | s | ) | `[inline, static]`

Convert a 16-bit cross-platform float to native format (no endianess adjustments!)

Deprecated:
  Deprecated in 2.0.

Use csIEEEfloat methods instead.

Definition at line 539 of file csendian.h.

void csSleep | ( | int |  | ) |

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.

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.

Returns a negative number if `str1` is less than `str2`, zero if they are equal, or a positive number if `str1` is greater than `str2`. For best portability, use function rather than strcasecmp() or stricmp().

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`.

Returns a negative number if the n-character prefix of `str1` is less than `str2`, zero if they are equal, or a positive number if the prefix of `str1` is greater than `str2`. For best portability, use function rather than strncasecmp() or strnicmp().

char* csStrNew | ( | const char * | s | ) | `[inline]`

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[].

See also:
  CS::StrDup which is slightly more efficient

Definition at line 75 of file util.h.

char* csStrNew | ( | const wchar_t * | s | ) | `[inline]`

Allocate a new char [] and copy an UTF-8 version of the string into the newly allocated storage.

See also:
  csStrNew(const char*)
  CS::StrDup which is slightly more efficient

Definition at line 89 of file util.h.

wchar_t* csStrNewW | ( | const wchar_t * | s | ) | `[inline]`

Allocate a new widechar [] and copy the string into the newly allocated storage.

See also:
  csStrNew(const char*)
  CS::StrDupW which is slightly more efficient

Definition at line 105 of file util.h.

wchar_t* csStrNewW | ( | const char * | s | ) | `[inline]`

Allocate a new widechar [] and copy the string converted from UTF-8 into the newly allocated storage.

See also:
  csStrNew(const char*)
  CS::StrDupW which is slightly more efficient

Definition at line 119 of file util.h.

bool csUnloadLibrary | ( | csLibraryHandle | Handle | ) |

Unload a shared library given its handle.

The function returns false on error.

void csReporterHelper::Report | ( | iObjectRegistry * | reg,
|  | int | severity,
|  | char const * | msgId,
|  | char const * | description,
|  |  | ...
| ) |  | `[inline, static]`

Helper function to use a reporter easily.

This function will also work if no reporter is present and use stdout in that case.

Remarks:
  You can use the csReport macro for even more convenience.

See also:
  Notes about string formatting in Crystal Space

Definition at line 371 of file reporter.h.

void iReporter::ReportBug | ( | const char * | msgId,
|  | const char * | description,
|  |  | ...
| ) |  | `[inline]`

Report bug.

See also:
  Notes about string formatting in Crystal Space

Definition at line 284 of file reporter.h.

void iReporter::ReportDebug | ( | const char * | msgId,
|  | const char * | description,
|  |  | ...
| ) |  | `[inline]`

Report debug.

See also:
  Notes about string formatting in Crystal Space

Definition at line 293 of file reporter.h.

void iReporter::ReportError | ( | const char * | msgId,
|  | const char * | description,
|  |  | ...
| ) |  | `[inline]`

Report error.

See also:
  Notes about string formatting in Crystal Space

Definition at line 257 of file reporter.h.

void iReporter::ReportNotify | ( | const char * | msgId,
|  | const char * | description,
|  |  | ...
| ) |  | `[inline]`

Report notification.

See also:
  Notes about string formatting in Crystal Space

Definition at line 275 of file reporter.h.

void csReporterHelper::ReportV | ( | iObjectRegistry * | reg,
|  | int | severity,
|  | char const * | msgId,
|  | char const * | description,
|  | va_list | args
| ) |  | `[inline, static]`

Helper function to use a reporter easily.

This function will also work if no reporter is present and use stdout in that case.

Remarks:
  You can use the csReportV macro for even more convenience.

See also:
  Notes about string formatting in Crystal Space

Definition at line 332 of file reporter.h.

void iReporter::ReportWarning | ( | const char * | msgId,
|  | const char * | description,
|  |  | ...
| ) |  | `[inline]`

Report warning.

See also:
  Notes about string formatting in Crystal Space

Definition at line 266 of file reporter.h.

## Variable Documentation

csStringID const csInvalidStringID = CS::InvalidStringID<CS::StringSetTag::General> ()

Invalid string ID.

Definition at line 207 of file strset.h.