ReactOS 0.4.15-dev-7842-g558ab78
stringutils.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Applications
3 * LICENSE: LGPL - See COPYING in the top level directory
4 * FILE: base/applications/msconfig_new/stringutils.h
5 * PURPOSE: ANSI & UNICODE String Utility Functions
6 * COPYRIGHT: Copyright 2011-2012 Hermes BELUSCA - MAITO <hermes.belusca@sfr.fr>
7 */
8
9#ifndef __STRINGUTILS_H__
10#define __STRINGUTILS_H__
11
12#pragma once
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18//
19// String formatting
20//
23
24//
25// String handling (ANSI <-> Unicode UTF16)
26//
31LPSTR DuplicateStringAEx(LPCSTR str, size_t numOfChars);
32LPWSTR DuplicateStringWEx(LPCWSTR str, size_t numOfChars);
33
34//
35// Conversion macros ANSI <-> Unicode
36//
37#ifdef UNICODE
38 #define NewAnsiString(x) UnicodeToAnsi(x)
39 #define NewPortableString(x) AnsiToUnicode(x)
40 #define DuplicateString(x) DuplicateStringW(x)
41 #define DuplicateStringEx(x, y) DuplicateStringWEx((x), (y))
42#else
43 #define NewAnsiString(x) DuplicateStringA(x)
44 #define NewPortableString(x) DuplicateString(x)
45 #define DuplicateString(x) DuplicateStringA(x)
46 #define DuplicateStringEx(x, y) DuplicateStringAEx((x), (y))
47#endif
48
49//
50// String search functions
51//
52#define FindSubStr(str, strSearch) _tcsstr((str), (strSearch))
54
56
57#ifdef __cplusplus
58} // extern "C"
59#endif
60
61#endif // __STRINGUTILS_H__
62
63/* EOF */
char * va_list
Definition: acmsvcex.h:78
WCHAR strW[12]
Definition: clipboard.c:2029
char strA[12]
Definition: clipboard.c:2028
const WCHAR * str
LPTSTR AppendPathSeparator(LPTSTR lpszPath)
Definition: stringutils.c:220
LPTSTR FormatString(LPCTSTR str,...)
Definition: stringutils.c:33
LPWSTR DuplicateStringWEx(LPCWSTR str, size_t numOfChars)
Definition: stringutils.c:142
LPWSTR AnsiToUnicode(LPCSTR strA)
Definition: stringutils.c:69
LPTSTR FormatStringV(LPCTSTR str, va_list args)
Definition: stringutils.c:16
LPWSTR DuplicateStringW(LPCWSTR str)
Definition: stringutils.c:107
LPSTR DuplicateStringAEx(LPCSTR str, size_t numOfChars)
Definition: stringutils.c:124
LPSTR DuplicateStringA(LPCSTR str)
Definition: stringutils.c:90
LPSTR UnicodeToAnsi(LPCWSTR strW)
Definition: stringutils.c:48
LPTSTR FindSubStrI(LPCTSTR str, LPCTSTR strSearch)
Definition: stringutils.c:183
Definition: match.c:390
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
CHAR * LPTSTR
Definition: xmlstorage.h:192
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185