ReactOS 0.4.16-dev-122-g325d74c
ATL::CA2AEX< t_nBufferLength > Class Template Reference

#include <atlconv.h>

Public Member Functions

 CA2AEX (_In_z_ LPCSTR psz)
 
 CA2AEX (_In_z_ LPCSTR psz, _In_ UINT nCodePage)
 
 ~CA2AEX () noexcept
 
_Ret_z_ operator LPSTR () const noexcept
 

Public Attributes

LPSTR m_psz
 
char m_szBuffer [t_nBufferLength]
 

Private Member Functions

 CA2AEX (_In_ const CA2AEX &) noexcept=delete
 
CA2AEXoperator= (_In_ const CA2AEX &) noexcept=delete
 
void Init (_In_z_ LPCSTR psz)
 

Detailed Description

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

Definition at line 67 of file atlconv.h.

Constructor & Destructor Documentation

◆ CA2AEX() [1/3]

template<int t_nBufferLength = 128>
ATL::CA2AEX< t_nBufferLength >::CA2AEX ( _In_z_ LPCSTR  psz)
inline

Definition at line 73 of file atlconv.h.

74 {
75 Init(psz);
76 }

◆ CA2AEX() [2/3]

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

Definition at line 78 of file atlconv.h.

79 {
80 UNREFERENCED_PARAMETER(nCodePage);
81 Init(psz);
82 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317

◆ ~CA2AEX()

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

Definition at line 84 of file atlconv.h.

85 {
86 if (m_psz != m_szBuffer)
87 free(m_psz);
88 }
char m_szBuffer[t_nBufferLength]
Definition: atlconv.h:71
LPSTR m_psz
Definition: atlconv.h:70
#define free
Definition: debug_ros.c:5

◆ CA2AEX() [3/3]

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

Member Function Documentation

◆ Init()

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

Definition at line 100 of file atlconv.h.

101 {
102 if (!psz)
103 {
104 m_psz = NULL;
105 m_szBuffer[0] = 0;
106 return;
107 }
108 int cchMax = lstrlenA(psz) + 1;
109 if (cchMax <= t_nBufferLength)
110 {
111#ifdef _STRSAFE_H_INCLUDED_
113#else
115#endif
117 return;
118 }
119
120 m_szBuffer[0] = 0;
121 m_psz = _strdup(psz);
122 if (!m_psz)
124 }
UINT cchMax
#define AtlThrow(x)
Definition: atldef.h:20
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define _strdup
Definition: debug_ros.c:7
#define NULL
Definition: types.h:112
#define lstrcpynA
Definition: compat.h:751
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCchCopyA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
Definition: strsafe.h:145

◆ operator LPSTR()

template<int t_nBufferLength = 128>
_Ret_z_ ATL::CA2AEX< t_nBufferLength >::operator LPSTR ( ) const
inlinenoexcept

Definition at line 90 of file atlconv.h.

91 {
92 return m_psz;
93 }

◆ operator=()

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

Member Data Documentation

◆ m_psz

template<int t_nBufferLength = 128>
LPSTR ATL::CA2AEX< t_nBufferLength >::m_psz

◆ m_szBuffer

template<int t_nBufferLength = 128>
char ATL::CA2AEX< t_nBufferLength >::m_szBuffer[t_nBufferLength]

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