annotate libinterp/corefcn/oct-strstrm.h @ 31855:1daf8bfceac3

default or disable more ctors, dtors, and assignment ops In most classes in liboctave and libinterp (except for the files in octave-value subdirectory) that had at least one of the following functions defined default constructor copy constructor copy assignment operator destructor declare all of them. In most cases, this means declaring default or deleted functions. In some cases, explicit definitions have been replaced by equivalent default functions. In some cases, default or deleted move constructors and move assignment operators have also been declared. Files affected: __magick_read__.cc, c-file-ptr-stream.h, dynamic-ld.h, environment.h, error.h, event-manager.h, fcn-info.h, genprops.awk, gl-render.cc, gl-render.h, gl2ps-print.cc, graphics-toolkit.h, graphics.cc, graphics.in.h, gtk-manager.h, hook-fcn.h, input.h, interpreter.cc, latex-text-renderer.cc, load-path.h, load-save.h, ls-hdf5.h, mex.cc, mxarray.h, oct-errno.h, oct-fstrm.h, oct-hist.h, oct-iostrm.h, oct-map.h, oct-prcstrm.h, oct-process.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h, oct-strstrm.h, pager.h, procstream.h, symrec.h, symtab.h, text-engine.h, text-renderer.h, utils.h, __init_fltk__.cc, __init_gnuplot__.cc, __ode15__.cc, audiodevinfo.cc, octave.h, anon-fcn-validator.h, bp-table.h, comment-list.h, lex.h, oct-lvalue.h, oct-parse.yy, parse.h, profiler.h, pt-args-block.h, pt-binop.h, pt-bp.h, pt-cbinop.h, pt-classdef.h, pt-cmd.h, pt-decl.h, pt-eval.h, pt-id.h, pt-misc.h, pt-spmd.h, token.h, Array-base.cc, CColVector.h, CNDArray.h, CRowVector.h, CSparse.h, Range.h, boolNDArray.h, boolSparse.h, chNDArray.h, dColVector.h, dNDArray.h, dRowVector.h, dSparse.h, fCColVector.h, fCNDArray.h, fCRowVector.h, fColVector.h, fNDArray.h, fRowVector.h, idx-vector.h, DASPK.h, DASRT.h, DASSL.h, DET.h, LSODE.h, Quad.h, chol.h, oct-fftw.h, oct-norm.cc, oct-rand.h, sparse-qr.cc, svd.cc, child-list.h, file-stat.h, oct-env.h, oct-group.h, oct-time.h, action-container.h, cmd-edit.cc, cmd-hist.cc, kpse.h, lo-array-errwarn.h, lo-regexp.h, oct-mutex.cc, oct-mutex.h, oct-refcount.h, oct-shlib.cc, oct-shlib.h, oct-string.h, octave-preserve-stream-state.h, quit.h, unwind-prot.h, and octave-svgconvert.cc.
author John W. Eaton <jwe@octave.org>
date Fri, 17 Feb 2023 23:27:46 -0500
parents febd82d1a8de
children ae4e19c0a2b1 2e484f9f1f18
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
31706
597f3ee61a48 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 31607
diff changeset
3 // Copyright (C) 1996-2023 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
25
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19697
diff changeset
26 #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
27 #define octave_oct_strstrm_h 1
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
28
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21017
diff changeset
29 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21017
diff changeset
30
2445
6577af9f7504 [project @ 1996-10-30 19:01:57 by jwe]
jwe
parents: 2317
diff changeset
31 #include <string>
5765
7ba9ad1fec11 [project @ 2006-04-17 05:05:15 by jwe]
jwe
parents: 5307
diff changeset
32 #include <sstream>
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
33
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
34 #include "oct-stream.h"
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
35
31605
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 30564
diff changeset
36 OCTAVE_BEGIN_NAMESPACE(octave)
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
37
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
38 class
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
39 base_strstream : public base_stream
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
40 {
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
41 public:
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
42
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
43 base_strstream (std::ios::openmode m = std::ios::out,
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
44 mach_info::float_format ff
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
45 = mach_info::native_float_format (),
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
46 const std::string& encoding = "utf-8")
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
47 : base_stream (m, ff, encoding) { }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
48
31837
febd82d1a8de use new macros to consistently delete copy and move member functions
John W. Eaton <jwe@octave.org>
parents: 31771
diff changeset
49 OCTAVE_DISABLE_COPY_MOVE (base_strstream)
22869
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 protected:
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
52
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
53 ~base_strstream () = default;
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
54
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
55 public:
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
56
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
57 // Position a stream at OFFSET relative to ORIGIN.
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
58
16011
8122286c69a9 initial large file support for 32-bit systems
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
59 int seek (off_t, int);
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
60
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
61 // Return current stream position.
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
62
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
63 virtual off_t tell ();
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
64
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
65 // The name of the file.
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
66
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
67 std::string name () const { return ""; }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
68
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
69 virtual std::streambuf * rdbuf () = 0;
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
70
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
71 virtual bool bad () const = 0;
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
72
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
73 virtual void clear () = 0;
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
74 };
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
75
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
76 class
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
77 istrstream : public base_strstream
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
78 {
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
79 public:
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
80
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
81 istrstream (const char *data,
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
82 std::ios::openmode arg_md = std::ios::out,
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
83 mach_info::float_format ff = mach_info::native_float_format (),
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
84 const std::string& encoding = "utf-8")
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
85 : base_strstream (arg_md, ff, encoding), m_istream (data) { }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
86
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
87 istrstream (const std::string& data,
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
88 std::ios::openmode arg_md = std::ios::out,
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
89 mach_info::float_format ff = mach_info::native_float_format (),
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
90 const std::string& encoding = "utf-8")
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
91 : base_strstream (arg_md, ff, encoding), m_istream (data) { }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
92
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
93 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (istrstream)
22869
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 protected:
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
96
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
97 ~istrstream () = default;
22869
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 public:
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
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
102 static stream
3538
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3523
diff changeset
103 create (const char *data, std::ios::openmode arg_md = std::ios::out,
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
104 mach_info::float_format ff = mach_info::native_float_format (),
26703
29ea2369971d Add basic backend for encodings in file streams (bug #55452).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26376
diff changeset
105 const std::string& encoding = "utf-8");
3340
585a8809fd9b [project @ 1999-11-05 07:02:30 by jwe]
jwe
parents: 2847
diff changeset
106
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
107 static stream
3538
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3523
diff changeset
108 create (const std::string& data, std::ios::openmode arg_md = std::ios::out,
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
109 mach_info::float_format ff = mach_info::native_float_format (),
26703
29ea2369971d Add basic backend for encodings in file streams (bug #55452).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26376
diff changeset
110 const std::string& encoding = "utf-8");
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
111
18812
9ac2357f19bc doc: Replace "non-zero" with "nonzero" to match existing usage.
Rik <rik@octave.org>
parents: 17822
diff changeset
112 // Return nonzero if EOF has been reached on this stream.
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
113
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
114 bool eof () const { return m_istream.eof (); }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
115
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
116 std::istream * input_stream () { return &m_istream; }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
117
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
118 std::ostream * output_stream () { return nullptr; }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
119
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
120 off_t tell () { return m_istream.tellg (); }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
121
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
122 std::streambuf * rdbuf ()
27172
b0abae0bd94b style fixes
John W. Eaton <jwe@octave.org>
parents: 26703
diff changeset
123 {
b0abae0bd94b style fixes
John W. Eaton <jwe@octave.org>
parents: 26703
diff changeset
124 return m_istream ? m_istream.rdbuf () : nullptr;
b0abae0bd94b style fixes
John W. Eaton <jwe@octave.org>
parents: 26703
diff changeset
125 }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
126
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
127 bool bad () const { return m_istream.bad (); }
27172
b0abae0bd94b style fixes
John W. Eaton <jwe@octave.org>
parents: 26703
diff changeset
128
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
129 void clear () { m_istream.clear (); }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
130
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
131 private:
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
132
27172
b0abae0bd94b style fixes
John W. Eaton <jwe@octave.org>
parents: 26703
diff changeset
133 std::istringstream m_istream;
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
134 };
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
135
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
136 class
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
137 ostrstream : public base_strstream
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
138 {
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
139 public:
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
140
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
141 ostrstream (std::ios::openmode arg_md = std::ios::out,
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
142 mach_info::float_format ff = mach_info::native_float_format (),
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
143 const std::string& encoding = "utf-8")
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
144 : base_strstream (arg_md, ff, encoding), m_ostream () { }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
145
31837
febd82d1a8de use new macros to consistently delete copy and move member functions
John W. Eaton <jwe@octave.org>
parents: 31771
diff changeset
146 OCTAVE_DISABLE_COPY_MOVE (ostrstream)
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
147
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
148 protected:
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
149
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
150 ~ostrstream () = default;
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
151
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
152 public:
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
153
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
154 static stream
3538
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3523
diff changeset
155 create (std::ios::openmode arg_md = std::ios::out,
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
156 mach_info::float_format ff = mach_info::native_float_format (),
26703
29ea2369971d Add basic backend for encodings in file streams (bug #55452).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26376
diff changeset
157 const std::string& encoding = "utf-8");
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
158
18812
9ac2357f19bc doc: Replace "non-zero" with "nonzero" to match existing usage.
Rik <rik@octave.org>
parents: 17822
diff changeset
159 // Return nonzero if EOF has been reached on this stream.
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
160
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
161 bool eof () const { return m_ostream.eof (); }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
162
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
163 std::istream * input_stream () { return nullptr; }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
164
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
165 std::ostream * output_stream () { return &m_ostream; }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
166
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
167 std::string str () { return m_ostream.str (); }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
168
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
169 std::streambuf * rdbuf ()
27172
b0abae0bd94b style fixes
John W. Eaton <jwe@octave.org>
parents: 26703
diff changeset
170 {
b0abae0bd94b style fixes
John W. Eaton <jwe@octave.org>
parents: 26703
diff changeset
171 return m_ostream ? m_ostream.rdbuf () : nullptr;
b0abae0bd94b style fixes
John W. Eaton <jwe@octave.org>
parents: 26703
diff changeset
172 }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
173
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
174 bool bad () const { return m_ostream.bad (); }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
175
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
176 void clear () { m_ostream.clear (); }
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
177
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
178 private:
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
179
27172
b0abae0bd94b style fixes
John W. Eaton <jwe@octave.org>
parents: 26703
diff changeset
180 std::ostringstream m_ostream;
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
181 };
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
182
31605
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 30564
diff changeset
183 OCTAVE_END_NAMESPACE(octave)
29991
3988112c7116 move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
184
2081
e9ec222a53e1 [project @ 1996-04-25 03:17:36 by jwe]
jwe
parents:
diff changeset
185 #endif