/src/lib/exec/low_level/exec_output_stream_win32.e

http://github.com/tybor/Liberty · Specman e · 137 lines · 94 code · 20 blank · 23 comment · 2 complexity · eacce277b9dfeeb80d5530eafdd45d6c MD5 · raw file

  1. -- This file is part of a Liberty Eiffel library.
  2. -- See the full copyright at the end.
  3. --
  4. class EXEC_OUTPUT_STREAM_WIN32
  5. inherit
  6. TERMINAL_OUTPUT_STREAM
  7. redefine
  8. can_put_character
  9. end
  10. insert
  11. EXEC_STREAM
  12. create {PROCESS}
  13. make
  14. feature {ANY}
  15. is_connected: BOOLEAN
  16. can_put_character (c: CHARACTER): BOOLEAN
  17. do
  18. Result := not process.is_finished
  19. end
  20. disconnect
  21. do
  22. is_connected := False
  23. basic_exec_close(handle)
  24. end
  25. feature {FILTER}
  26. filtered_put_character (c: CHARACTER)
  27. do
  28. basic_exec_put_character(handle, c)
  29. if c = '%N' then
  30. filtered_flush
  31. end
  32. end
  33. filtered_flush
  34. do
  35. basic_exec_flush(handle)
  36. end
  37. filtered_descriptor: INTEGER
  38. do
  39. std_error.put_string("EXEC_OUTPUT_STREAM_WIN32.filtered_stream_pointer has been called!%N")
  40. crash
  41. end
  42. filtered_has_descriptor: BOOLEAN False
  43. filtered_stream_pointer: POINTER
  44. do
  45. std_error.put_string("EXEC_OUTPUT_STREAM_WIN32.filtered_stream_pointer has been called!%N")
  46. crash
  47. end
  48. filtered_has_stream_pointer: BOOLEAN False
  49. feature {PROCESS}
  50. make (a_process: like process)
  51. require
  52. a_process /= Void
  53. process /= Void implies process = a_process
  54. do
  55. process := a_process
  56. create_pipe
  57. is_connected := pipe.is_not_null
  58. if is_connected then
  59. handle := basic_exec_get_out_handle(pipe)
  60. end
  61. end
  62. process: PROCESS
  63. feature {}
  64. handle: POINTER
  65. basic_exec_get_out_handle (a_pipe: POINTER): POINTER
  66. external "plug_in"
  67. alias "{
  68. location: "${sys}/plugins"
  69. module_name: "exec"
  70. feature_name: "basic_exec_win32_get_out_handle"
  71. }"
  72. end
  73. basic_exec_put_character (handle_: POINTER; c: CHARACTER)
  74. external "plug_in"
  75. alias "{
  76. location: "${sys}/plugins"
  77. module_name: "exec"
  78. feature_name: "basic_exec_win32_put_character"
  79. }"
  80. end
  81. basic_exec_flush (handle_: POINTER)
  82. external "plug_in"
  83. alias "{
  84. location: "${sys}/plugins"
  85. module_name: "exec"
  86. feature_name: "basic_exec_win32_flush"
  87. }"
  88. end
  89. basic_exec_close (handle_: POINTER)
  90. external "plug_in"
  91. alias "{
  92. location: "${sys}/plugins"
  93. module_name: "exec"
  94. feature_name: "basic_exec_win32_close"
  95. }"
  96. end
  97. end -- class EXEC_OUTPUT_STREAM_WIN32
  98. --
  99. -- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
  100. --
  101. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  102. -- of this software and associated documentation files (the "Software"), to deal
  103. -- in the Software without restriction, including without limitation the rights
  104. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  105. -- copies of the Software, and to permit persons to whom the Software is
  106. -- furnished to do so, subject to the following conditions:
  107. --
  108. -- The above copyright notice and this permission notice shall be included in
  109. -- all copies or substantial portions of the Software.
  110. --
  111. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  112. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  113. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  114. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  115. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  116. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  117. -- THE SOFTWARE.