Subversion Repositories spk

Rev

Rev 121 | Rev 160 | 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);
111 cycrow 30
 
9 cycrow 31
		void clear();
98 cycrow 32
		void tokenise(const String &str, const String &token);
33
 
34
		Utils::String firstString();
35
		Utils::String nextString();
112 cycrow 36
		Utils::SStringList *first();
37
		Utils::SStringList *next();
38
		CStringListIterator begin();
39
		CStringListIterator end();
101 cycrow 40
 
116 cycrow 41
		Utils::SStringList *get(int i);
42
 
124 cycrow 43
		bool changeData(const Utils::String &str, const Utils::String &data, bool bIgnoreCase = false);
121 cycrow 44
		bool contains(const Utils::String &data, bool bIgnoreCase = false) const;
45
		bool containsData(const Utils::String &str, bool bIgnoreCase = false) const;
101 cycrow 46
		Utils::String findData(const Utils::String &data, bool bIgnoreCase = false) const;
47
		Utils::String findString(const Utils::String &str, bool bIgnoreCase = false) const;
112 cycrow 48
 
121 cycrow 49
		bool remove(const Utils::String &str, bool single = true);
50
		void removeAt(int at);
51
 
112 cycrow 52
		size_t size() const;
53
		bool empty() const;
8 cycrow 54
	};
55
} //NAMESPACE
56