comparison src/OPERATORS/op-fil-b.cc @ 2928:295f037b4b3e

[project @ 1997-05-05 05:32:33 by jwe]
author jwe
date Mon, 05 May 1997 05:33:54 +0000
parents
children 585a8809fd9b
comparison
equal deleted inserted replaced
2927:8722c6284b72 2928:295f037b4b3e
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 #if defined (__GNUG__)
24 #pragma implementation
25 #endif
26
27 #ifdef HAVE_CONFIG_H
28 #include <config.h>
29 #endif
30
31 #include <iostream.h>
32
33 #include "mach-info.h"
34
35 #include "error.h"
36 #include "oct-stream.h"
37 #include "ops.h"
38 #include "ov.h"
39 #include "ov-file.h"
40 #include "ov-bool.h"
41 #include "ov-typeinfo.h"
42
43 // file by bool ops.
44
45 DEFBINOP (lshift, file, bool)
46 {
47 CAST_BINOP_ARGS (const octave_file&, const octave_bool&);
48
49 octave_stream *oct_stream = v1.stream_value ();
50
51 if (oct_stream)
52 {
53 ostream *osp = oct_stream->output_stream ();
54
55 if (osp)
56 {
57 ostream& os = *osp;
58
59 v2.print_raw (os);
60 }
61 else
62 error ("invalid file specified for binary operator `<<'");
63 }
64
65 return octave_value (oct_stream, v1.stream_number ());
66 }
67
68 void
69 install_fil_b_ops (void)
70 {
71 INSTALL_BINOP (lshift, octave_file, octave_bool, lshift);
72 }
73
74 /*
75 ;;; Local Variables: ***
76 ;;; mode: C++ ***
77 ;;; End: ***
78 */