/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

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