UTF8 - Simple Library for Internationalization
|
A simple buffer for caching values returned by Windows API. More...
#include <winutf8.h>
Public Member Functions | |
buffer (size_t size_) | |
~buffer () | |
Destructor. | |
buffer (const buffer &other) | |
Copy constructor. | |
buffer & | operator= (const buffer &rhs) |
Principal assignment operator. | |
buffer & | operator= (const std::string &rhs) |
String assignment operator. | |
operator wchar_t * () | |
Return a pointer to buffer. | |
operator std::string () const | |
Convert buffer to an UTF-8 encoded string. | |
DWORD | size () const |
Return buffer size. | |
A simple buffer for caching values returned by Windows API.
Many Windows API function return output strings as UTF-16 encoded strings.
This class provides conversion operators that make it easier to go back to UTF-8 encoded strings.
Here is a simple usage example:
Without this class, the equivalent code would be something like:
|
explicit |
Constructor
size_ | buffer size in characters (not bytes) |