blob: 3f4bdef1a1a9a454b55b25ea3e4075a5c5747573 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
// StringUtils.h
// Interfaces to various string helper functions
#ifndef STRINGUTILS_H_INCLUDED
#define STRINGUTILS_H_INCLUDED
#ifndef _WIN32
#include <stdarg.h>
#endif
typedef std::string AString;
typedef std::vector<AString> AStringVector;
/// Add the formated string to the existing data in the string
extern AString & AppendVPrintf(AString & str, const char * format, va_list args);
/// Output the formatted text into the string
extern AString & Printf (AString & str, const char * format, ...);
/// Add the formatted string to the existing data in the string
extern AString & AppendPrintf (AString & str, const char * format, ...);
/// Split the string at delimiters, return as a stringvector
extern AStringVector StringSplit(const AString & str, const AString & delim);
/// In-place string conversion to uppercase; returns the same string
extern AString & StrToUpper(AString & s);
/// Case-insensitive string comparison; returns 0 if the strings are the same
extern int NoCaseCompare(const AString & s1, const AString & s2);
/// Replaces *each* occurence of iNeedle in iHayStack with iReplaceWith
extern void ReplaceString(AString & iHayStack, const AString & iNeedle, const AString & iReplaceWith);
// If you have any other string helper functions, declare them here
#endif // STRINGUTILS_H_INCLUDED
|