PageRenderTime 19ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/src/wrappers/glib/partially-implemented/g_slist_const_string.e

http://github.com/tybor/Liberty
Specman e | 52 lines | 42 code | 10 blank | 0 comment | 3 complexity | 9bd3f957842281aac2c62d0536d37b1b MD5 | raw file
 1indexing
 2	description: "List of (const) strings"
 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 G_SLIST_CONST_STRING
23
24inherit
25	G_SLIST_STRING
26		redefine
27			first,last,item
28		end
29	
30creation make, from_external_pointer
31
32feature
33		first: CONST_STRING is 
34		do
35			create Result.from_external (g_slist_get_data (handle))
36		end
37
38	last: like first is 
39		do
40			create Result.from_external (g_slist_get_data (g_slist_last (handle)))
41		end
42
43	item (i: INTEGER): like first is
44		local cstr: POINTER
45		do
46			cstr := g_slist_nth_data (handle, i)
47			if cstr.is_not_null then
48				create Result.from_external (cstr)
49			end
50		end
51
52end -- class G_SLIST_CONST_STRING