10#if !defined(OWL_PRIVATE_MEMORY_H)
11#define OWL_PRIVATE_MEMORY_H
14#if defined(BI_HAS_PRAGMA_ONCE)
20#if defined(BI_COMP_BORLANDC)
25#if !defined(__STRING_H) && !defined(_INC_STRING)
28#if !defined(BI_COMP_GNUC)
33#if !defined(BI_COMP_BORLANDC) && !(defined(__GNUC__) && (__GNUC__ >= 3))
34# define alloca _alloca
37#if !defined(OWL_PRIVATE_WSYSINC_H)
42#if defined(BI_NEED_TCHAR)
43# if defined(BI_COMP_BORLANDC)
61#if defined(_CONVERSION_USES_THREAD_LOCALE)
62# define BI_CONVERSION_USES_THREAD_LOCALE
65#if !defined(USES_CONVERSION)
66# ifdef BI_CONVERSION_USES_THREAD_LOCALE
67# define OWL_USES_CONVERSION_ACP_INIT_ GetACP()
69# define OWL_USES_CONVERSION_ACP_INIT_ CP_ACP
71# define USES_CONVERSION\
72 int _convert = 0; static_cast<void>(_convert);\
73 UINT _acp = OWL_USES_CONVERSION_ACP_INIT_; static_cast<void>(_acp);\
74 LPCWSTR _lpw = NULL; static_cast<void>(_lpw);\
75 LPCSTR _lpa = NULL; static_cast<void>(_lpa)
108# ifdef BI_CONVERSION_USES_THREAD_LOCALE
113# define OWLA2WHELPER OwlA2WHelper
114# define OWLW2AHELPER OwlW2AHelper
117# define OWLA2WHELPER OwlA2WHelper
118# define OWLW2AHELPER OwlW2AHelper
123# if defined(BI_CONVERSION_USES_THREAD_LOCALE)
126 ((_lpa = lpa) == NULL) ? NULL : (\
127 _convert = (lstrlenA(_lpa)+1),\
128 OWLA2WHELPER((LPWSTR) alloca(_convert*2), _lpa, _convert, _acp)))
131# define A2WB(lpa,buf) (\
132 ((_lpa = lpa) == NULL) ? NULL : (\
133 _convert = (lstrlenA(_lpa)+1),\
134 OWLA2WHELPER((LPWSTR) buf, _lpa, _convert, _acp)))
139 ((_lpa = lpa) == NULL) ? NULL : (\
140 _convert = (lstrlenA(_lpa)+1),\
141 OWLA2WHELPER((LPWSTR) alloca(_convert*2), _lpa, _convert)))
144# define A2WB(lpa,buf) (\
145 ((_lpa = lpa) == NULL) ? NULL : (\
146 _convert = (lstrlenA(_lpa)+1),\
147 OWLA2WHELPER((LPWSTR) buf, _lpa, _convert)))
151# ifdef BI_CONVERSION_USES_THREAD_LOCALE
154 ((_lpw = lpw) == NULL) ? NULL : (\
155 _convert = (lstrlenW(_lpw)+1)*2,\
156 OWLW2AHELPER((LPSTR) alloca(_convert), _lpw, _convert, _acp)))
159# define W2AB(lpw,buf) (\
160 ((_lpw = lpw) == NULL) ? NULL : (\
161 _convert = (lstrlenW(_lpw)+1)*2,\
162 OWLW2AHELPER((LPSTR) buf, _lpw, _convert, _acp)))
167 ((_lpw = lpw) == NULL) ? NULL : (\
168 _convert = (lstrlenW(_lpw)+1)*2,\
169 OWLW2AHELPER((LPSTR) alloca(_convert), _lpw, _convert)))
172# define W2AB(lpw,buf) (\
173 ((_lpw = lpw) == NULL) ? NULL : (\
174 _convert = (lstrlenW(_lpw)+1)*2,\
175 OWLW2AHELPER((LPSTR) buf, _lpw, _convert)))
180# define A2CW(lpa) ((LPCWSTR)A2W(lpa))
183# define W2CA(lpw) ((LPCSTR)W2A(lpw))
186# define A2CWB(lpa,buf) ((LPCWSTR)A2WB(lpa,buf))
189# define W2CAB(lpw,buf) ((LPCSTR)W2AB(lpw,buf))
206# define _USES_CONVERSION USES_CONVERSION
207# define _USES_CONVERSION_A
208# define _W2A(lpw) W2A(lpw)
209# define _A2W(lpw) A2W(lpw)
210# define _W2AB(lpw,buf) W2AB(lpw,buf)
211# define _A2WB(lpw,buf) A2WB(lpw,buf)
212# define _W2A_A(lpw) lpw
213# define _A2W_A(lpw) lpw
214# define _W2A_AB(lpw,buf) lpw
215# define _A2W_AB(lpw,buf) lpw
217# define _USES_CONVERSION
218# define _USES_CONVERSION_A USES_CONVERSION
219# define _W2A(lpw) lpw
220# define _A2W(lpw) lpw
221# define _W2AB(lpw,buf) lpw
222# define _A2WB(lpw,buf) lpw
223# define _W2A_A(lpw) W2A(lpw)
224# define _A2W_A(lpw) A2W(lpw)
225# define _W2A_AB(lpw,buf) W2AB(lpw,buf)
226# define _A2W_AB(lpw,buf) A2WB(lpw,buf)
297 void*
operator new(
size_t)
noexcept;
305 operator T*() {
return static_cast<T*
>(
Buffer);}
324#if defined(BI_DBCS_SUPPORT)
367#if defined(BI_DBCS_SUPPORT)
368 return ::AnsiPrev(Begin, this->P);
370 return this->P > Begin ? this->P - 1 : this->P;
377 return this->P = Prev();
403# define nstrnewdup strnewdup
405# if !defined(_WCHAR_T_DEFINED)
407# define _WCHAR_T_DEFINED
TBidirCharIterator(T *begin, T *p)
Static temporary fixed buffer, provides fast temporary buffer, for use in functions.
Reliable platform independent header for common memory and string functions.
UINT CharSize(const TCHAR *s)
Return the number of bytes of the first character of the passed string.
LPSTR OwlW2AHelper(LPSTR lpa, LPCWSTR lpw, int nChars, unsigned int acp)
char * strnewdup(const char *s, size_t minAllocSize=0)
LPWSTR OwlA2WHelper(LPWSTR lpw, LPCSTR lpa, int nChars, unsigned int acp)
Object Windows Library (OWLNext Core)
Definition of class TString, a flexible universal string envelope class.