PageRenderTime 3ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/common/library/string_array_iterator.e

http://github.com/tybor/Liberty
Specman e | 48 lines | 34 code | 14 blank | 0 comment | 2 complexity | f835b5c96fa5269e57147a87aad5bab3 MD5 | raw file
 1indexing
 2	description: "Iterator over STRING_ARRAY, wrapper of 'gchar **'"
 3	copyright: "[
 4					Copyright (C) 2007 Paolo Redaelli
 5					
 6					This library is free software; you can redistribute it and/or
 7					modify it under the terms of the GNU Lesser General Public License
 8					as published by the Free Software Foundation; either version 2.1 of
 9					the License, or (at your option) any later version.
10					
11					This library is distributed in the hope that it will be useful, but
12					WITHOUT ANY WARRANTY; without even the implied warranty of
13					MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14					Lesser General Public License for more details.
15
16					You should have received a copy of the GNU Lesser General Public
17					License along with this library; if not, write to the Free Software
18					Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19					02110-1301 USA
20			]"
21
22class STRING_ARRAY_ITERATOR
23
24inherit ITERATOR[STRING]
25
26creation make
27
28feature {} -- Implementation and creation
29	make (an_array: STRING_ARRAY) is
30		require array_not_void: an_array/=Void
31		do
32			array:=an_array
33		end
34
35	index: INTEGER
36
37	array: STRING_ARRAY
38	
39feature {ANY}
40	start is do index:=array.lower end
41
42	is_off: BOOLEAN is do Result:=not array.valid_index(index) end
43
44	item: STRING is do Result:=array.item(index) end
45
46	next is do index:=index+1 end
47
48end -- class STRING_ARRAY_ITERATOR