OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
memory.h File Reference

Reliable platform independent header for common memory and string functions. More...

#include <owl/private/defs.h>
#include <tchar.h>
#include <memory.h>
#include <string.h>
#include <stdlib.h>
#include <malloc.h>
#include <owl/private/wsysinc.h>
#include <owl/preclass.h>
#include <owl/posclass.h>

Go to the source code of this file.

Classes

class  owl::TCharIterator< T >
 
class  owl::TBidirCharIterator< T >
 
class  owl::TTmpBufferBase
 Static temporary fixed buffer, provides fast temporary buffer, for use in functions. More...
 
class  owl::TTmpBuffer< T >
 

Namespaces

namespace  owl
 Object Windows Library (OWLNext Core)
 

Macros

#define alloca   _alloca
 
#define OWL_USES_CONVERSION_ACP_INIT_   CP_ACP
 
#define USES_CONVERSION
 
#define OWLA2WHELPER   OwlA2WHelper
 
#define OWLW2AHELPER   OwlW2AHelper
 
#define A2W(lpa)
 
#define A2WB(lpa, buf)
 
#define W2A(lpw)
 
#define W2AB(lpw, buf)
 
#define A2CW(lpa)   ((LPCWSTR)A2W(lpa))
 
#define W2CA(lpw)   ((LPCSTR)W2A(lpw))
 
#define A2CWB(lpa, buf)   ((LPCWSTR)A2WB(lpa,buf))
 
#define W2CAB(lpw, buf)   ((LPCSTR)W2AB(lpw,buf))
 
#define _USES_CONVERSION
 
#define _USES_CONVERSION_A   USES_CONVERSION
 
#define _W2A(lpw)   lpw
 
#define _A2W(lpw)   lpw
 
#define _W2AB(lpw, buf)   lpw
 
#define _A2WB(lpw, buf)   lpw
 
#define _W2A_A(lpw)   W2A(lpw)
 
#define _A2W_A(lpw)   A2W(lpw)
 
#define _W2A_AB(lpw, buf)   W2AB(lpw,buf)
 
#define _A2W_AB(lpw, buf)   A2WB(lpw,buf)
 
#define nstrnewdup   strnewdup
 
#define _WCHAR_T_DEFINED
 

Typedefs

typedef unsigned short wchar_t
 

Functions

UINT CharSize (const TCHAR *s)
 Return the number of bytes of the first character of the passed string.
 
TCHAR CharUpper (TCHAR c)
 
TCHAR CharLower (TCHAR c)
 
LPWSTR OwlA2WHelper (LPWSTR lpw, LPCSTR lpa, int nChars, unsigned int acp)
 
LPSTR OwlW2AHelper (LPSTR lpa, LPCWSTR lpw, int nChars, unsigned int acp)
 
LPWSTR OwlA2WHelper (LPWSTR lpw, LPCSTR lpa, int nChars)
 
LPSTR OwlW2AHelper (LPSTR lpa, LPCWSTR lpw, int nChars)
 
charstrnewdup (const char *s, size_t minAllocSize=0)
 
wchar_tstrnewdup (const wchar_t *s, size_t minAllocSize=0)
 

Detailed Description

Reliable platform independent header for common memory and string functions.

Definition in file memory.h.

Macro Definition Documentation

◆ _A2W

#define _A2W ( lpw)    lpw

Definition at line 220 of file memory.h.

◆ _A2W_A

#define _A2W_A ( lpw)    A2W(lpw)

Definition at line 224 of file memory.h.

◆ _A2W_AB

#define _A2W_AB ( lpw,
buf )   A2WB(lpw,buf)

Definition at line 226 of file memory.h.

◆ _A2WB

#define _A2WB ( lpw,
buf )   lpw

Definition at line 222 of file memory.h.

◆ _USES_CONVERSION

#define _USES_CONVERSION

Definition at line 217 of file memory.h.

◆ _USES_CONVERSION_A

#define _USES_CONVERSION_A   USES_CONVERSION

Definition at line 218 of file memory.h.

◆ _W2A

#define _W2A ( lpw)    lpw

Definition at line 219 of file memory.h.

◆ _W2A_A

#define _W2A_A ( lpw)    W2A(lpw)

Definition at line 223 of file memory.h.

◆ _W2A_AB

#define _W2A_AB ( lpw,
buf )   W2AB(lpw,buf)

Definition at line 225 of file memory.h.

◆ _W2AB

#define _W2AB ( lpw,
buf )   lpw

Definition at line 221 of file memory.h.

◆ _WCHAR_T_DEFINED

#define _WCHAR_T_DEFINED

