csWtoC Struct Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
csWtoC Struct Reference
Utilities

Helper class to convert wchar_t* to char* (UTF-8 encoded) strings for use as function parameters. More...

`#include <csutil/util.h>`

List of all members.

## Public Member Functions
| csWtoC (const wchar_t *ws)
| Constructor.
| operator const char * () const
| Retrieve the converted string.
| ~csWtoC ()
| Deletes the internally stored string.

## Detailed Description

Helper class to convert wchar_t* to char* (UTF-8 encoded) strings for use as function parameters.

Use of this helper class is more convenient than a csStrNew() / delete[] pair, but essentially does the same (with the convenience of automatic cleanup).

       wchar_t* wstr = L"Hello World";
        ...
       iNativeWindow* natwin =  ... ;
         natwin->SetTitle (csWtoC (wstr));

Definition at line 161 of file util.h.

## Constructor & Destructor Documentation

csWtoC::csWtoC | ( | const wchar_t * | ws | ) | `[inline]`

Constructor.

Stores an UTF-8 converted version of `ws` internally.

Definition at line 170 of file util.h.

csWtoC::~csWtoC | ( |  | ) | `[inline]`

Deletes the internally stored string.

Definition at line 175 of file util.h.

## Member Function Documentation

csWtoC::operator const char * | ( |  | ) | const`[inline]`

Retrieve the converted string.

Definition at line 180 of file util.h.

The documentation for this struct was generated from the following file:

- csutil/util.h