Lib
QOLを高める
Classes | Typedefs | Functions
yappy::util Namespace Reference

Utilities. More...

Classes

class  CoInitialize
 Auto CoInitializeEx() and CoUninitialize() class. More...
 
struct  ComDeleter
 Deleter: auto IUnknown::Release(). More...
 
struct  FileDeleter
 Deleter: auto flose(). More...
 
struct  HandleDeleter
 Deleter: auto CloseHandle(). More...
 
struct  heapDeleter
 Deleter: auto HeapDestroy(). More...
 
class  noncopyable
 Noncopyable class. More...
 

Typedefs

using IdString = std::array< char, 16 >
 Fixed size char array for string ID. More...
 
using HandlePtr = std::unique_ptr< HANDLE, HandleDeleter >
 unique_ptr of HANDLE with HandleDeleter. More...
 
using HeapPtr = std::unique_ptr< HANDLE, heapDeleter >
 unique_ptr of HANDLE with heapDeleter. More...
 
template<class T >
using ComPtr = std::unique_ptr< T, ComDeleter >
 unique_ptr of IUnknown with ComDeleter. More...
 
using FilePtr = std::unique_ptr< FILE, FileDeleter >
 unique_ptr of FILE with FileDeleter. More...
 

Functions

template<size_t N>
void createFixedString (std::array< char, N > *out, const char *src)
 Create yappy::util::IdString from C-style string. More...
 
std::unique_ptr< char[]> wc2utf8 (const wchar_t *in)
 Wide char to UTF-8. More...
 
std::unique_ptr< wchar_t[]> utf82wc (const char *in)
 UTF-8 to wide char. More...
 

Detailed Description

Utilities.

Typedef Documentation

template<class T >
using yappy::util::ComPtr = typedef std::unique_ptr<T, ComDeleter>

unique_ptr of IUnknown with ComDeleter.

Definition at line 88 of file util.h.

using yappy::util::FilePtr = typedef std::unique_ptr<FILE, FileDeleter>

unique_ptr of FILE with FileDeleter.

Definition at line 98 of file util.h.

using yappy::util::HandlePtr = typedef std::unique_ptr<HANDLE, HandleDeleter>

unique_ptr of HANDLE with HandleDeleter.

Definition at line 64 of file util.h.

using yappy::util::HeapPtr = typedef std::unique_ptr<HANDLE, heapDeleter>

unique_ptr of HANDLE with heapDeleter.

Definition at line 77 of file util.h.

using yappy::util::IdString = typedef std::array<char, 16>

Fixed size char array for string ID.

See also
std::hash<yappy::util::IdString>

Definition at line 35 of file util.h.

Function Documentation

template<size_t N>
void yappy::util::createFixedString ( std::array< char, N > *  out,
const char *  src 
)
inline

Create yappy::util::IdString from C-style string.

Definition at line 40 of file util.h.

std::unique_ptr<wchar_t[]> yappy::util::utf82wc ( const char *  in)
inline

UTF-8 to wide char.

Parameters
[in]inUTF-8 string.
Returns
Wide char string.

Definition at line 117 of file util.h.

std::unique_ptr<char[]> yappy::util::wc2utf8 ( const wchar_t *  in)
inline

Wide char to UTF-8.

Parameters
[in]inWide string.
Returns
UTF-8 string.

Definition at line 105 of file util.h.