Mercurial > octave
annotate libinterp/corefcn/load-save.h @ 19075:14bb81940528 stable
doc: Update docstring for datenum to describe format argument (bug #43181)
* datenum.m: Update docstring to describe the format argument exactly like
the docstring for datevec. Add test using format argument.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Wed, 10 Sep 2014 08:19:43 -0400 |
parents | 175b392e91fe |
children | 4197fc428c7d |
rev | line source |
---|---|
606 | 1 /* |
2 | |
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
16892
diff
changeset
|
3 Copyright (C) 1994-2013 John W. Eaton |
606 | 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. | |
606 | 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/>. | |
606 | 20 |
21 */ | |
22 | |
23 #if !defined (octave_load_save_h) | |
24 #define octave_load_save_h 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> |
3503 | 27 #include <string> |
1738 | 28 |
16555
04fb96f4bea1
allow double-click in file browser to load data files
John W. Eaton <jwe@octave.org>
parents:
15420
diff
changeset
|
29 #include "mach-info.h" |
04fb96f4bea1
allow double-click in file browser to load data files
John W. Eaton <jwe@octave.org>
parents:
15420
diff
changeset
|
30 #include "symtab.h" |
04fb96f4bea1
allow double-click in file browser to load data files
John W. Eaton <jwe@octave.org>
parents:
15420
diff
changeset
|
31 |
2086 | 32 class octave_value; |
606 | 33 |
8425
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
34 // 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
|
35 // 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
|
36 enum load_save_format_type |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17755
diff
changeset
|
37 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17755
diff
changeset
|
38 LS_ASCII, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17755
diff
changeset
|
39 LS_BINARY, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17755
diff
changeset
|
40 LS_MAT_ASCII, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17755
diff
changeset
|
41 LS_MAT_BINARY, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17755
diff
changeset
|
42 LS_MAT5_BINARY, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17755
diff
changeset
|
43 LS_MAT7_BINARY, |
4329 | 44 #ifdef HAVE_HDF5 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17755
diff
changeset
|
45 LS_HDF5, |
4329 | 46 #endif /* HAVE_HDF5 */ |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17755
diff
changeset
|
47 LS_UNKNOWN |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17755
diff
changeset
|
48 }; |
4329 | 49 |
8425
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
50 enum load_save_format_options |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
51 { |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
52 // LS_MAT_ASCII options (not exclusive) |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
53 LS_MAT_ASCII_LONG = 1, |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
54 LS_MAT_ASCII_TABS = 2, |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
55 // LS_MAT_BINARY options |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
56 LS_MAT_BINARY_V5 = 1, |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
57 LS_MAT_BINARY_V7, |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
58 // zero means no option. |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
59 LS_NO_OPTION = 0 |
8425
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
60 }; |
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 class load_save_format |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
63 { |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
64 public: |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
65 load_save_format (load_save_format_type t, |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
66 load_save_format_options o = LS_NO_OPTION) |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
67 : type (t), opts (o) { } |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
68 operator int (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17755
diff
changeset
|
69 { return type; } |
8425
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
70 int type, opts; |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
71 }; |
2e777f5135a3
support -tabs option for save -ascii
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
72 |
4791 | 73 extern void dump_octave_core (void); |
4329 | 74 |
75 extern int | |
76 read_binary_file_header (std::istream& is, bool& swap, | |
10313 | 77 oct_mach_info::float_format& flt_fmt, |
78 bool quiet = false); | |
606 | 79 |
4329 | 80 extern octave_value |
13273
58c4d02c8ba2
fix declaration of do_load in load-save.h
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
81 do_load (std::istream& stream, const std::string& orig_fname, |
10313 | 82 load_save_format format, oct_mach_info::float_format flt_fmt, |
83 bool list_only, bool swap, bool verbose, | |
84 const string_vector& argv, int argv_idx, int argc, int nargout); | |
4329 | 85 |
16625
a86a14e6e65e
Decorate symbols with OCTINTERP_API.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16555
diff
changeset
|
86 extern OCTINTERP_API bool is_octave_data_file (const std::string& file); |
16555
04fb96f4bea1
allow double-click in file browser to load data files
John W. Eaton <jwe@octave.org>
parents:
15420
diff
changeset
|
87 |
4329 | 88 extern void |
7336 | 89 do_save (std::ostream& os, const symbol_table::symbol_record& sr, |
10313 | 90 load_save_format fmt, bool save_as_floats); |
4329 | 91 |
92 extern void | |
93 write_header (std::ostream& os, load_save_format format); | |
1380 | 94 |
17755
9c03b071fd7b
avoid HDF5 error message at exit (bug #37713)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
95 extern void octave_prepare_hdf5 (void); |
9c03b071fd7b
avoid HDF5 error message at exit (bug #37713)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
96 |
9c03b071fd7b
avoid HDF5 error message at exit (bug #37713)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
97 extern void octave_finalize_hdf5 (void); |
9c03b071fd7b
avoid HDF5 error message at exit (bug #37713)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
98 |
606 | 99 #endif |