2081
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2005, 2006, 2007 |
|
4 John W. Eaton |
2081
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
7016
|
10 Free Software Foundation; either version 3 of the License, or (at your |
|
11 option) any later version. |
2081
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
7016
|
19 along with Octave; see the file COPYING. If not, see |
|
20 <http://www.gnu.org/licenses/>. |
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 } |