Definition at line 407 of file memory.h.

◆ A2CW

#define A2CW ( lpa)    ((LPCWSTR)A2W(lpa))

Definition at line 180 of file memory.h.

◆ A2CWB

#define A2CWB ( lpa,
buf )   ((LPCWSTR)A2WB(lpa,buf))

Definition at line 186 of file memory.h.

◆ A2W

#define A2W ( lpa)
Value:
(\
((_lpa = lpa) == NULL) ? NULL : (\
#define alloca
Definition memory.h:34
#define OWLA2WHELPER
Definition memory.h:117

Definition at line 138 of file memory.h.

◆ A2WB

#define A2WB ( lpa,
buf )
Value:
(\
((_lpa = lpa) == NULL) ? NULL : (\

Definition at line 144 of file memory.h.

◆ alloca

#define alloca   _alloca

Definition at line 34 of file memory.h.

◆ nstrnewdup

#define nstrnewdup   strnewdup

Definition at line 403 of file memory.h.

◆ OWL_USES_CONVERSION_ACP_INIT_

#define OWL_USES_CONVERSION_ACP_INIT_   CP_ACP

Definition at line 69 of file memory.h.

◆ OWLA2WHELPER

#define OWLA2WHELPER   OwlA2WHelper

Definition at line 117 of file memory.h.

◆ OWLW2AHELPER

#define OWLW2AHELPER   OwlW2AHelper

Definition at line 118 of file memory.h.

◆ USES_CONVERSION

#define USES_CONVERSION
Value:
int _convert = 0; static_cast<void>(_convert);\
UINT _acp = OWL_USES_CONVERSION_ACP_INIT_; static_cast<void>(_acp);\
LPCWSTR _lpw = NULL; static_cast<void>(_lpw);\
LPCSTR _lpa = NULL; static_cast<void>(_lpa)
#define OWL_USES_CONVERSION_ACP_INIT_
Definition memory.h:69

Definition at line 71 of file memory.h.

◆ W2A

#define W2A ( lpw)
Value:
(\
((_lpw = lpw) == NULL) ? NULL : (\
_convert = (lstrlenW(_lpw)+1)*2,\
#define OWLW2AHELPER
Definition memory.h:118

Definition at line 166 of file memory.h.

◆ W2AB

#define W2AB ( lpw,
buf )
Value:
(\
((_lpw = lpw) == NULL) ? NULL : (\
_convert = (lstrlenW(_lpw)+1)*2,\

Definition at line 172 of file memory.h.

◆ W2CA

#define W2CA ( lpw)    ((LPCSTR)W2A(lpw))

Definition at line 183 of file memory.h.

◆ W2CAB

#define W2CAB ( lpw,
buf )   ((LPCSTR)W2AB(lpw,buf))

Definition at line 189 of file memory.h.

Typedef Documentation

◆ wchar_t

Definition at line 406 of file memory.h.

Function Documentation

◆ CharLower()

TCHAR CharLower ( TCHAR c)
inline

Definition at line 59 of file memory.h.

◆ CharSize()

UINT CharSize ( const TCHAR * s)
inline

Return the number of bytes of the first character of the passed string.

Definition at line 56 of file memory.h.

◆ CharUpper()

TCHAR CharUpper ( TCHAR c)
inline

Definition at line 58 of file memory.h.

◆ OwlA2WHelper() [1/2]

LPWSTR OwlA2WHelper ( LPWSTR lpw,
LPCSTR lpa,
int nChars )
inline

Definition at line 98 of file memory.h.

References OwlA2WHelper().

◆ OwlA2WHelper() [2/2]

LPWSTR OwlA2WHelper ( LPWSTR lpw,
LPCSTR lpa,
int nChars,
unsigned int acp )
inline

Definition at line 79 of file memory.h.

◆ OwlW2AHelper() [1/2]

LPSTR OwlW2AHelper ( LPSTR lpa,
LPCWSTR lpw,
int nChars )
inline

Definition at line 103 of file memory.h.

References OwlW2AHelper().

◆ OwlW2AHelper() [2/2]

LPSTR OwlW2AHelper ( LPSTR lpa,
LPCWSTR lpw,
int nChars,
unsigned int acp )
inline

Definition at line 89 of file memory.h.

◆ strnewdup() [1/2]

char * strnewdup ( const char * s,
size_t minAllocSize = 0 )

Definition at line 25 of file memory.cpp.

◆ strnewdup() [2/2]

wchar_t * strnewdup ( const wchar_t * s,
size_t minAllocSize = 0 )

Definition at line 69 of file memory.cpp.

References wcslen().