Mercurial > octave
annotate libinterp/corefcn/oct-prcstrm.h @ 31606:dfa5d9c3ae72
maint: merge stable to default
author | Rik <rik@octave.org> |
---|---|
date | Thu, 01 Dec 2022 14:28:07 -0800 |
parents | 2aa5bcaba504 e88a07dec498 |
children | 23664317f0d3 |
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 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29991
diff
changeset
|
3 // Copyright (C) 1996-2022 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 | 25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
26 #if ! defined (octave_oct_prcstrm_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
27 #define octave_oct_prcstrm_h 1 |
2081 | 28 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
29 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
30 |
2081 | 31 #include "oct-stdstrm.h" |
32 | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
33 // FIXME: why don't these classes use iprocstream and oprocstream, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
34 // which in turn use the octave_procbuf class? |
3652 | 35 |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
36 // Note: Even though these classes are now inside the octave namespace, |
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
37 // we can't rename them to iprocstream and oprocstream because we |
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
38 // already have classes with those names (see procstream.h). We need to |
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
39 // find a way to resolve this naming issue. |
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
40 |
31605
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
41 OCTAVE_BEGIN_NAMESPACE(octave) |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
42 |
2081 | 43 class |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
44 octave_iprocstream : public octave::stdiostream |
2081 | 45 { |
46 public: | |
47 | |
3523 | 48 octave_iprocstream (const std::string& n, |
10313 | 49 std::ios::openmode arg_md = std::ios::in, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
50 octave::mach_info::float_format flt_fmt |
26703
29ea2369971d
Add basic backend for encodings in file streams (bug #55452).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26376
diff
changeset
|
51 = octave::mach_info::native_float_format (), |
29ea2369971d
Add basic backend for encodings in file streams (bug #55452).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26376
diff
changeset
|
52 const std::string& encoding = "utf-8"); |
2081 | 53 |
22869
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
54 // No copying! |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
55 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
56 octave_iprocstream (const octave_iprocstream&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
57 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
58 octave_iprocstream& operator = (const octave_iprocstream&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
59 |
23059
b98ebcd7f11c
move some octave stream classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
60 static octave::stream |
3544 | 61 create (const std::string& n, std::ios::openmode arg_md = std::ios::in, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
62 octave::mach_info::float_format flt_fmt |
26703
29ea2369971d
Add basic backend for encodings in file streams (bug #55452).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26376
diff
changeset
|
63 = octave::mach_info::native_float_format (), |
29ea2369971d
Add basic backend for encodings in file streams (bug #55452).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26376
diff
changeset
|
64 const std::string& encoding = "utf-8"); |
3340 | 65 |
66 protected: | |
67 | |
2081 | 68 ~octave_iprocstream (void); |
69 }; | |
70 | |
71 class | |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
72 octave_oprocstream : public octave::stdiostream |
2081 | 73 { |
74 public: | |
75 | |
3523 | 76 octave_oprocstream (const std::string& n, |
10313 | 77 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
|
78 octave::mach_info::float_format flt_fmt |
26703
29ea2369971d
Add basic backend for encodings in file streams (bug #55452).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26376
diff
changeset
|
79 = octave::mach_info::native_float_format (), |
29ea2369971d
Add basic backend for encodings in file streams (bug #55452).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26376
diff
changeset
|
80 const std::string& encoding = "utf-8"); |
2081 | 81 |
22869
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
82 // No copying! |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
83 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
84 octave_oprocstream (const octave_oprocstream&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
85 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
86 octave_oprocstream& operator = (const octave_oprocstream&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
87 |
23059
b98ebcd7f11c
move some octave stream classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
88 static octave::stream |
3544 | 89 create (const std::string& n, 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
|
90 octave::mach_info::float_format flt_fmt |
26703
29ea2369971d
Add basic backend for encodings in file streams (bug #55452).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26376
diff
changeset
|
91 = octave::mach_info::native_float_format (), |
29ea2369971d
Add basic backend for encodings in file streams (bug #55452).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26376
diff
changeset
|
92 const std::string& encoding = "utf-8"); |
3340 | 93 |
94 protected: | |
95 | |
2081 | 96 ~octave_oprocstream (void); |
97 }; | |
98 | |
31605
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
99 OCTAVE_END_NAMESPACE(octave) |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
100 |
2081 | 101 #endif |