Subversion Repositories spk

Rev

Rev 246 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
195 cycrow 1
#pragma once
2
 
3
#include "WString.h"
4
#include "../lists.h"
5
#include "List.h"
6
 
7
namespace Utils {
8
 
9
	typedef struct {
10
		WString str;
11
		WString data;
12
	} WStringNode;
13
 
14
	typedef CListNode<WStringNode> WStringListNode;
15
	typedef CList<WStringNode>::iterator WStringListIterator;
16
 
17
	class SPKEXPORT WStringList
18
	{
19
	private:
20
		CList<WStringNode> *_lList;
21
 
22
	public:
23
		WStringList();
24
		~WStringList();
25
 
246 cycrow 26
		void pushBack(const WString& str, const WString& data);
27
		void pushBack(const WString& str);
28
		void pushBackUnique(const WString& str, const WString& data);
29
		void pushBackUnique(const WString& str);
195 cycrow 30
		void pushFront(const WString &str, const WString &data);
31
		void pushFront(const WString &str);
32
		void popBack();
33
		void popFront();
34
 
273 cycrow 35
		void insertAt(size_t at, const WString& str, const WString& data);
36
		void insertAt(size_t at, const WString& str);
195 cycrow 37
 
38
		void clear();
39
		void tokenise(const WString &str, const WString &token);
40
 
41
		Utils::WString firstString();
42
		Utils::WString nextString();
43
		Utils::WStringNode *first();
44
		Utils::WStringNode *next();
45
		WStringListIterator begin() const;
46
		WStringListIterator end() const;
47
 
48
		Utils::WString front() const;
49
		Utils::WString back() const;
50
 
273 cycrow 51
		Utils::WStringNode *get(size_t i) const;
195 cycrow 52
 
53
		bool changeData(const Utils::WString &str, const Utils::WString &data, bool bIgnoreCase = false);
54
		bool contains(const Utils::WString &data, bool bIgnoreCase = false) const;
55
		bool containsData(const Utils::WString& str, bool bIgnoreCase = false) const;
56
		bool containsStringAndData(const Utils::WString& str, const Utils::WString &data, bool bIgnoreCase = false) const;
57
		Utils::WString findData(const Utils::WString &data, bool bIgnoreCase = false) const;
58
		Utils::WString findString(const Utils::WString &str, bool bIgnoreCase = false) const;
273 cycrow 59
		long findStringAndData(const Utils::WString& str, const Utils::WString& data, bool bIgnoreCase = false) const;
60
		long findPos(const Utils::WString& str, bool bIgnoreCase = false) const;
195 cycrow 61
 
62
		WStringListIterator remove(WStringListIterator itr);
63
		bool remove(const Utils::WString &str, bool single = true);
273 cycrow 64
		void removeAt(size_t at);
195 cycrow 65
 
66
		size_t size() const;
67
		bool empty() const;
68
 
273 cycrow 69
		const Utils::WStringNode* operator[](size_t num) const;
70
		Utils::WStringNode* operator[](size_t num);
216 cycrow 71
		const Utils::WStringNode* operator[](const WString& str) const;
72
		Utils::WStringNode* operator[](const WString& str);
195 cycrow 73
	};
74
} //NAMESPACE
75