Mercurial > octave-nkf
annotate libinterp/corefcn/pr-output.h @ 20616:fd0efcdb3718
use new string_value method to handle value extraction errors
* dirfns.cc, file-io.cc, gammainc.cc, help.cc, load-path.cc,
octave-link.cc, qz.cc, regexp.cc, strfns.cc, syscalls.cc, time.cc,
variables.cc: Use new string_value method.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 08 Oct 2015 19:00:51 -0400 |
parents | 4197fc428c7d |
children |
rev | line source |
---|---|
1 | 1 /* |
2 | |
19731
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17866
diff
changeset
|
3 Copyright (C) 1993-2015 John W. Eaton |
1 | 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 | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
1 | 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 | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
1 | 20 |
21 */ | |
22 | |
383 | 23 #if !defined (octave_pr_output_h) |
24 #define octave_pr_output_h 1 | |
1 | 25 |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
26 #include <iosfwd> |
1 | 27 |
1651 | 28 #include "oct-cmplx.h" |
29 | |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
8950
diff
changeset
|
30 template <typename T> class Array; |
1738 | 31 class ComplexMatrix; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
32 class FloatComplexMatrix; |
8891
d077c590eb88
indicate diag & perm matrices on output
Jaroslav Hajek <highegg@gmail.com>
parents:
8625
diff
changeset
|
33 class ComplexDiagMatrix; |
d077c590eb88
indicate diag & perm matrices on output
Jaroslav Hajek <highegg@gmail.com>
parents:
8625
diff
changeset
|
34 class FloatComplexDiagMatrix; |
4513 | 35 class ComplexNDArray; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
36 class FloatComplexNDArray; |
1 | 37 class Matrix; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
38 class FloatMatrix; |
8891
d077c590eb88
indicate diag & perm matrices on output
Jaroslav Hajek <highegg@gmail.com>
parents:
8625
diff
changeset
|
39 class DiagMatrix; |
d077c590eb88
indicate diag & perm matrices on output
Jaroslav Hajek <highegg@gmail.com>
parents:
8625
diff
changeset
|
40 class FloatDiagMatrix; |
4513 | 41 class NDArray; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
42 class FloatNDArray; |
1738 | 43 class Range; |
3215 | 44 class boolMatrix; |
4513 | 45 class boolNDArray; |
1572 | 46 class charMatrix; |
4513 | 47 class charNDArray; |
8891
d077c590eb88
indicate diag & perm matrices on output
Jaroslav Hajek <highegg@gmail.com>
parents:
8625
diff
changeset
|
48 class PermMatrix; |
3928 | 49 class Cell; |
17866
ea0ecbe2eaf5
display matrix values in GUI workspace viewer (bug #40499)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
50 class octave_value; |
1 | 51 |
4901 | 52 #include "intNDArray.h" |
53 #include "oct-inttypes.h" | |
54 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
55 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
56 extern OCTINTERP_API void |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
57 octave_print_internal (std::ostream& os, bool d, |
10313 | 58 bool pr_as_read_syntax = false); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
59 |
6109 | 60 extern OCTINTERP_API void |
17866
ea0ecbe2eaf5
display matrix values in GUI workspace viewer (bug #40499)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
61 octave_print_internal (std::ostream& os, char c, |
ea0ecbe2eaf5
display matrix values in GUI workspace viewer (bug #40499)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
62 bool pr_as_read_syntax = false); |
ea0ecbe2eaf5
display matrix values in GUI workspace viewer (bug #40499)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
63 |
ea0ecbe2eaf5
display matrix values in GUI workspace viewer (bug #40499)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
64 extern OCTINTERP_API void |
3523 | 65 octave_print_internal (std::ostream& os, double d, |
10313 | 66 bool pr_as_read_syntax = false); |
625 | 67 |
6109 | 68 extern OCTINTERP_API void |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
69 octave_print_internal (std::ostream& os, float d, |
10313 | 70 bool pr_as_read_syntax = false); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
71 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
72 extern OCTINTERP_API void |
3523 | 73 octave_print_internal (std::ostream& os, const Matrix& m, |
10313 | 74 bool pr_as_read_syntax = false, |
75 int extra_indent = 0); | |
625 | 76 |
6109 | 77 extern OCTINTERP_API void |
8625
4d90d21a9cd9
special printing of diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
78 octave_print_internal (std::ostream& os, const DiagMatrix& m, |
10313 | 79 bool pr_as_read_syntax = false, |
80 int extra_indent = 0); | |
8625
4d90d21a9cd9
special printing of diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
81 |
4d90d21a9cd9
special printing of diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
82 extern OCTINTERP_API void |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
83 octave_print_internal (std::ostream& os, const FloatMatrix& m, |
10313 | 84 bool pr_as_read_syntax = false, |
85 int extra_indent = 0); | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
86 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
87 extern OCTINTERP_API void |
8625
4d90d21a9cd9
special printing of diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
88 octave_print_internal (std::ostream& os, const FloatDiagMatrix& m, |
10313 | 89 bool pr_as_read_syntax = false, |
90 int extra_indent = 0); | |
8625
4d90d21a9cd9
special printing of diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
91 |
4d90d21a9cd9
special printing of diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
92 extern OCTINTERP_API void |
4513 | 93 octave_print_internal (std::ostream& os, const NDArray& nda, |
10313 | 94 bool pr_as_read_syntax = false, |
95 int extra_indent = 0); | |
4513 | 96 |
6109 | 97 extern OCTINTERP_API void |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
98 octave_print_internal (std::ostream& os, const FloatNDArray& nda, |
10313 | 99 bool pr_as_read_syntax = false, |
100 int extra_indent = 0); | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
101 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
102 extern OCTINTERP_API void |
3523 | 103 octave_print_internal (std::ostream& os, const Complex& c, |
10313 | 104 bool pr_as_read_syntax = false); |
625 | 105 |
6109 | 106 extern OCTINTERP_API void |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
107 octave_print_internal (std::ostream& os, const FloatComplex& c, |
10313 | 108 bool pr_as_read_syntax = false); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
109 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
110 extern OCTINTERP_API void |
3523 | 111 octave_print_internal (std::ostream& os, const ComplexMatrix& cm, |
10313 | 112 bool pr_as_read_syntax = false, |
113 int extra_indent = 0); | |
625 | 114 |
6109 | 115 extern OCTINTERP_API void |
8625
4d90d21a9cd9
special printing of diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
116 octave_print_internal (std::ostream& os, const ComplexDiagMatrix& cm, |
10313 | 117 bool pr_as_read_syntax = false, |
118 int extra_indent = 0); | |
8625
4d90d21a9cd9
special printing of diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
119 |
4d90d21a9cd9
special printing of diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
120 extern OCTINTERP_API void |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
121 octave_print_internal (std::ostream& os, const FloatComplexMatrix& cm, |
10313 | 122 bool pr_as_read_syntax = false, |
123 int extra_indent = 0); | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
124 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
125 extern OCTINTERP_API void |
8625
4d90d21a9cd9
special printing of diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
126 octave_print_internal (std::ostream& os, const FloatComplexDiagMatrix& cm, |
10313 | 127 bool pr_as_read_syntax = false, |
128 int extra_indent = 0); | |
8625
4d90d21a9cd9
special printing of diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
129 |
4d90d21a9cd9
special printing of diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
130 extern OCTINTERP_API void |
4513 | 131 octave_print_internal (std::ostream& os, const ComplexNDArray& nda, |
10313 | 132 bool pr_as_read_syntax = false, |
133 int extra_indent = 0); | |
4513 | 134 |
6109 | 135 extern OCTINTERP_API void |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
136 octave_print_internal (std::ostream& os, const FloatComplexNDArray& nda, |
10313 | 137 bool pr_as_read_syntax = false, |
138 int extra_indent = 0); | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
139 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7215
diff
changeset
|
140 extern OCTINTERP_API void |
8891
d077c590eb88
indicate diag & perm matrices on output
Jaroslav Hajek <highegg@gmail.com>
parents:
8625
diff
changeset
|
141 octave_print_internal (std::ostream& os, const PermMatrix& m, |
10313 | 142 bool pr_as_read_syntax = false, |
143 int extra_indent = 0); | |
8891
d077c590eb88
indicate diag & perm matrices on output
Jaroslav Hajek <highegg@gmail.com>
parents:
8625
diff
changeset
|
144 |
d077c590eb88
indicate diag & perm matrices on output
Jaroslav Hajek <highegg@gmail.com>
parents:
8625
diff
changeset
|
145 extern OCTINTERP_API void |
3523 | 146 octave_print_internal (std::ostream& os, const Range& r, |
10313 | 147 bool pr_as_read_syntax = false, |
148 int extra_indent = 0); | |
1 | 149 |
6109 | 150 extern OCTINTERP_API void |
3523 | 151 octave_print_internal (std::ostream& os, const boolMatrix& m, |
10313 | 152 bool pr_as_read_syntax = false, |
153 int extra_indent = 0); | |
3215 | 154 |
6109 | 155 extern OCTINTERP_API void |
4513 | 156 octave_print_internal (std::ostream& os, const boolNDArray& m, |
10313 | 157 bool pr_as_read_syntax = false, |
158 int extra_indent = 0); | |
4513 | 159 |
6109 | 160 extern OCTINTERP_API void |
3523 | 161 octave_print_internal (std::ostream& os, const charMatrix& chm, |
10313 | 162 bool pr_as_read_syntax = false, |
163 int extra_indent = 0, | |
164 bool pr_as_string = false); | |
1355 | 165 |
6109 | 166 extern OCTINTERP_API void |
4655 | 167 octave_print_internal (std::ostream& os, const charNDArray& nda, |
10313 | 168 bool pr_as_read_syntax = false, |
169 int extra_indent = 0, | |
170 bool pr_as_string = false); | |
4513 | 171 |
6109 | 172 extern OCTINTERP_API void |
4925 | 173 octave_print_internal (std::ostream& os, const std::string& s, |
10313 | 174 bool pr_as_read_syntax = false, |
175 int extra_indent = 0); | |
4925 | 176 |
6109 | 177 extern OCTINTERP_API void |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
8950
diff
changeset
|
178 octave_print_internal (std::ostream& os, const Array<std::string>& sa, |
10313 | 179 bool pr_as_read_syntax = false, |
180 int extra_indent = 0); | |
4655 | 181 |
7215 | 182 extern OCTINTERP_API void |
183 octave_print_internal (std::ostream& os, const intNDArray<octave_int8>& sa, | |
10313 | 184 bool pr_as_read_syntax = false, |
185 int extra_indent = 0); | |
7215 | 186 |
187 extern OCTINTERP_API void | |
188 octave_print_internal (std::ostream& os, const intNDArray<octave_uint8>& sa, | |
10313 | 189 bool pr_as_read_syntax = false, |
190 int extra_indent = 0); | |
7215 | 191 |
192 extern OCTINTERP_API void | |
193 octave_print_internal (std::ostream& os, const intNDArray<octave_int16>& sa, | |
10313 | 194 bool pr_as_read_syntax = false, |
195 int extra_indent = 0); | |
7215 | 196 |
197 extern OCTINTERP_API void | |
198 octave_print_internal (std::ostream& os, const intNDArray<octave_uint16>& sa, | |
10313 | 199 bool pr_as_read_syntax = false, |
200 int extra_indent = 0); | |
7215 | 201 |
202 extern OCTINTERP_API void | |
203 octave_print_internal (std::ostream& os, const intNDArray<octave_int32>& sa, | |
10313 | 204 bool pr_as_read_syntax = false, |
205 int extra_indent = 0); | |
7215 | 206 |
207 extern OCTINTERP_API void | |
208 octave_print_internal (std::ostream& os, const intNDArray<octave_uint32>& sa, | |
10313 | 209 bool pr_as_read_syntax = false, |
210 int extra_indent = 0); | |
7215 | 211 |
212 extern OCTINTERP_API void | |
213 octave_print_internal (std::ostream& os, const intNDArray<octave_int64>& sa, | |
10313 | 214 bool pr_as_read_syntax = false, |
215 int extra_indent = 0); | |
4901 | 216 |
7215 | 217 extern OCTINTERP_API void |
218 octave_print_internal (std::ostream& os, const intNDArray<octave_uint64>& sa, | |
10313 | 219 bool pr_as_read_syntax = false, |
220 int extra_indent = 0); | |
7215 | 221 |
222 extern OCTINTERP_API void | |
223 octave_print_internal (std::ostream& os, const octave_int<int8_t>& sa, | |
10313 | 224 bool pr_as_read_syntax = false); |
7215 | 225 |
226 extern OCTINTERP_API void | |
227 octave_print_internal (std::ostream& os, const octave_int<uint8_t>& sa, | |
10313 | 228 bool pr_as_read_syntax = false); |
7215 | 229 |
230 extern OCTINTERP_API void | |
231 octave_print_internal (std::ostream& os, const octave_int<int16_t>& sa, | |
10313 | 232 bool pr_as_read_syntax = false); |
7215 | 233 |
234 extern OCTINTERP_API void | |
235 octave_print_internal (std::ostream& os, const octave_int<uint16_t>& sa, | |
10313 | 236 bool pr_as_read_syntax = false); |
7215 | 237 |
238 extern OCTINTERP_API void | |
239 octave_print_internal (std::ostream& os, const octave_int<int32_t>& sa, | |
10313 | 240 bool pr_as_read_syntax = false); |
7215 | 241 |
242 extern OCTINTERP_API void | |
243 octave_print_internal (std::ostream& os, const octave_int<uint32_t>& sa, | |
10313 | 244 bool pr_as_read_syntax = false); |
7215 | 245 |
246 extern OCTINTERP_API void | |
247 octave_print_internal (std::ostream& os, const octave_int<int64_t>& sa, | |
10313 | 248 bool pr_as_read_syntax = false); |
7215 | 249 |
250 extern OCTINTERP_API void | |
251 octave_print_internal (std::ostream& os, const octave_int<uint64_t>& sa, | |
10313 | 252 bool pr_as_read_syntax = false); |
4901 | 253 |
6109 | 254 extern OCTINTERP_API void |
3933 | 255 octave_print_internal (std::ostream& os, const Cell& cell, |
10313 | 256 bool pr_as_read_syntax = false, |
257 int extra_indent = 0, | |
258 bool pr_as_string = false); | |
3928 | 259 |
17866
ea0ecbe2eaf5
display matrix values in GUI workspace viewer (bug #40499)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
260 extern OCTINTERP_API void |
ea0ecbe2eaf5
display matrix values in GUI workspace viewer (bug #40499)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
261 octave_print_internal (std::ostream& os, const octave_value& ov, |
ea0ecbe2eaf5
display matrix values in GUI workspace viewer (bug #40499)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
262 bool pr_as_read_syntax = false); |
ea0ecbe2eaf5
display matrix values in GUI workspace viewer (bug #40499)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
263 |
5360 | 264 // TRUE means that the dimensions of empty objects should be printed |
265 // like this: x = [](2x0). | |
266 extern bool Vprint_empty_dimensions; | |
267 | |
13112
969ed305dde5
Remove all blank lines with "format compact"
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
11523
diff
changeset
|
268 // TRUE means don't put empty lines in output |
969ed305dde5
Remove all blank lines with "format compact"
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
11523
diff
changeset
|
269 extern bool Vcompact_format; |
969ed305dde5
Remove all blank lines with "format compact"
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
11523
diff
changeset
|
270 |
1 | 271 #endif |