-
Notifications
You must be signed in to change notification settings - Fork 0
/
StdStringList.h
60 lines (46 loc) · 1.53 KB
/
StdStringList.h
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
59
60
#ifndef STDSTRINGLIST_H
#define STDSTRINGLIST_H
/** @file */
/**
* A class to easily split strings into individual words.
* This class allows splitting strings into individual words in a style similar to that used
* by the Python string.split() function. Like its Python equivalent, it endeavours to make
* this task as simple as possible and to hide away all of the tedious details of the task, such
* as the management of the memory used to hold the strings and parsing the input string for
* separators and white space.
*/
class CStdStringList
{
private:
char **m_ppcStrings; /**< Array of ptrs to keywords to be highlighted */
TInt m_iNumStrings; /**< Number of keywords present in the m_ppcKeywords array */
public:
/**
* Destructor for the CStdStringList class.
* Frees up the strings owned by the class, as well as the array used to keep track
* of their ptrs.
*
* @date Tuesday 19-Nov-2013 7:56 am, Code HQ Ehinger Tor
*/
~CStdStringList()
{
Reset();
}
TInt Append(const char *a_pccString);
/**
* Retrieves the number of strings contained in the array.
* Returns the number of strings that have been parsed into the array. The strings may be
* accessed via the [] operator using and index between 0 and the value returned by this
* function.
*
* @date Tuesday 19-Nov-2013 7:54 am, Code HQ Ehinger Tor
* @return The number of strings contained in the array
*/
TInt Count()
{
return(m_iNumStrings);
}
void Reset();
const char *operator[](TInt a_iIndex);
};
#endif /* ! STDSTRINGLIST_H */