Subversion Repositories spk

Rev

Rev 170 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 170 Rev 179
Line 19... Line 19...
19
		strNode->str = str;
19
		strNode->str = str;
20
		strNode->data = data;
20
		strNode->data = data;
21
		_lList->push_back(strNode);
21
		_lList->push_back(strNode);
22
	}
22
	}
23
 
23
 
-
 
24
	void CStringList::popFront()
-
 
25
	{
-
 
26
		if (!_lList->empty())
-
 
27
		{
-
 
28
			delete _lList->front();
-
 
29
			_lList->removeAt(0);
-
 
30
		}
-
 
31
	}
24
	void CStringList::popBack()
32
	void CStringList::popBack()
25
	{
33
	{
26
		if (!_lList->empty())
34
		if (!_lList->empty())
27
		{
35
		{
28
			delete _lList->back();
36
			delete _lList->back();
Line 94... Line 102...
94
	}
102
	}
95
 
103
 
96
	Utils::SStringList *CStringList::next()
104
	Utils::SStringList *CStringList::next()
97
	{
105
	{
98
		return _lList->next();
106
		return _lList->next();
99
	}
107
	}
100
 
108
 
101
	CStringListIterator CStringList::begin() const
109
	CStringListIterator CStringList::begin() const
102
	{
110
	{
103
		return _lList->begin();
111
		return _lList->begin();
104
	}
112
	}
Line 145... Line 153...
145
			if ((*itr)->str.Compare(str, !bIgnoreCase))
153
			if ((*itr)->str.Compare(str, !bIgnoreCase))
146
				return (*itr)->data;
154
				return (*itr)->data;
147
		}
155
		}
148
 
156
 
149
		return String::Null();
157
		return String::Null();
150
	}
158
	}
151
 
159
 
152
	int CStringList::findStringAndData(const Utils::String& str, const Utils::String& data, bool bIgnoreCase) const
160
	int CStringList::findStringAndData(const Utils::String& str, const Utils::String& data, bool bIgnoreCase) const
153
	{
161
	{
154
		size_t pos = 0;
162
		size_t pos = 0;
155
		for (CList<SStringList>::iterator itr = _lList->begin(); itr != _lList->end(); itr++, pos++) {
163
		for (CList<SStringList>::iterator itr = _lList->begin(); itr != _lList->end(); itr++, pos++) {
156
			if ((*itr)->str.Compare(str, !bIgnoreCase))
164
			if ((*itr)->str.Compare(str, !bIgnoreCase))
157
			{
165
			{
158
				if ((*itr)->data.Compare(data, !bIgnoreCase))
166
				if ((*itr)->data.Compare(data, !bIgnoreCase))
159
					return static_cast<int>(pos);
167
					return static_cast<int>(pos);
160
			}
168
			}
161
		}
169
		}
162
 
170
 
163
		return -1;
171
		return -1;
164
	}
172
	}
165
 
173
 
166
	int CStringList::findPos(const Utils::String& str, bool bIgnoreCase) const
174
	int CStringList::findPos(const Utils::String& str, bool bIgnoreCase) const
167
	{
175
	{
168
		size_t pos = 0;
176
		size_t pos = 0;
Line 170... Line 178...
170
			if ((*itr)->str.Compare(str, !bIgnoreCase))
178
			if ((*itr)->str.Compare(str, !bIgnoreCase))
171
				return static_cast<int>(pos);
179
				return static_cast<int>(pos);
172
		}
180
		}
173
 
181
 
174
		return -1;
182
		return -1;
175
	}
183
	}
176
 
184
 
177
	bool CStringList::containsStringAndData(const Utils::String& str, const Utils::String& data, bool bIgnoreCase) const
185
	bool CStringList::containsStringAndData(const Utils::String& str, const Utils::String& data, bool bIgnoreCase) const
178
	{
186
	{
179
		size_t pos = 0;
187
		size_t pos = 0;
180
		for (CList<SStringList>::iterator itr = _lList->begin(); itr != _lList->end(); itr++, pos++) {
188
		for (CList<SStringList>::iterator itr = _lList->begin(); itr != _lList->end(); itr++, pos++) {
181
			if ((*itr)->str.Compare(str, !bIgnoreCase))
189
			if ((*itr)->str.Compare(str, !bIgnoreCase))
182
			{
190
			{
183
				if ((*itr)->data.Compare(data, !bIgnoreCase))
191
				if ((*itr)->data.Compare(data, !bIgnoreCase))
184
					return true;
192
					return true;
185
			}
193
			}
186
		}
194
		}
187
 
195
 
188
		return false;
196
		return false;
189
	}
197
	}
190
 
198
 
191
	bool CStringList::containsData(const Utils::String &data, bool bIgnoreCase) const
199
	bool CStringList::containsData(const Utils::String &data, bool bIgnoreCase) const
192
	{
200
	{
193
		for (CList<SStringList>::iterator itr = _lList->begin(); itr != _lList->end(); itr++) {
201
		for (CList<SStringList>::iterator itr = _lList->begin(); itr != _lList->end(); itr++) {
194
			if ((*itr)->data.Compare(data, !bIgnoreCase))
202
			if ((*itr)->data.Compare(data, !bIgnoreCase))
195
				return true;
203
				return true;
196
		}
204
		}
197
 
205
 
198
		return false;
206
		return false;
199
	}
207
	}
200
 
208
 
201
	bool CStringList::changeData(const Utils::String &str, const Utils::String &data, bool bIgnoreCase)
209
	bool CStringList::changeData(const Utils::String &str, const Utils::String &data, bool bIgnoreCase)
202
	{
210
	{
203
		for (CList<SStringList>::iterator itr = _lList->begin(); itr != _lList->end(); itr++) {
211
		for (CList<SStringList>::iterator itr = _lList->begin(); itr != _lList->end(); itr++) {
204
			if ((*itr)->str.Compare(str, !bIgnoreCase))
212
			if ((*itr)->str.Compare(str, !bIgnoreCase))
205
			{
213
			{
206
				(*itr)->data = data;
214
				(*itr)->data = data;
207
				return true;
215
				return true;
208
			}
216
			}
209
		}
217
		}
210
 
218
 
211
		return false;
219
		return false;
212
	}
220
	}
213
 
221
 
214
	bool CStringList::contains(const Utils::String &str, bool bIgnoreCase) const
222
	bool CStringList::contains(const Utils::String &str, bool bIgnoreCase) const
215
	{
223
	{
216
		for (CList<SStringList>::iterator itr = _lList->begin(); itr != _lList->end(); itr++) {
224
		for (CList<SStringList>::iterator itr = _lList->begin(); itr != _lList->end(); itr++) {
217
			if ((*itr)->str.Compare(str, !bIgnoreCase))
225
			if ((*itr)->str.Compare(str, !bIgnoreCase))
218
				return true;
226
				return true;
219
		}
227
		}
220
 
228
 
221
		return false;
229
		return false;
222
	}
230
	}
223
 
231
 
224
	void CStringList::removeAt(int at)
232
	void CStringList::removeAt(int at)
225
	{
233
	{
-
 
234
		if (!_lList->empty())
-
 
235
		{
-
 
236
			auto var = _lList->get(at);
-
 
237
			if (var)
-
 
238
				delete var;
226
		_lList->removeAt(at);
239
			_lList->removeAt(at);
-
 
240
		}
227
	}
241
	}
228
 
242
 
229
	CStringListIterator CStringList::remove(CStringListIterator itr)
243
	CStringListIterator CStringList::remove(CStringListIterator itr)
230
	{
244
	{
231
		return _lList->remove(itr);
245
		return _lList->remove(itr);