| 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 |   | 
        
           |  |  | 26 | 		void pushBack(const WString &str, const WString &data);
 | 
        
           |  |  | 27 | 		void pushBack(const WString &str);
 | 
        
           |  |  | 28 | 		void pushFront(const WString &str, const WString &data);
 | 
        
           |  |  | 29 | 		void pushFront(const WString &str);
 | 
        
           |  |  | 30 | 		void popBack();
 | 
        
           |  |  | 31 | 		void popFront();
 | 
        
           |  |  | 32 |   | 
        
           |  |  | 33 | 		void insertAt(int at, const WString& str, const WString& data);
 | 
        
           |  |  | 34 | 		void insertAt(int at, const WString& str);
 | 
        
           |  |  | 35 |   | 
        
           |  |  | 36 | 		void clear();
 | 
        
           |  |  | 37 | 		void tokenise(const WString &str, const WString &token);
 | 
        
           |  |  | 38 |   | 
        
           |  |  | 39 | 		Utils::WString firstString();
 | 
        
           |  |  | 40 | 		Utils::WString nextString();
 | 
        
           |  |  | 41 | 		Utils::WStringNode *first();
 | 
        
           |  |  | 42 | 		Utils::WStringNode *next();
 | 
        
           |  |  | 43 | 		WStringListIterator begin() const;
 | 
        
           |  |  | 44 | 		WStringListIterator end() const;
 | 
        
           |  |  | 45 |   | 
        
           |  |  | 46 | 		Utils::WString front() const;
 | 
        
           |  |  | 47 | 		Utils::WString back() const;
 | 
        
           |  |  | 48 |   | 
        
           |  |  | 49 | 		Utils::WStringNode *get(int i) const;
 | 
        
           |  |  | 50 |   | 
        
           |  |  | 51 | 		bool changeData(const Utils::WString &str, const Utils::WString &data, bool bIgnoreCase = false);
 | 
        
           |  |  | 52 | 		bool contains(const Utils::WString &data, bool bIgnoreCase = false) const;
 | 
        
           |  |  | 53 | 		bool containsData(const Utils::WString& str, bool bIgnoreCase = false) const;
 | 
        
           |  |  | 54 | 		bool containsStringAndData(const Utils::WString& str, const Utils::WString &data, bool bIgnoreCase = false) const;
 | 
        
           |  |  | 55 | 		Utils::WString findData(const Utils::WString &data, bool bIgnoreCase = false) const;
 | 
        
           |  |  | 56 | 		Utils::WString findString(const Utils::WString &str, bool bIgnoreCase = false) const;
 | 
        
           |  |  | 57 | 		int findStringAndData(const Utils::WString& str, const Utils::WString& data, bool bIgnoreCase = false) const;
 | 
        
           |  |  | 58 | 		int findPos(const Utils::WString& str, bool bIgnoreCase = false) const;
 | 
        
           |  |  | 59 |   | 
        
           |  |  | 60 | 		WStringListIterator remove(WStringListIterator itr);
 | 
        
           |  |  | 61 | 		bool remove(const Utils::WString &str, bool single = true);
 | 
        
           |  |  | 62 | 		void removeAt(int at);
 | 
        
           |  |  | 63 |   | 
        
           |  |  | 64 | 		size_t size() const;
 | 
        
           |  |  | 65 | 		bool empty() const;
 | 
        
           |  |  | 66 |   | 
        
           |  |  | 67 | 		const Utils::WStringNode* operator[](int num) const;
 | 
        
           |  |  | 68 | 	};
 | 
        
           |  |  | 69 | } //NAMESPACE
 | 
        
           |  |  | 70 |   |