CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csutil/win32/wintools.h File Reference

Win32 tool functions. More...

#include "csextern.h"
#include "csutil/csunicode.h"
#include "csutil/util.h"
#include <winnls.h>

Go to the source code of this file.

Compounds

struct  cswinCtoA
 Small helper to convert an UTF-8 to an ANSI string, useful when passing arguments to a function. More...

struct  cswinWtoA
 Small helper to convert a wide to an ANSI string, useful when passing arguments to a function. More...


Functions

wchar_t * cswinAnsiToWide (const char *ansi, UINT codePage=CP_ACP)
 Convert an ANSI string to a wide string.

char * cswinWideToAnsi (const wchar_t *wide, UINT codePage=CP_ACP)
 Convert a wide string to an ANSI string.

char * cswinGetErrorMessage (HRESULT code)
 Retrieve the system's description for an error code.

wchar_t * cswinGetErrorMessageW (HRESULT code)
 Retrieve the system's description for an error code.

bool cswinIsWinNT ()
 Returns 'true' if the current Windows is from the NT strain, 'false' if from the 9x strain.


Detailed Description

Win32 tool functions.

Definition in file wintools.h.


Function Documentation

wchar_t* cswinAnsiToWide const char *    ansi,
UINT    codePage = CP_ACP
[inline, static]
 

Convert an ANSI string to a wide string.

Remarks:
Free the returned pointer with delete[].
This function provides functionality specific to the Win32 platform. To ensure that code using this functionality compiles properly on all other platforms, the use of the function and inclusion of the header file should be surrounded by appropriate `if defined(OS_WIN32) ... endif' statements.

Definition at line 40 of file wintools.h.

char* cswinGetErrorMessage HRESULT    code
 

Retrieve the system's description for an error code.

Parameters:
code  The error code, usually retrieved through GetLastError().
Remarks:
Returns an UTF-8 encoded string.
Free the returned pointer with delete[].
This function provides functionality specific to the Win32 platform. To ensure that code using this functionality compiles properly on all other platforms, the use of the function and inclusion of the header file should be surrounded by appropriate `if defined(OS_WIN32) ... endif' statements.

wchar_t* cswinGetErrorMessageW HRESULT    code
 

Retrieve the system's description for an error code.

Parameters:
code  The error code, usually retrieved through GetLastError().
Remarks:
Free the returned pointer with delete[].
This function provides functionality specific to the Win32 platform. To ensure that code using this functionality compiles properly on all other platforms, the use of the function and inclusion of the header file should be surrounded by appropriate `if defined(OS_WIN32) ... endif' statements.

bool cswinIsWinNT  
 

Returns 'true' if the current Windows is from the NT strain, 'false' if from the 9x strain.

Remarks:
This function provides functionality specific to the Win32 platform. To ensure that code using this functionality compiles properly on all other platforms, the use of the function and inclusion of the header file should be surrounded by appropriate `if defined(OS_WIN32) ... endif' statements.

char* cswinWideToAnsi const wchar_t *    wide,
UINT    codePage = CP_ACP
[inline, static]
 

Convert a wide string to an ANSI string.

Remarks:
Free the returned pointer with delete[].
This function provides functionality specific to the Win32 platform. To ensure that code using this functionality compiles properly on all other platforms, the use of the function and inclusion of the header file should be surrounded by appropriate `if defined(OS_WIN32) ... endif' statements.

Definition at line 64 of file wintools.h.

Referenced by cswinCtoA::cswinCtoA(), and cswinWtoA::cswinWtoA().


Generated for Crystal Space by doxygen 1.2.18