nux-1.16.0
nux::TCharToUnicharConvertion Class Reference

TCHAR to Unichar conversion. More...

#include <NuxCore/Character/NUnicode.h>

List of all members.

Public Member Functions

NUX_INLINE UNICHAR * Convert (const TCHAR *Source)

Detailed Description

TCHAR to Unichar conversion.

Definition at line 262 of file NUnicode.h.


Member Function Documentation

NUX_INLINE UNICHAR* nux::TCharToUnicharConvertion::Convert ( const TCHAR *  Source) [inline]

Convert from TCHAR to ANSICHAR

Parameters:
SourceString to convert. Null terminated.
Returns:
Return a pointer to the new string. Null terminated.

Definition at line 272 of file NUnicode.h.

References nux::AnsicharToUnicharConvertion::Convert().

    {
      // Determine whether we need to allocate memory or not
#ifdef UNICODE
      size_t length = strlen (Source) + 1;
      size_t size = length * sizeof (UNICHAR);
      UNICHAR *Dest = new UNICHAR[size];
      STRNCPY_S (Dest, size, Source, length);
      return Dest;
#else
      AnsicharToUnicharConvertion convert;
      return convert.Convert (Source);
#endif
    }

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends