/src/wrappers/glib/partially-implemented/iterator_on_g_slist_string.e
http://github.com/tybor/Liberty · Specman e · 68 lines · 58 code · 10 blank · 0 comment · 3 complexity · 8dd4f2a69d8b5fbf252d11323b534dcf MD5 · raw file
- indexing
- description: "Iterator for G_SLIST_STRING."
- copyright: "[
- Copyright (C) 2006 Paolo Redaelli
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License
- as published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 USA
- ]"
- class ITERATOR_ON_G_SLIST_STRING
- inherit
- ITERATOR [STRING]
- WRAPPER_HANDLER
- insert
- GSLIST_EXTERNALS
- GSLIST_STRUCT
- creation make
-
- feature {} -- Creation
- make (a_list: G_SLIST_STRING) is
- require valid_list: a_list/=Void
- do
- list := a_list.handle
- end
-
- feature {} -- Implementation
- list: POINTER
- current_element: POINTER
- feature -- Iterator's features
- start is
- do
- current_element := list
- end
-
- is_off: BOOLEAN is
- do
- Result:=(current_element.is_null)
- end
-
- item: STRING is
- local cstr: POINTER
- do
- cstr := gslist_struct_get_data(current_element)
- check
- string_not_null: cstr.is_not_null
- end
- create Result.from_external_copy(cstr)
- ensure result_not_void: Result /= Void
- end
-
- next is
- do
- current_element := gslist_struct_get_next (current_element)
- end
- end