GNU Octave
4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
libinterp
corefcn
load-save.h
Go to the documentation of this file.
1
/*
2
3
Copyright (C) 1994-2015 John W. Eaton
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
9
Free Software Foundation; either version 3 of the License, or (at your
10
option) any later version.
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
18
along with Octave; see the file COPYING. If not, see
19
<http://www.gnu.org/licenses/>.
20
21
*/
22
23
#if !defined (octave_load_save_h)
24
#define octave_load_save_h 1
25
26
#include <iosfwd>
27
#include <string>
28
29
#include "
mach-info.h
"
30
#include "
symtab.h
"
31
32
class
octave_value
;
33
34
// FIXME: maybe MAT5 and MAT7 should be options to MAT_BINARY.
35
// Similarly, save_as_floats may be an option for LS_BINARY, LS_HDF5 etc.
36
enum
load_save_format_type
37
{
38
LS_ASCII
,
39
LS_BINARY
,
40
LS_MAT_ASCII
,
41
LS_MAT_BINARY
,
42
LS_MAT5_BINARY
,
43
LS_MAT7_BINARY
,
44
LS_HDF5
,
45
LS_UNKNOWN
46
};
47
48
enum
load_save_format_options
49
{
50
// LS_MAT_ASCII options (not exclusive)
51
LS_MAT_ASCII_LONG
= 1,
52
LS_MAT_ASCII_TABS
= 2,
53
// LS_MAT_BINARY options
54
LS_MAT_BINARY_V5
= 1,
55
LS_MAT_BINARY_V7
,
56
// zero means no option.
57
LS_NO_OPTION
= 0
58
};
59
60
class
load_save_format
61
{
62
public
:
63
load_save_format
(
load_save_format_type
t,
64
load_save_format_options
o =
LS_NO_OPTION
)
65
:
type
(t),
opts
(o) { }
66
operator
int
(
void
)
const
67
{
return
type
; }
68
int
type
,
opts
;
69
};
70
71
extern
void
dump_octave_core
(
void
);
72
73
extern
int
74
read_binary_file_header
(std::istream& is,
bool
& swap,
75
oct_mach_info::float_format
& flt_fmt,
76
bool
quiet =
false
);
77
78
extern
octave_value
79
do_load
(std::istream& stream,
const
std::string& orig_fname,
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);
83
84
extern
OCTINTERP_API
bool
is_octave_data_file
(
const
std::string& file);
85
86
extern
void
87
do_save
(std::ostream& os,
const
symbol_table::symbol_record
& sr,
88
load_save_format
fmt,
bool
save_as_floats);
89
90
extern
void
91
write_header
(std::ostream& os,
load_save_format
format);
92
93
extern
void
octave_prepare_hdf5
(
void
);
94
95
extern
void
octave_finalize_hdf5
(
void
);
96
97
#endif
LS_MAT7_BINARY
Definition:
load-save.h:43
octave_value
Definition:
ov.h:68
is_octave_data_file
OCTINTERP_API bool is_octave_data_file(const std::string &file)
Definition:
load-save.cc:533
load_save_format
Definition:
load-save.h:60
LS_MAT_BINARY
Definition:
load-save.h:41
load_save_format_options
load_save_format_options
Definition:
load-save.h:48
oct_mach_info::float_format
float_format
Definition:
mach-info.h:38
symtab.h
dump_octave_core
void dump_octave_core(void)
Definition:
load-save.cc:1392
LS_MAT5_BINARY
Definition:
load-save.h:42
do_save
void do_save(std::ostream &os, const symbol_table::symbol_record &sr, load_save_format fmt, bool save_as_floats)
Definition:
load-save.cc:979
load_save_format::load_save_format
load_save_format(load_save_format_type t, load_save_format_options o=LS_NO_OPTION)
Definition:
load-save.h:63
read_binary_file_header
int read_binary_file_header(std::istream &is, bool &swap, oct_mach_info::float_format &flt_fmt, bool quiet=false)
Definition:
load-save.cc:175
OCTINTERP_API
#define OCTINTERP_API
Definition:
mexproto.h:66
octave_prepare_hdf5
void octave_prepare_hdf5(void)
Definition:
load-save.cc:1265
octave_finalize_hdf5
void octave_finalize_hdf5(void)
Definition:
load-save.cc:1273
LS_MAT_BINARY_V7
Definition:
load-save.h:55
mach-info.h
LS_MAT_ASCII_TABS
Definition:
load-save.h:52
load_save_format::opts
int opts
Definition:
load-save.h:68
load_save_format::type
int type
Definition:
load-save.h:68
LS_BINARY
Definition:
load-save.h:39
LS_MAT_ASCII
Definition:
load-save.h:40
LS_ASCII
Definition:
load-save.h:38
write_header
void write_header(std::ostream &os, load_save_format format)
Definition:
load-save.cc:1183
do_load
octave_value do_load(std::istream &stream, const std::string &orig_fname, load_save_format format, oct_mach_info::float_format flt_fmt, bool list_only, bool swap, bool verbose, const string_vector &argv, int argv_idx, int argc, int nargout)
Definition:
load-save.cc:341
LS_HDF5
Definition:
load-save.h:44
LS_UNKNOWN
Definition:
load-save.h:45
LS_NO_OPTION
Definition:
load-save.h:57
LS_MAT_BINARY_V5
Definition:
load-save.h:54
load_save_format_type
load_save_format_type
Definition:
load-save.h:36
int
symbol_table::symbol_record
Definition:
symtab.h:173
string_vector
Definition:
str-vec.h:33
LS_MAT_ASCII_LONG
Definition:
load-save.h:51
Generated on Thu Jun 4 2015 23:30:14 for GNU Octave by
1.8.8