Subversion Repositories spk

Rev

Rev 179 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 179 Rev 196
Line 5... Line 5...
5
#include "List.h"
5
#include "List.h"
6
 
6
 
7
namespace Utils {
7
namespace Utils {
8
 
8
 
9
	typedef struct {
9
	typedef struct {
10
		String str;
10
		SString str;
11
		String data;
11
		SString data;
12
	} SStringList;
12
	} SStringList;
13
 
13
 
14
	typedef CListNode<SStringList> CStringListNode;
14
	typedef CListNode<SStringList> CStringListNode;
15
	typedef CList<SStringList>::iterator CStringListIterator;
15
	typedef CList<SStringList>::iterator CStringListIterator;
16
 
16
 
Line 21... Line 21...
21
 
21
 
22
	public:
22
	public:
23
		CStringList();
23
		CStringList();
24
		~CStringList();
24
		~CStringList();
25
 
25
 
26
		void pushBack(const String &str, const String &data);
26
		void pushBack(const SString &str, const SString &data);
27
		void pushBack(const String &str);
27
		void pushBack(const SString &str);
28
		void pushFront(const String &str, const String &data);
28
		void pushFront(const SString &str, const SString &data);
29
		void pushFront(const String &str);
29
		void pushFront(const SString &str);
30
		void popBack();
30
		void popBack();
31
		void popFront();
31
		void popFront();
32
 
32
 
33
		void insertAt(int at, const String& str, const String& data);
33
		void insertAt(int at, const SString& str, const SString& data);
34
		void insertAt(int at, const String& str);
34
		void insertAt(int at, const SString& str);
35
 
35
 
36
		void clear();
36
		void clear();
37
		void tokenise(const String &str, const String &token);
37
		void tokenise(const SString &str, const SString &token);
38
 
38
 
39
		Utils::String firstString();
39
		Utils::SString firstString();
40
		Utils::String nextString();
40
		Utils::SString nextString();
41
		Utils::SStringList *first();
41
		Utils::SStringList *first();
42
		Utils::SStringList *next();
42
		Utils::SStringList *next();
43
		CStringListIterator begin() const;
43
		CStringListIterator begin() const;
44
		CStringListIterator end() const;
44
		CStringListIterator end() const;
45
 
45
 
46
		Utils::String front() const;
46
		Utils::SString front() const;
47
		Utils::String back() const;
47
		Utils::SString back() const;
48
 
48
 
49
		Utils::SStringList *get(int i) const;
49
		Utils::SStringList *get(int i) const;
50
 
50
 
51
		bool changeData(const Utils::String &str, const Utils::String &data, bool bIgnoreCase = false);
51
		bool changeData(const Utils::SString &str, const Utils::SString &data, bool bIgnoreCase = false);
52
		bool contains(const Utils::String &data, bool bIgnoreCase = false) const;
52
		bool contains(const Utils::SString &data, bool bIgnoreCase = false) const;
53
		bool containsData(const Utils::String& str, bool bIgnoreCase = false) const;
53
		bool containsData(const Utils::SString& str, bool bIgnoreCase = false) const;
54
		bool containsStringAndData(const Utils::String& str, const Utils::String &data, bool bIgnoreCase = false) const;
54
		bool containsStringAndData(const Utils::SString& str, const Utils::SString &data, bool bIgnoreCase = false) const;
55
		Utils::String findData(const Utils::String &data, bool bIgnoreCase = false) const;
55
		Utils::SString findData(const Utils::SString &data, bool bIgnoreCase = false) const;
56
		Utils::String findString(const Utils::String &str, bool bIgnoreCase = false) const;
56
		Utils::SString findString(const Utils::SString &str, bool bIgnoreCase = false) const;
57
		int findStringAndData(const Utils::String& str, const Utils::String& data, bool bIgnoreCase = false) const;
57
		int findStringAndData(const Utils::SString& str, const Utils::SString& data, bool bIgnoreCase = false) const;
58
		int findPos(const Utils::String& str, bool bIgnoreCase = false) const;
58
		int findPos(const Utils::SString& str, bool bIgnoreCase = false) const;
59
 
59
 
60
		CStringListIterator remove(CStringListIterator itr);
60
		CStringListIterator remove(CStringListIterator itr);
61
		bool remove(const Utils::String &str, bool single = true);
61
		bool remove(const Utils::SString &str, bool single = true);
62
		void removeAt(int at);
62
		void removeAt(int at);
63
 
63
 
64
		size_t size() const;
64
		size_t size() const;
65
		bool empty() const;
65
		bool empty() const;
66
 
66
 
67
		const Utils::SStringList* operator[](int num) const;
67
		const Utils::SStringList* operator[](int num) const;
68
	};
68
	};
-
 
69
 
69
} //NAMESPACE
70
} //NAMESPACE
70
 
71