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 "error.h" |
|
29 #include "oct-iostrm.h" |
|
30 |
|
31 // Position a stream at OFFSET relative to ORIGIN. |
|
32 |
|
33 int |
4797
|
34 octave_base_iostream::seek (long, int) |
2081
|
35 { |
|
36 invalid_operation (); |
|
37 return -1; |
|
38 } |
|
39 |
|
40 // Return current stream position. |
|
41 |
4797
|
42 long |
|
43 octave_base_iostream::tell (void) |
2081
|
44 { |
|
45 invalid_operation (); |
|
46 return -1; |
|
47 } |
|
48 |
|
49 // Return non-zero if EOF has been reached on this stream. |
|
50 |
|
51 bool |
|
52 octave_base_iostream::eof (void) const |
|
53 { |
|
54 invalid_operation (); |
|
55 return false; |
|
56 } |
|
57 |
|
58 void |
|
59 octave_base_iostream::invalid_operation (void) const |
|
60 { |
|
61 ::error ("%s: invalid operation", stream_type ()); |
|
62 } |
|
63 |
3342
|
64 // Return non-zero if EOF has been reached on this stream. |
|
65 |
|
66 bool |
|
67 octave_istream::eof (void) const |
|
68 { |
|
69 return is && is->eof (); |
|
70 } |
|
71 |
3340
|
72 octave_stream |
4587
|
73 octave_istream::create (std::istream *arg, const std::string& n) |
3340
|
74 { |
4587
|
75 return octave_stream (new octave_istream (arg, n)); |
3340
|
76 } |
|
77 |
3342
|
78 // Return non-zero if EOF has been reached on this stream. |
|
79 |
|
80 bool |
|
81 octave_ostream::eof (void) const |
|
82 { |
|
83 return os && os->eof (); |
|
84 } |
|
85 |
3340
|
86 octave_stream |
4587
|
87 octave_ostream::create (std::ostream *arg, const std::string& n) |
3340
|
88 { |
4587
|
89 return octave_stream (new octave_ostream (arg, n)); |
3340
|
90 } |
|
91 |
2081
|
92 /* |
|
93 ;;; Local Variables: *** |
|
94 ;;; mode: C++ *** |
|
95 ;;; End: *** |
|
96 */ |