Subversion Repositories spk

Rev

Rev 246 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 246 Rev 273
Line 66... Line 66...
66
	void WStringList::pushFront(const WString &str)
66
	void WStringList::pushFront(const WString &str)
67
	{
67
	{
68
		pushFront(str, L"");
68
		pushFront(str, L"");
69
	}
69
	}
70
 
70
 
71
	void WStringList::insertAt(int at, const WString& str, const WString& data)
71
	void WStringList::insertAt(size_t at, const WString& str, const WString& data)
72
	{
72
	{
73
		WStringNode *strNode = new WStringNode;
73
		WStringNode *strNode = new WStringNode;
74
		strNode->str = str;
74
		strNode->str = str;
75
		strNode->data = data;
75
		strNode->data = data;
76
		_lList->insertAt(at, strNode);
76
		_lList->insertAt(at, strNode);
77
	}
77
	}
78
	void WStringList::insertAt(int at, const WString& str)
78
	void WStringList::insertAt(size_t at, const WString& str)
79
	{
79
	{
80
		insertAt(at, str, L"");
80
		insertAt(at, str, L"");
81
	}
81
	}
82
 
82
 
83
	void WStringList::clear()
83
	void WStringList::clear()
Line 144... Line 144...
144
		if (front)
144
		if (front)
145
			return front->str;
145
			return front->str;
146
		return Utils::WString::Null();
146
		return Utils::WString::Null();
147
	}
147
	}
148
 
148
 
149
	Utils::WStringNode *WStringList::get(int i) const
149
	Utils::WStringNode *WStringList::get(size_t i) const
150
	{
150
	{
151
		return _lList->get(i);
151
		return _lList->get(i);
152
	}
152
	}
153
 
153
 
154
	Utils::WString WStringList::findData(const Utils::WString &data, bool bIgnoreCase) const
154
	Utils::WString WStringList::findData(const Utils::WString &data, bool bIgnoreCase) const
Line 169... Line 169...
169
		}
169
		}
170
 
170
 
171
		return WString::Null();
171
		return WString::Null();
172
	}
172
	}
173
 
173
 
174
	int WStringList::findStringAndData(const Utils::WString& str, const Utils::WString& data, bool bIgnoreCase) const
174
	long WStringList::findStringAndData(const Utils::WString& str, const Utils::WString& data, bool bIgnoreCase) const
175
	{
175
	{
176
		size_t pos = 0;
176
		size_t pos = 0;
177
		for (CList<WStringNode>::iterator itr = _lList->begin(); itr != _lList->end(); itr++, pos++) {
177
		for (CList<WStringNode>::iterator itr = _lList->begin(); itr != _lList->end(); itr++, pos++) {
178
			if ((*itr)->str.Compare(str, !bIgnoreCase))
178
			if ((*itr)->str.Compare(str, !bIgnoreCase))
179
			{
179
			{
180
				if ((*itr)->data.Compare(data, !bIgnoreCase))
180
				if ((*itr)->data.Compare(data, !bIgnoreCase))
181
					return static_cast<int>(pos);
181
					return static_cast<long>(pos);
182
			}
182
			}
183
		}
183
		}
184
 
184
 
185
		return -1;
185
		return -1;
186
	}
186
	}
187
 
187
 
188
	int WStringList::findPos(const Utils::WString& str, bool bIgnoreCase) const
188
	long WStringList::findPos(const Utils::WString& str, bool bIgnoreCase) const
189
	{
189
	{
190
		size_t pos = 0;
190
		size_t pos = 0;
191
		for (CList<WStringNode>::iterator itr = _lList->begin(); itr != _lList->end(); itr++, pos++) {
191
		for (CList<WStringNode>::iterator itr = _lList->begin(); itr != _lList->end(); itr++, pos++) {
192
			if ((*itr)->str.Compare(str, !bIgnoreCase))
192
			if ((*itr)->str.Compare(str, !bIgnoreCase))
193
				return static_cast<int>(pos);
193
				return static_cast<long>(pos);
194
		}
194
		}
195
 
195
 
196
		return -1;
196
		return -1;
197
	}
197
	}
198
 
198
 
Line 241... Line 241...
241
		}
241
		}
242
 
242
 
243
		return false;
243
		return false;
244
	}
244
	}
245
 
245
 
246
	void WStringList::removeAt(int at)
246
	void WStringList::removeAt(size_t at)
247
	{
247
	{
248
		if (!_lList->empty())
248
		if (!_lList->empty())
249
		{
249
		{
250
			auto var = _lList->get(at);
250
			auto var = _lList->get(at);
251
			if (var)
251
			if (var)
Line 291... Line 291...
291
	bool WStringList::empty() const
291
	bool WStringList::empty() const
292
	{
292
	{
293
		return _lList->empty();
293
		return _lList->empty();
294
	}
294
	}
295
 
295
 
296
	const Utils::WStringNode* WStringList::operator[](int num) const
296
	const Utils::WStringNode* WStringList::operator[](size_t num) const
297
	{
297
	{
298
		return _lList->get(num);
298
		return _lList->get(num);
299
	}
299
	}
300
 
300
 
301
	Utils::WStringNode* WStringList::operator[](int num)
301
	Utils::WStringNode* WStringList::operator[](size_t num)
302
	{
302
	{
303
		return _lList->get(num);
303
		return _lList->get(num);
304
	}
304
	}
305
	const Utils::WStringNode* WStringList::operator[](const WString& str) const
305
	const Utils::WStringNode* WStringList::operator[](const WString& str) const
306
	{
306
	{