Mercurial > hg > octave-nkf
annotate src/load-save.h @ 10824:1e6664326d32
rsf2csf: Change first documentation line to active voice.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Tue, 27 Jul 2010 10:46:11 -0700 |
parents | f3b65e1ae355 |
children | fd0a3ac60b0e |
rev | line source |
---|---|
606 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1994, 1995, 1996, 1997, 2000, 2003, 2004, 2005, 2006, |
8920 | 4 2007, 2008 John W. Eaton |
606 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
606 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
606 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_load_save_h) | |
25 #define octave_load_save_h 1 | |
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 | 28 #include <string> |
1738 | 29 |
2086 | 30 class octave_value; |
606 | 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 | 35 { |
36 LS_ASCII, | |
37 LS_BINARY, | |
38 LS_MAT_ASCII, | |
39 LS_MAT_BINARY, | |
40 LS_MAT5_BINARY, | |
5269 | 41 LS_MAT7_BINARY, |
4329 | 42 #ifdef HAVE_HDF5 |
43 LS_HDF5, | |
44 #endif /* HAVE_HDF5 */ | |
45 LS_UNKNOWN | |
46 }; | |
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 | 71 extern void dump_octave_core (void); |
4329 | 72 |
73 extern int | |
74 read_binary_file_header (std::istream& is, bool& swap, | |
10313 | 75 oct_mach_info::float_format& flt_fmt, |
76 bool quiet = false); | |
606 | 77 |
4329 | 78 extern octave_value |
79 do_load (std::istream& stream, const std::string& orig_fname, bool force, | |
10313 | 80 load_save_format format, oct_mach_info::float_format flt_fmt, |
81 bool list_only, bool swap, bool verbose, | |
82 const string_vector& argv, int argv_idx, int argc, int nargout); | |
4329 | 83 |
84 extern void | |
7336 | 85 do_save (std::ostream& os, const symbol_table::symbol_record& sr, |
10313 | 86 load_save_format fmt, bool save_as_floats); |
4329 | 87 |
88 extern void | |
89 write_header (std::ostream& os, load_save_format format); | |
1380 | 90 |
606 | 91 #endif |