GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
load-save.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1994-2018 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
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License 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 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_load_save_h)
24 #define octave_load_save_h 1
25 
26 #include "octave-config.h"
27 
28 #include <iosfwd>
29 #include <string>
30 
31 #include "mach-info.h"
32 
33 namespace octave
34 {
35  class symbol_record;
36 }
37 
38 class string_vector;
39 class octave_value;
40 
41 // FIXME: maybe MAT5 and MAT7 should be options to MAT_BINARY.
42 // Similarly, save_as_floats may be an option for LS_BINARY, LS_HDF5 etc.
44 {
53 };
54 
56 {
57  // LS_MAT_ASCII options (not exclusive)
60  // LS_MAT_BINARY options
63  // zero means no option.
65 };
66 
68 {
69 public:
72  : type (t), opts (o) { }
73  operator int (void) const
74  { return type; }
75  int type, opts;
76 };
77 
78 extern void dump_octave_core (void);
79 
80 extern int
81 read_binary_file_header (std::istream& is, bool& swap,
83  bool quiet = false);
84 
85 extern octave_value
86 do_load (std::istream& stream, const std::string& orig_fname,
88  bool list_only, bool swap, bool verbose,
89  const string_vector& argv, int argv_idx, int argc, int nargout);
90 
91 extern OCTINTERP_API bool is_octave_data_file (const std::string& file);
92 
93 extern void
94 do_save (std::ostream& os, const octave::symbol_record& sr,
96 
97 extern void
98 write_header (std::ostream& os, load_save_format format);
99 
100 extern void octave_prepare_hdf5 (void);
101 
102 extern void octave_finalize_hdf5 (void);
103 
104 #endif
For example cd octave end example noindent changes the current working directory to file
Definition: dirfns.cc:124
OCTINTERP_API bool is_octave_data_file(const std::string &file)
Definition: load-save.cc:539
int argc
Definition: load-save.cc:646
load_save_format_options
Definition: load-save.h:55
std::string orig_fname
Definition: load-save.cc:651
octave::mach_info::float_format flt_fmt
Definition: load-save.cc:736
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
Definition: ov-usr-fcn.cc:997
bool list_only
Definition: load-save.cc:666
void dump_octave_core(void)
Definition: load-save.cc:1380
string_vector argv
Definition: load-save.cc:648
octave_value do_load(std::istream &stream, const std::string &orig_fname, load_save_format format, octave::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:357
int read_binary_file_header(std::istream &is, bool &swap, octave::mach_info::float_format &flt_fmt, bool quiet=false)
Definition: load-save.cc:188
bool swap
Definition: load-save.cc:738
bool verbose
Definition: load-save.cc:667
load_save_format(load_save_format_type t, load_save_format_options o=LS_NO_OPTION)
Definition: load-save.h:70
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
Definition: ov-usr-fcn.cc:997
void octave_prepare_hdf5(void)
Definition: load-save.cc:1255
void octave_finalize_hdf5(void)
Definition: load-save.cc:1263
bool save_as_floats
Definition: load-save.cc:1617
void do_save(std::ostream &os, const octave::symbol_record &sr, load_save_format fmt, bool save_as_floats)
LS_TEXT format
Definition: load-save.cc:1616
void write_header(std::ostream &os, load_save_format format)
Definition: load-save.cc:1173
load_save_format_type
Definition: load-save.h:43
write the output to stdout if nargout is
Definition: load-save.cc:1612
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888
octave::stream os
Definition: file-io.cc:627