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>
9 #ifndef __STRINGUTILS_H__
10 #define __STRINGUTILS_H__
21 LPTSTR
FormatStringV(LPCTSTR str
, va_list args
);
22 LPTSTR
FormatString(LPCTSTR str
, ...);
25 // String handling (ANSI <-> Unicode UTF16)
27 LPSTR
UnicodeToAnsi(LPCWSTR strW
);
28 LPWSTR
AnsiToUnicode(LPCSTR strA
);
29 LPSTR
DuplicateStringA(LPCSTR str
);
30 LPWSTR
DuplicateStringW(LPCWSTR str
);
31 LPSTR
DuplicateStringAEx(LPCSTR str
, size_t numOfChars
);
32 LPWSTR
DuplicateStringWEx(LPCWSTR str
, size_t numOfChars
);
35 // Conversion macros ANSI <-> 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))
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))
50 // String search functions
52 #define FindSubStr(str, strSearch) _tcsstr((str), (strSearch))
53 LPTSTR
FindSubStrI(LPCTSTR str
, LPCTSTR strSearch
);
55 LPTSTR
AppendPathSeparator(LPTSTR lpszPath
);
61 #endif // __STRINGUTILS_H__