ReactOS 0.4.15-dev-8241-g63935f8
ATL::CW2WEX< t_nBufferLength > Class Template Reference

#include <atlconv.h>

Public Member Functions

 CW2WEX (_In_z_ LPCWSTR psz)
 
 CW2WEX (_In_z_ LPCWSTR psz, _In_ UINT nCodePage)
 
 ~CW2WEX () noexcept
 
_Ret_z_ operator LPWSTR () const noexcept
 

Public Attributes

LPWSTR m_psz
 
wchar_t m_szBuffer [t_nBufferLength]
 

Private Member Functions

 CW2WEX (_In_ const CW2WEX &) noexcept=delete
 
CW2WEXoperator= (_In_ const CW2WEX &) noexcept=delete
 
void Init (_In_z_ LPCWSTR psz)
 

Detailed Description

template<int t_nBufferLength = 128>
class ATL::CW2WEX< t_nBufferLength >

Definition at line 128 of file atlconv.h.

Constructor & Destructor Documentation

◆ CW2WEX() [1/3]

template<int t_nBufferLength = 128>
ATL::CW2WEX< t_nBufferLength >::CW2WEX ( _In_z_ LPCWSTR  psz)
inline

Definition at line 134 of file atlconv.h.

135 {
136 Init(psz);
137 }

◆ CW2WEX() [2/3]

template<int t_nBufferLength = 128>
ATL::CW2WEX< t_nBufferLength >::CW2WEX ( _In_z_ LPCWSTR  psz,
_In_ UINT  nCodePage 
)
inline

Definition at line 139 of file atlconv.h.

140 {
141 UNREFERENCED_PARAMETER(nCodePage);
142 Init(psz);
143 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317

◆ ~CW2WEX()

template<int t_nBufferLength = 128>
ATL::CW2WEX< t_nBufferLength >::~CW2WEX ( )
inlinenoexcept

Definition at line 145 of file atlconv.h.

146 {
147 if (m_psz != m_szBuffer)
148 free(m_psz);
149 }
LPWSTR m_psz
Definition: atlconv.h:131
wchar_t m_szBuffer[t_nBufferLength]
Definition: atlconv.h:132
#define free
Definition: debug_ros.c:5

◆ CW2WEX() [3/3]

template<int t_nBufferLength = 128>
ATL::CW2WEX< t_nBufferLength >::CW2WEX ( _In_ const CW2WEX< t_nBufferLength > &  )
privatedeletenoexcept

Member Function Documentation

◆ Init()

template<int t_nBufferLength = 128>
void ATL::CW2WEX< t_nBufferLength >::Init ( _In_z_ LPCWSTR  psz)
inlineprivate

Definition at line 161 of file atlconv.h.

162 {
163 if (!psz)
164 {
165 m_psz = NULL;
166 m_szBuffer[0] = 0;
167 return;
168 }
169 int cchMax = lstrlenW(psz);
170 if (cchMax <= t_nBufferLength)
171 {
172#ifdef _STRSAFE_H_INCLUDED_
174#else
176#endif
178 return;
179 }
180
181 m_szBuffer[0] = 0;
182 m_psz = _wcsdup(psz);
183 if (!m_psz)
185 }
UINT cchMax
#define AtlThrow(x)
Definition: atldef.h:20
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
_Check_return_ _CRTIMP wchar_t *__cdecl _wcsdup(_In_z_ const wchar_t *_Str)
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149

◆ operator LPWSTR()

template<int t_nBufferLength = 128>
_Ret_z_ ATL::CW2WEX< t_nBufferLength >::operator LPWSTR ( ) const
inlinenoexcept

Definition at line 151 of file atlconv.h.

152 {
153 return m_psz;
154 }

◆ operator=()

template<int t_nBufferLength = 128>
CW2WEX & ATL::CW2WEX< t_nBufferLength >::operator= ( _In_ const CW2WEX< t_nBufferLength > &  )
privatedeletenoexcept

Member Data Documentation

◆ m_psz

template<int t_nBufferLength = 128>
LPWSTR ATL::CW2WEX< t_nBufferLength >::m_psz

◆ m_szBuffer

template<int t_nBufferLength = 128>
wchar_t ATL::CW2WEX< t_nBufferLength >::m_szBuffer[t_nBufferLength]

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