PageRenderTime 18ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/readline/library/history_iterator.e

http://github.com/tybor/Liberty
Specman e | 70 lines | 40 code | 14 blank | 16 comment | 0 complexity | 8d827b305d57aa89c523aed0d54ab60b MD5 | raw file
 1class HISTORY_ITERATOR
 2
 3inherit
 4   ITERATOR[HISTORY_ENTRY]
 5
 6insert
 7   HISTORY_EXTERNALS
 8
 9create {READ_LINE_HISTORY}
10   make
11
12feature {ANY}
13   start
14      do
15         index := history.lower
16      end
17
18   item: HISTORY_ENTRY
19      do
20         Result := history.item(index)
21      end
22
23   next
24      do
25         index := index + 1
26      end
27
28   is_off: BOOLEAN
29      do
30         Result := index > history.upper
31      end
32
33feature {ANY}
34   generation: INTEGER
35      do
36         Result := history.generation
37      end
38
39   iterable_generation: INTEGER
40
41feature {}
42   history: READ_LINE_HISTORY
43   index: INTEGER
44
45   make (hist: READ_LINE_HISTORY)
46      do
47         history := hist
48         iterable_generation := hist.generation
49         start
50      end
51
52end
53
54-- Liberty Eiffel wrappers for GNU readline library Copyright (C) 2010-2017: ,2012,2013 Paolo Redaelli, Cyril Adrian 
55-- 
56-- The GNU C Library is free software; you can redistribute it and/or
57-- modify it under the terms of the GNU Lesser General Public
58-- License as published by the Free Software Foundation; either
59-- version 2.1 of the License, or (at your option) any later version.
60-- 
61-- The GNU C Library is distributed in the hope that it will be useful,
62-- but WITHOUT ANY WARRANTY; without even the implied warranty of
63-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
64-- Lesser General Public License for more details.
65-- 
66-- You should have received a copy of the GNU Lesser General Public
67-- License along with the GNU C Library; if not, write to the Free
68-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
69-- 02110-1301 USA
70