ReactOS 0.4.15-dev-5836-g942b022
chstring.cpp File Reference
#include <chstring.h>
#include <debug.h>
Include dependency graph for chstring.cpp:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

void operator delete (void *ptr)
 
voidoperator new (size_t uSize)
 
int mbstowcsz (LPWSTR lpDest, LPCSTR lpSrc, int nLen)
 
CHString WINAPI operator+ (CHSTRING_WCHAR ch, const CHString &string)
 
CHString WINAPI operator+ (const CHString &string, CHSTRING_WCHAR ch)
 
CHString WINAPI operator+ (const CHString &string, CHSTRING_LPCWSTR lpsz)
 
CHString WINAPI operator+ (CHSTRING_LPCWSTR lpsz, const CHString &string)
 
CHString WINAPI operator+ (const CHString &string1, const CHString &string2)
 

Variables

CHSTRING_WCHAR afxPchNil [1] = {0}
 
CHStringData afxNullData = {0, 0, 0}
 
CHeap_Exception HeapException (CHeap_Exception::E_ALLOCATION_ERROR)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 28 of file chstring.cpp.

Function Documentation

◆ mbstowcsz()

int mbstowcsz ( LPWSTR  lpDest,
LPCSTR  lpSrc,
int  nLen 
)

Definition at line 75 of file chstring.cpp.

76{
77 int Conv;
78
79 // If we have nothing to convert or if output doesn't exist, return
80 if (nLen == 0 || lpDest == 0)
81 {
82 return 0;
83 }
84
85 // Then, simply convert
86 Conv = MultiByteToWideChar(CP_ACP, 0, lpSrc, -1, lpDest, nLen);
87 // In case of conversion success, null terminate the string
88 if (Conv != 0)
89 {
90 lpDest[nLen] = 0;
91 }
92
93 return Conv;
94}
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110

Referenced by CHString::CHString(), and CHString::operator=().

◆ operator delete()

void operator delete ( void ptr)

Definition at line 46 of file chstring.cpp.

47{
48 // In Windows 2k3, they check for ptr being null.
49 // ISO, POSIX and even MSDN explains that it is allowed
50 // to call free with NULL pointer...
51 if (ptr)
52 {
53 free(ptr);
54 }
55}
#define free
Definition: debug_ros.c:5
static PVOID ptr
Definition: dispmode.c:27

◆ operator new()

void * operator new ( size_t  uSize)

Definition at line 61 of file chstring.cpp.

62{
63 void* Buffer;
64
65 Buffer = malloc(uSize);
66 if (!Buffer)
67 {
68 throw HeapException;
69 }
70
71 return Buffer;
72}
CHeap_Exception HeapException(CHeap_Exception::E_ALLOCATION_ERROR)
Definition: bufpool.h:45
#define malloc
Definition: debug_ros.c:4

◆ operator+() [1/5]

Definition at line 1396 of file chstring.cpp.

1397{
1398 int Len;
1399 CHString NewString;
1400
1401 // Get string length
1402 Len = CHString::SafeStrlen(lpsz);
1403 // And concat in new string
1404 NewString.ConcatCopy(Len, lpsz, string.GetData()->nDataLength, string.m_pchData);
1405
1406 return NewString;
1407}
void ConcatCopy(int nSrc1Len, CHSTRING_LPCWSTR lpszSrc1Data, int nSrc2Len, CHSTRING_LPCWSTR lpszSrc2Data)
Definition: chstring.cpp:488
static int WINAPI SafeStrlen(CHSTRING_LPCWSTR lpsz)
Definition: chstring.cpp:1040
#define Len
Definition: deflate.h:82
static BYTE * GetData(BYTE *pData, ULONG *pLength)
Definition: assembly.c:114

◆ operator+() [2/5]

Definition at line 1354 of file chstring.cpp.

1355{
1356 CHString NewString;
1357
1358 // Basically concat in a new string
1359 NewString.ConcatCopy(1, &ch, string.GetData()->nDataLength, string.m_pchData);
1360
1361 return NewString;
1362}

◆ operator+() [3/5]

Definition at line 1380 of file chstring.cpp.

1381{
1382 int Len;
1383 CHString NewString;
1384
1385 // Get string length
1386 Len = CHString::SafeStrlen(lpsz);
1387 // And concat in new string
1388 NewString.ConcatCopy(string.GetData()->nDataLength, string.m_pchData, Len, lpsz);
1389
1390 return NewString;
1391}

◆ operator+() [4/5]

Definition at line 1367 of file chstring.cpp.

1368{
1369 CHString NewString;
1370
1371 // Basically concat in a new string
1372 NewString.ConcatCopy(string.GetData()->nDataLength, string.m_pchData, 1, &ch);
1373
1374 return NewString;
1375}

◆ operator+() [5/5]

CHString WINAPI operator+ ( const CHString string1,
const CHString string2 
)

Definition at line 1412 of file chstring.cpp.

1413{
1414 CHString NewString;
1415
1416 // Basically concat in a new string
1417 NewString.ConcatCopy(string1.GetData()->nDataLength, string1.m_pchData,
1418 string2.GetData()->nDataLength, string2.m_pchData);
1419
1420 return NewString;
1421}
static CHAR string1[MAX_PATH]
Definition: asmname.c:32
static CHAR string2[MAX_PATH]
Definition: automation.c:449

Variable Documentation

◆ afxNullData

◆ afxPchNil

◆ HeapException