Subversion Repositories spk

Rev

Rev 165 | Rev 179 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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