ReactOS  0.4.14-dev-52-g6116262
safestr.h File Reference
#include <tchar.h>
#include <string.h>
#include "assert.h"
Include dependency graph for safestr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define tchar   TCHAR
 

Functions

size_t safestrlen (const tchar *string)
 
tcharsafestrcpy (tchar *strDest, const tchar *strSource)
 
tcharsafestrncpy (tchar *strDest, const tchar *strSource, size_t count)
 
tcharsafestrlwr (tchar *str)
 
tcharsafestrupr (tchar *str)
 

Macro Definition Documentation

◆ tchar

#define tchar   TCHAR

Definition at line 13 of file safestr.h.

Function Documentation

◆ safestrcpy()

tchar* safestrcpy ( tchar strDest,
const tchar strSource 
)
inline

Definition at line 26 of file safestr.h.

27 {
28  ASSERT(strDest);
29  if ( !strSource )
30  *strDest = 0;
31  else
32  _tcscpy ( strDest, strSource );
33  return strDest;
34 }
_TCHAR * _tcscpy(_TCHAR *to, const _TCHAR *from)
Definition: tcscpy.h:8
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

◆ safestrlen()

size_t safestrlen ( const tchar string)
inline

Definition at line 19 of file safestr.h.

20 {
21  if ( !string )
22  return 0;
23  return _tcslen(string);
24 }
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9

Referenced by EnumFilesInDirectory().

◆ safestrlwr()

tchar* safestrlwr ( tchar str)
inline

Definition at line 47 of file safestr.h.

48 {
49  if ( !str )
50  return 0;
51  return _tcslwr(str);
52 }
const WCHAR * str
#define _tcslwr
Definition: tchar.h:1465

◆ safestrncpy()

tchar* safestrncpy ( tchar strDest,
const tchar strSource,
size_t  count 
)
inline

Definition at line 36 of file safestr.h.

37 {
38  ASSERT(strDest);
39  if ( !strSource )
40  count = 0;
41  else
42  _tcsncpy ( strDest, strSource, count );
43  strDest[count] = 0;
44  return strDest;
45 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
_TCHAR * _tcsncpy(_TCHAR *dst, const _TCHAR *src, size_t n)
Definition: tcsncpy.h:9
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

◆ safestrupr()

tchar* safestrupr ( tchar str)
inline

Definition at line 54 of file safestr.h.

55 {
56  if ( !str )
57  return 0;
58  return _tcsupr(str);
59 }
const WCHAR * str
#define _tcsupr
Definition: tchar.h:1467