2081
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
2081
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
2081
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include <config.h> |
|
26 #endif |
|
27 |
|
28 #include <cstdio> |
|
29 |
|
30 #include "oct-prcstrm.h" |
6726
|
31 #include "sysdep.h" |
3951
|
32 |
3340
|
33 octave_stream |
3544
|
34 octave_iprocstream::create (const std::string& n, std::ios::openmode arg_md, |
4587
|
35 oct_mach_info::float_format ff) |
3340
|
36 { |
4587
|
37 return octave_stream (new octave_iprocstream (n, arg_md, ff)); |
3340
|
38 } |
|
39 |
3523
|
40 octave_iprocstream::octave_iprocstream (const std::string& n, |
3544
|
41 std::ios::openmode arg_md, |
4587
|
42 oct_mach_info::float_format ff) |
6726
|
43 : octave_stdiostream (n, octave_popen (n.c_str (), "r"), |
|
44 arg_md, ff, octave_pclose) |
2081
|
45 { |
|
46 } |
|
47 |
|
48 octave_iprocstream::~octave_iprocstream (void) |
|
49 { |
3652
|
50 do_close (); |
|
51 } |
|
52 |
3340
|
53 octave_stream |
3544
|
54 octave_oprocstream::create (const std::string& n, std::ios::openmode arg_md, |
4587
|
55 oct_mach_info::float_format ff) |
3340
|
56 { |
4587
|
57 return octave_stream (new octave_oprocstream (n, arg_md, ff)); |
3340
|
58 } |
|
59 |
3523
|
60 octave_oprocstream::octave_oprocstream (const std::string& n, |
3544
|
61 std::ios::openmode arg_md, |
4587
|
62 oct_mach_info::float_format ff) |
6726
|
63 : octave_stdiostream (n, octave_popen (n.c_str (), "w"), |
|
64 arg_md, ff, octave_pclose) |
2081
|
65 { |
|
66 } |
|
67 |
|
68 octave_oprocstream::~octave_oprocstream (void) |
|
69 { |
3652
|
70 do_close (); |
|
71 } |
|
72 |
2081
|
73 /* |
|
74 ;;; Local Variables: *** |
|
75 ;;; mode: C++ *** |
|
76 ;;; End: *** |
|
77 */ |