annotate src/load-save.h @ 8950:d865363208d6

include <iosfwd> instead of <iostream> in header files
author John W. Eaton <jwe@octave.org>
date Tue, 10 Mar 2009 13:55:52 -0400
parents eb63fbe60fab
children cd96d29c5efa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
606
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
1 /*
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
2
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
3 Copyright (C) 1994, 1995, 1996, 1997, 2000, 2003, 2004, 2005, 2006,
8920
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8425
diff changeset
4 2007, 2008 John W. Eaton
606
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
5
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
7
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6974
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6974
diff changeset
11 option) any later version.
606
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
12
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
16 for more details.
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
17
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6974
diff changeset
19 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6974
diff changeset
20 <http://www.gnu.org/licenses/>.
606
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
21
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
22 */
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
23
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
24 #if !defined (octave_load_save_h)
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
25 #define octave_load_save_h 1
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
26
8950
d865363208d6 include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
27 #include <iosfwd>
3503
d14c483b3c12 [project @ 2000-02-01 04:06:07 by jwe]
jwe
parents: 2907
diff changeset
28 #include <string>
1738
bb9d00aa55fb [project @ 1996-01-12 10:56:22 by jwe]
jwe
parents: 1380
diff changeset
29
2086
bfb775fb6fe8 [project @ 1996-04-25 05:55:19 by jwe]
jwe
parents: 1996
diff changeset
30 class octave_value;
606
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
31
8425
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
32 // FIXME: maybe MAT5 and MAT7 should be options to MAT_BINARY.
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
33 // Similarly, save_as_floats may be an option for LS_BINARY, LS_HDF5 etc.
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
34 enum load_save_format_type
4329
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
35 {
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
36 LS_ASCII,
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
37 LS_BINARY,
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
38 LS_MAT_ASCII,
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
39 LS_MAT_BINARY,
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
40 LS_MAT5_BINARY,
5269
a90ce2dc8b1e [project @ 2005-04-06 19:20:09 by dbateman]
dbateman
parents: 4791
diff changeset
41 LS_MAT7_BINARY,
4329
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
42 #ifdef HAVE_HDF5
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
43 LS_HDF5,
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
44 #endif /* HAVE_HDF5 */
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
45 LS_UNKNOWN
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
46 };
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
47
8425
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
48 enum load_save_format_options
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
49 {
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
50 // LS_MAT_ASCII options (not exclusive)
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
51 LS_MAT_ASCII_LONG = 1,
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
52 LS_MAT_ASCII_TABS = 2,
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
53 // LS_MAT_BINARY options
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
54 LS_MAT_BINARY_V5 = 1,
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
55 LS_MAT_BINARY_V7,
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
56 // zero means no option.
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
57 LS_NO_OPTION = 0
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
58 };
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
59
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
60 class load_save_format
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
61 {
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
62 public:
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
63 load_save_format (load_save_format_type t,
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
64 load_save_format_options o = LS_NO_OPTION)
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
65 : type (t), opts (o) { }
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
66 operator int (void) const
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
67 { return type; }
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
68 int type, opts;
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
69 };
2e777f5135a3 support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents: 7336
diff changeset
70
4791
62f2fb593455 [project @ 2004-02-20 18:02:59 by jwe]
jwe
parents: 4687
diff changeset
71 extern void dump_octave_core (void);
4329
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
72
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
73 extern int
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
74 read_binary_file_header (std::istream& is, bool& swap,
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
75 oct_mach_info::float_format& flt_fmt,
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
76 bool quiet = false);
606
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
77
4329
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
78 extern octave_value
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
79 do_load (std::istream& stream, const std::string& orig_fname, bool force,
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
80 load_save_format format, oct_mach_info::float_format flt_fmt,
4687
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4329
diff changeset
81 bool list_only, bool swap, bool verbose,
4329
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
82 const string_vector& argv, int argv_idx, int argc, int nargout);
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
83
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
84 extern void
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
85 do_save (std::ostream& os, const symbol_table::symbol_record& sr,
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
86 load_save_format fmt, bool save_as_floats);
4329
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
87
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
88 extern void
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 3738
diff changeset
89 write_header (std::ostream& os, load_save_format format);
1380
79f80c6229be [project @ 1995-09-12 07:03:33 by jwe]
jwe
parents: 1315
diff changeset
90
606
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
91 #endif
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
92
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
93 /*
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
94 ;;; Local Variables: ***
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
95 ;;; mode: C++ ***
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
96 ;;; End: ***
91ab3cfc2376 [project @ 1994-08-13 20:11:17 by jwe]
jwe
parents:
diff changeset
97 */