Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::bin::WideToUtf8Scope Class Reference

#include <utils_win.h>

Public Member Functions

 WideToUtf8Scope (const wchar_t *wide)
 
char * utf8 () const
 
intptr_t length () const
 
CStringUniquePtr release ()
 

Detailed Description

Definition at line 53 of file utils_win.h.

Constructor & Destructor Documentation

◆ WideToUtf8Scope()

dart::bin::WideToUtf8Scope::WideToUtf8Scope ( const wchar_t *  wide)
inlineexplicit

Definition at line 55 of file utils_win.h.

56 : utf8_(CStringUniquePtr(nullptr)) {
57 intptr_t utf8_len =
58 WideCharToMultiByte(CP_UTF8, 0, wide, -1, nullptr, 0, nullptr, nullptr);
59 char* utf8 = reinterpret_cast<char*>(malloc(utf8_len));
60 WideCharToMultiByte(CP_UTF8, 0, wide, -1, utf8, utf8_len, nullptr, nullptr);
61 length_ = utf8_len;
62 utf8_.reset(utf8);
63 }
char * utf8() const
Definition: utils_win.h:65
CAllocUniquePtr< char > CStringUniquePtr
Definition: utils.h:31
void * malloc(size_t size)
Definition: allocation.cc:19

Member Function Documentation

◆ length()

intptr_t dart::bin::WideToUtf8Scope::length ( ) const
inline

Definition at line 66 of file utils_win.h.

66{ return length_; }

◆ release()

CStringUniquePtr dart::bin::WideToUtf8Scope::release ( )
inline

Definition at line 69 of file utils_win.h.

69{ return std::move(utf8_); }

◆ utf8()

char * dart::bin::WideToUtf8Scope::utf8 ( ) const
inline

Definition at line 65 of file utils_win.h.

65{ return utf8_.get(); }

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