2928
|
1 /* |
|
2 |
|
3 Copyright (C) 1996, 1997 John W. Eaton |
|
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 |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #ifdef HAVE_CONFIG_H |
|
24 #include <config.h> |
|
25 #endif |
|
26 |
3523
|
27 #include <iostream> |
2928
|
28 |
|
29 #include "mach-info.h" |
|
30 |
|
31 #include "error.h" |
4055
|
32 #include "oct-obj.h" |
2928
|
33 #include "oct-stream.h" |
|
34 #include "ops.h" |
|
35 #include "ov.h" |
|
36 #include "ov-file.h" |
|
37 #include "ov-struct.h" |
|
38 #include "ov-typeinfo.h" |
|
39 |
|
40 // file by struct ops. |
|
41 |
|
42 DEFBINOP (lshift, file, struct) |
|
43 { |
|
44 CAST_BINOP_ARGS (const octave_file&, const octave_struct&); |
|
45 |
3340
|
46 octave_stream oct_stream = v1.stream_value (); |
2928
|
47 |
|
48 if (oct_stream) |
|
49 { |
3523
|
50 std::ostream *osp = oct_stream.output_stream (); |
2928
|
51 |
|
52 if (osp) |
|
53 { |
3523
|
54 std::ostream& os = *osp; |
2928
|
55 |
|
56 v2.print_raw (os); |
|
57 } |
|
58 else |
|
59 error ("invalid file specified for binary operator `<<'"); |
|
60 } |
|
61 |
|
62 return octave_value (oct_stream, v1.stream_number ()); |
|
63 } |
|
64 |
|
65 void |
|
66 install_fil_rec_ops (void) |
|
67 { |
3538
|
68 INSTALL_BINOP (op_lshift, octave_file, octave_struct, lshift); |
2928
|
69 } |
|
70 |
|
71 /* |
|
72 ;;; Local Variables: *** |
|
73 ;;; mode: C++ *** |
|
74 ;;; End: *** |
|
75 */ |