1
|
1 // procstream.h -*- C++ -*- |
|
2 /* |
|
3 |
1009
|
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
1
|
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 |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
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 |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1
|
21 |
|
22 */ |
|
23 |
383
|
24 #if !defined (octave_procstream_h) |
|
25 #define octave_procstream_h 1 |
1
|
26 |
1297
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
1380
|
31 #include <fstream.h> |
|
32 |
|
33 class procbuf; |
1
|
34 |
|
35 class |
1380
|
36 iprocstream : public ifstream |
1
|
37 { |
1380
|
38 public: |
|
39 iprocstream (void); |
|
40 iprocstream (const char *command, int mode=ios::in); |
|
41 |
|
42 ~iprocstream (void); |
1
|
43 |
1380
|
44 void open (const char *command, int mode=ios::in); |
|
45 |
|
46 int is_open (void); |
1
|
47 |
483
|
48 int close (void); |
1380
|
49 |
|
50 private: |
|
51 procbuf *pbuf; |
1
|
52 }; |
|
53 |
|
54 class |
1380
|
55 oprocstream : public ofstream |
1
|
56 { |
1380
|
57 public: |
|
58 oprocstream (void); |
|
59 oprocstream (const char *command, int mode=ios::out); |
1
|
60 |
1380
|
61 ~oprocstream (void); |
1
|
62 |
1380
|
63 void open (const char *command, int mode=ios::out); |
|
64 |
|
65 int is_open (void); |
1
|
66 |
1380
|
67 int close (void); |
|
68 |
|
69 private: |
|
70 procbuf *pbuf; |
1
|
71 }; |
|
72 |
|
73 #endif |
|
74 |
|
75 /* |
|
76 ;;; Local Variables: *** |
|
77 ;;; mode: C++ *** |
|
78 ;;; page-delimiter: "^/\\*" *** |
|
79 ;;; End: *** |
|
80 */ |