Mercurial > octave
annotate libinterp/corefcn/oct-strstrm.h @ 22869:f75d289645ec
make deleted functions public
* octave-gui.h, resource-manager.h, shortcut-manager.h,
base-text-renderer.h, c-file-ptr-stream.h, dynamic-ld.cc,
dynamic-ld.h, event-queue.h, ft-text-renderer.cc, gl-render.cc,
gl-render.h, graphics.cc, graphics.in.h, interpreter.h, mex.cc,
mxarray.in.h, oct-fstrm.h, oct-iostrm.h, oct-prcstrm.h,
oct-procbuf.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h,
oct-strstrm.h, octave-link.h, pager.h, profiler.h, sighandlers.cc,
symtab.h, text-renderer.h, zfstream.h, __init_fltk__.cc,
ov-builtin.h, ov-dld-fcn.h, ov-fcn.h, ov-mex-fcn.h, ov-typeinfo.h,
ov-usr-fcn.h, octave.h, lex.h, parse.h, pt-arg-list.h,
pt-array-list.h, pt-assign.h, pt-binop.h, pt-bp.h, pt-cell.h,
pt-check.h, pt-classdef.h, pt-cmd.h, pt-colon.h, pt-const.h,
pt-decl.h, pt-eval.h, pt-except.h, pt-exp.h, pt-fcn-handle.h,
pt-funcall.h, pt-id.h, pt-idx.h, pt-jump.h, pt-loop.h, pt-mat.h,
pt-misc.h, pt-pr-code.h, pt-select.h, pt-stmt.h, pt-unop.h,
pt-walk.h, pt.h, token.h, Array.cc, idx-vector.h, oct-fftw.h,
sparse-chol.cc, sparse-qr.cc, file-ops.h, mach-info.h, oct-env.h,
action-container.h, cmd-edit.cc, cmd-edit.h, cmd-hist.h,
oct-locbuf.h, oct-mutex.h, oct-shlib.cc, oct-sort.h, pathsearch.h,
singleton-cleanup.h, unwind-prot.h, url-transfer.cc, url-transfer.h:
Declare deleted copy constructors and assignment operators public.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 06 Dec 2016 12:40:45 -0500 |
parents | 87e3163f6c87 |
children | b98ebcd7f11c |
rev | line source |
---|---|
2081 | 1 /* |
2 | |
22323
bac0d6f07a3e
maint: Update copyright notices for 2016.
John W. Eaton <jwe@octave.org>
parents:
21739
diff
changeset
|
3 Copyright (C) 1996-2016 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 | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
8 under the terms of the GNU General Public License as published by |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
9 the Free Software Foundation; either version 3 of the License, or |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
10 (at your option) any later version. |
2081 | 11 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
13 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
15 GNU General Public License for more details. |
2081 | 16 |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
2081 | 20 |
21 */ | |
22 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
23 #if ! defined (octave_oct_strstrm_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
24 #define octave_oct_strstrm_h 1 |
2081 | 25 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21017
diff
changeset
|
26 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21017
diff
changeset
|
27 |
2445 | 28 #include <string> |
5765 | 29 #include <sstream> |
4051 | 30 |
2081 | 31 #include "oct-stream.h" |
32 | |
33 class | |
34 octave_base_strstream : public octave_base_stream | |
35 { | |
36 public: | |
37 | |
4587 | 38 octave_base_strstream (std::ios::openmode m = std::ios::out, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
39 octave::mach_info::float_format ff |
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
40 = octave::mach_info::native_float_format ()) |
4587 | 41 : octave_base_stream (m, ff) { } |
2081 | 42 |
22869
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
43 // No copying! |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
44 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
45 octave_base_strstream (const octave_base_strstream&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
46 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
47 octave_base_strstream& operator = (const octave_base_strstream&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
48 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
49 protected: |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
50 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
51 ~octave_base_strstream (void) = default; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
52 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
53 public: |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
54 |
2081 | 55 // Position a stream at OFFSET relative to ORIGIN. |
56 | |
16011
8122286c69a9
initial large file support for 32-bit systems
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
57 int seek (off_t, int); |
2081 | 58 |
59 // Return current stream position. | |
60 | |
16011
8122286c69a9
initial large file support for 32-bit systems
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
61 virtual off_t tell (void); |
2081 | 62 |
63 // The name of the file. | |
64 | |
21017
93748bcaec17
maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
65 std::string name (void) const { return ""; } |
2081 | 66 |
3523 | 67 virtual std::streambuf *rdbuf (void) = 0; |
2081 | 68 |
69 virtual bool bad (void) const = 0; | |
70 | |
71 virtual void clear (void) = 0; | |
72 }; | |
73 | |
74 class | |
75 octave_istrstream : public octave_base_strstream | |
76 { | |
77 public: | |
78 | |
79 octave_istrstream (const char *data, | |
10313 | 80 std::ios::openmode arg_md = std::ios::out, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
81 octave::mach_info::float_format ff |
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
82 = octave::mach_info::native_float_format ()) |
4587 | 83 : octave_base_strstream (arg_md, ff), is (data) { } |
2081 | 84 |
3523 | 85 octave_istrstream (const std::string& data, |
10313 | 86 std::ios::openmode arg_md = std::ios::out, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
87 octave::mach_info::float_format ff |
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
88 = octave::mach_info::native_float_format ()) |
4587 | 89 : octave_base_strstream (arg_md, ff), is (data.c_str ()) { } |
2081 | 90 |
22869
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
91 // No copying! |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
92 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
93 octave_istrstream (const octave_istrstream&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
94 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
95 octave_istrstream& operator = (const octave_istrstream&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
96 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
97 protected: |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
98 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
99 ~octave_istrstream (void) = default; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
100 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
101 public: |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
102 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
103 |
3340 | 104 static octave_stream |
3538 | 105 create (const char *data, std::ios::openmode arg_md = std::ios::out, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
106 octave::mach_info::float_format ff |
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
107 = octave::mach_info::native_float_format ()); |
3340 | 108 |
109 static octave_stream | |
3538 | 110 create (const std::string& data, std::ios::openmode arg_md = std::ios::out, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
111 octave::mach_info::float_format ff |
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
112 = octave::mach_info::native_float_format ()); |
2081 | 113 |
18812
9ac2357f19bc
doc: Replace "non-zero" with "nonzero" to match existing usage.
Rik <rik@octave.org>
parents:
17822
diff
changeset
|
114 // Return nonzero if EOF has been reached on this stream. |
2081 | 115 |
116 bool eof (void) const { return is.eof (); } | |
117 | |
3523 | 118 std::istream *input_stream (void) { return &is; } |
2081 | 119 |
3523 | 120 std::ostream *output_stream (void) { return 0; } |
2081 | 121 |
16011
8122286c69a9
initial large file support for 32-bit systems
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
122 off_t tell (void) { return is.tellg (); } |
9795
3ccd3a03944c
Fix fourth argument from sscanf
David Grundberg <davidg@cs.umu.se>
parents:
7017
diff
changeset
|
123 |
3523 | 124 std::streambuf *rdbuf (void) { return is ? is.rdbuf () : 0; } |
2081 | 125 |
126 bool bad (void) const { return is.bad (); } | |
127 | |
128 void clear (void) { is.clear (); } | |
129 | |
130 private: | |
131 | |
5765 | 132 std::istringstream is; |
2081 | 133 }; |
134 | |
135 class | |
136 octave_ostrstream : public octave_base_strstream | |
137 { | |
138 public: | |
139 | |
3538 | 140 octave_ostrstream (std::ios::openmode arg_md = std::ios::out, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
141 octave::mach_info::float_format ff |
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
142 = octave::mach_info::native_float_format ()) |
11584
cda4aa780d58
Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11523
diff
changeset
|
143 : octave_base_strstream (arg_md, ff), os () { } |
2081 | 144 |
22869
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
145 // No copying! |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
146 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
147 octave_ostrstream (const octave_ostrstream&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
148 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
149 octave_ostrstream& operator = (const octave_ostrstream&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
150 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
151 protected: |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
152 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
153 ~octave_ostrstream (void) = default; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
154 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
155 public: |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
156 |
3340 | 157 static octave_stream |
3538 | 158 create (std::ios::openmode arg_md = std::ios::out, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
159 octave::mach_info::float_format ff |
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
160 = octave::mach_info::native_float_format ()); |
2081 | 161 |
18812
9ac2357f19bc
doc: Replace "non-zero" with "nonzero" to match existing usage.
Rik <rik@octave.org>
parents:
17822
diff
changeset
|
162 // Return nonzero if EOF has been reached on this stream. |
2081 | 163 |
164 bool eof (void) const { return os.eof (); } | |
165 | |
3523 | 166 std::istream *input_stream (void) { return 0; } |
2081 | 167 |
3523 | 168 std::ostream *output_stream (void) { return &os; } |
2081 | 169 |
5765 | 170 std::string str (void) { return os.str (); } |
2081 | 171 |
3523 | 172 std::streambuf *rdbuf (void) { return os ? os.rdbuf () : 0; } |
2081 | 173 |
174 bool bad (void) const { return os.bad (); } | |
175 | |
176 void clear (void) { os.clear (); } | |
177 | |
178 private: | |
179 | |
5765 | 180 std::ostringstream os; |
2081 | 181 }; |
182 | |
183 #endif | |
22407
34ce5be04942
maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
184 |