#include "load-save.h"
Public Types | |
enum | format_options { MAT_ASCII_LONG = 1 , MAT_ASCII_TABS = 2 , MAT_BINARY_V5 = 1 , MAT_BINARY_V7 , NO_OPTION = 0 } |
enum | format_type { TEXT , BINARY , MAT_ASCII , MAT_BINARY , MAT5_BINARY , MAT7_BINARY , HDF5 , UNKNOWN } |
Public Member Functions | |
load_save_system (const load_save_system &)=delete | |
OCTINTERP_API | load_save_system (interpreter &interp) |
OCTINTERP_API | ~load_save_system (void) |
bool | crash_dumps_octave_core (bool flag) |
OCTINTERP_API octave_value | crash_dumps_octave_core (const octave_value_list &args, int nargout) |
bool | crash_dumps_octave_core (void) const |
OCTINTERP_API void | dump_octave_core (void) |
OCTINTERP_API octave_value_list | load (const octave_value_list &args=octave_value_list(), int nargout=0) |
OCTINTERP_API octave_value | load_vars (std::istream &stream, const std::string &orig_fname, const load_save_format &fmt, mach_info::float_format flt_fmt, bool list_only, bool swap, bool verbose, const string_vector &argv, int argv_idx, int argc, int nargout) |
octave_value | octave_core_file_limit (const octave_value_list &args, int nargout) |
double | octave_core_file_limit (double limit) |
double | octave_core_file_limit (void) const |
OCTINTERP_API octave_value | octave_core_file_name (const octave_value_list &args, int nargout) |
std::string | octave_core_file_name (const std::string &file) |
std::string | octave_core_file_name (void) const |
OCTINTERP_API octave_value | octave_core_file_options (const octave_value_list &args, int nargout) |
std::string | octave_core_file_options (const std::string &options) |
std::string | octave_core_file_options (void) const |
load_save_system & | operator= (const load_save_system &)=delete |
OCTINTERP_API octave_value_list | save (const octave_value_list &args=octave_value_list(), int nargout=0) |
OCTINTERP_API octave_value | save_default_options (const octave_value_list &args, int nargout) |
std::string | save_default_options (const std::string &options) |
std::string | save_default_options (void) const |
OCTINTERP_API octave_value | save_header_format_string (const octave_value_list &args, int nargout) |
std::string | save_header_format_string (const std::string &format) |
std::string | save_header_format_string (void) const |
OCTINTERP_API void | save_vars (const string_vector &argv, int argv_idx, int argc, std::ostream &os, const load_save_format &fmt, bool save_as_floats, bool write_header_info) |
Static Public Member Functions | |
static OCTINTERP_API load_save_format | get_file_format (const std::string &fname, const std::string &orig_fname, bool &use_zlib, bool quiet=false) |
static OCTINTERP_API string_vector | parse_save_options (const std::string &arg, load_save_format &fmt, bool &append, bool &save_as_floats, bool &use_zlib) |
static OCTINTERP_API string_vector | parse_save_options (const string_vector &argv, load_save_format &fmt, bool &append, bool &save_as_floats, bool &use_zlib) |
Private Member Functions | |
OCTINTERP_API void | do_save (std::ostream &os, const octave_value &tc, const std::string &name, const std::string &help, bool global, const load_save_format &fmt, bool save_as_floats) |
OCTINTERP_API void | do_save (std::ostream &os, const symbol_info &syminfo, const load_save_format &fmt, bool save_as_floats) |
OCTINTERP_API void | dump_octave_core (std::ostream &os, const char *fname, const load_save_format &fmt, bool save_as_floats) |
OCTINTERP_API void | install_loaded_variable (const std::string &name, const octave_value &val, bool global, const std::string &) |
OCTINTERP_API std::size_t | save_fields (std::ostream &os, const octave_scalar_map &m, const std::string &pattern, const load_save_format &fmt, bool save_as_floats) |
OCTINTERP_API std::size_t | save_vars (std::ostream &os, const std::string &pattern, const load_save_format &fmt, bool save_as_floats) |
template<typename T > | |
T | set (T &var, const T &new_val) |
OCTINTERP_API void | write_header (std::ostream &os, const load_save_format &fmt) |
Static Private Member Functions | |
static OCTINTERP_API load_save_format | get_file_format (std::istream &file, const std::string &filename) |
static OCTINTERP_API std::string | init_save_header_format (void) |
Private Attributes | |
bool | m_crash_dumps_octave_core |
interpreter & | m_interpreter |
double | m_octave_core_file_limit |
std::string | m_octave_core_file_name |
std::string | m_octave_core_file_options |
std::string | m_save_default_options |
std::string | m_save_header_format_string |
Definition at line 44 of file load-save.h.
Enumerator | |
---|---|
MAT_ASCII_LONG | |
MAT_ASCII_TABS | |
MAT_BINARY_V5 | |
MAT_BINARY_V7 | |
NO_OPTION |
Definition at line 64 of file load-save.h.
Enumerator | |
---|---|
TEXT | |
BINARY | |
MAT_ASCII | |
MAT_BINARY | |
MAT5_BINARY | |
MAT7_BINARY | |
HDF5 | |
UNKNOWN |
Definition at line 52 of file load-save.h.
load_save_system::load_save_system | ( | interpreter & | interp | ) |
Definition at line 257 of file load-save.cc.
load_save_system::~load_save_system | ( | void | ) |
Definition at line 271 of file load-save.cc.
|
delete |
|
inline |
Definition at line 92 of file load-save.h.
References m_crash_dumps_octave_core, and set().
octave_value load_save_system::crash_dumps_octave_core | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 279 of file load-save.cc.
References m_crash_dumps_octave_core, and set_internal_variable().
Referenced by Fcrash_dumps_octave_core(), and interpreter::maximum_braindamage().
|
inline |
Definition at line 87 of file load-save.h.
References m_crash_dumps_octave_core.
|
private |
Definition at line 934 of file load-save.cc.
References BINARY, err_unrecognized_data_fmt(), HDF5, MAT5_BINARY, MAT7_BINARY, MAT_ASCII, MAT_ASCII_LONG, MAT_ASCII_TABS, MAT_BINARY, load_save_format::options(), save_binary_data(), save_hdf5_data(), save_mat5_binary_element(), save_mat_ascii_data(), save_mat_binary_data(), save_text_data(), TEXT, load_save_format::type(), and warning().
Referenced by do_save(), dump_octave_core(), save_fields(), and save_vars().
|
private |
Definition at line 983 of file load-save.cc.
References do_save(), octave_value::is_defined(), symbol_info::is_global(), symbol_info::name(), and symbol_info::value().
|
private |
Definition at line 1029 of file load-save.cc.
References octave_value::byte_size(), do_save(), interpreter::get_evaluator(), m_interpreter, m_octave_core_file_limit, message(), tree_evaluator::top_scope_symbol_info(), and write_header().
void load_save_system::dump_octave_core | ( | void | ) |
Definition at line 735 of file load-save.cc.
References BINARY, gzofstream::close(), hdf5_fstreambase::close(), hdf5_fstreambase::file_id, HDF5, m_crash_dumps_octave_core, m_octave_core_file_name, m_octave_core_file_options, MAT5_BINARY, MAT7_BINARY, MAT_BINARY, message(), ofstream(), parse_save_options(), trunc(), load_save_format::type(), and warning().
Referenced by my_friendly_exit().
|
static |
Definition at line 327 of file load-save.cc.
References check_gzip_magic(), gzifstream::close(), err_file_open(), get_ASCII_filename(), HDF5, ifstream(), and UNKNOWN.
Referenced by load().
|
staticprivate |
Definition at line 1089 of file load-save.cc.
References BINARY, extract_keyword(), flt_fmt_unknown, imag(), len, looks_like_mat_ascii_file(), MAT5_BINARY, MAT_ASCII, MAT_BINARY, read_binary_file_header(), read_mat5_binary_file_header(), read_mat_file_header(), TEXT, and UNKNOWN.
|
staticprivate |
Definition at line 1077 of file load-save.cc.
References OCTAVE_VERSION.
|
private |
Definition at line 1069 of file load-save.cc.
References interpreter::install_variable(), and m_interpreter.
Referenced by load_vars().
octave_value_list load_save_system::load | ( | const octave_value_list & | args = octave_value_list () , |
int | nargout = 0 |
||
) |
Definition at line 1160 of file load-save.cc.
References BINARY, gzifstream::close(), hdf5_fstreambase::close(), err_disabled_feature(), err_file_open(), error(), hdf5_fstreambase::file_id, find_file_to_load(), flt_fmt_unknown, format(), get_file_format(), HDF5, ifstream(), octave_value_list::length(), load_vars(), octave_value_list::make_argv(), MAT5_BINARY, MAT7_BINARY, MAT_ASCII, MAT_BINARY, print_usage(), read_binary_file_header(), read_mat5_binary_file_header(), TEXT, tilde_expand(), UNKNOWN, and warning().
Referenced by Fload().
octave_value load_save_system::load_vars | ( | std::istream & | stream, |
const std::string & | orig_fname, | ||
const load_save_format & | fmt, | ||
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 at line 381 of file load-save.cc.
References octave_scalar_map::assign(), BINARY, octave_value::columns(), stream::eof(), err_unrecognized_data_fmt(), error(), HDF5, install_loaded_variable(), octave_value::is_defined(), left, string_vector::list_in_columns(), MAT5_BINARY, MAT7_BINARY, MAT_ASCII, MAT_BINARY, matches_patterns(), octave_scalar_map::nfields(), octave_stdout, read_binary_data(), read_hdf5_data(), read_mat5_binary_element(), read_mat_ascii_data(), read_mat_binary_data(), read_text_data(), octave_value::rows(), TEXT, load_save_format::type(), octave_value::type_name(), and warning().
Referenced by load().
octave_value load_save_system::octave_core_file_limit | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 287 of file load-save.cc.
References m_octave_core_file_limit, and set_internal_variable().
Referenced by Foctave_core_file_limit().
|
inline |
Definition at line 105 of file load-save.h.
References m_octave_core_file_limit, and set().
|
inline |
Definition at line 100 of file load-save.h.
References m_octave_core_file_limit.
octave_value load_save_system::octave_core_file_name | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 295 of file load-save.cc.
References m_octave_core_file_name, and set_internal_variable().
Referenced by Foctave_core_file_name().
|
inline |
Definition at line 118 of file load-save.h.
References m_octave_core_file_name, and set().
|
inline |
Definition at line 113 of file load-save.h.
References m_octave_core_file_name.
octave_value load_save_system::octave_core_file_options | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 311 of file load-save.cc.
References m_octave_core_file_options, and set_internal_variable().
Referenced by Foctave_core_file_options().
|
inline |
Definition at line 144 of file load-save.h.
References m_octave_core_file_options, and set().
|
inline |
Definition at line 139 of file load-save.h.
References m_octave_core_file_options.
|
delete |
|
static |
Definition at line 658 of file load-save.cc.
References string_vector::append(), and parse_save_options().
|
static |
Definition at line 532 of file load-save.cc.
References string_vector::append(), BINARY, err_disabled_feature(), error(), HDF5, MAT5_BINARY, MAT7_BINARY, MAT_ASCII, MAT_ASCII_LONG, MAT_ASCII_TABS, MAT_BINARY, string_vector::numel(), load_save_format::set_option(), load_save_format::set_type(), TEXT, load_save_format::type(), and warning().
Referenced by dump_octave_core(), parse_save_options(), and save().
octave_value_list load_save_system::save | ( | const octave_value_list & | args = octave_value_list () , |
int | nargout = 0 |
||
) |
Definition at line 1404 of file load-save.cc.
References gzofstream::close(), hdf5_fstreambase::close(), err_file_open(), error(), hdf5_fstreambase::file_id, format(), get_ASCII_filename(), glob_pattern_p(), HDF5, octave_value_list::make_argv(), MAT7_BINARY, string_vector::numel(), octave_stdout, octave_value(), ofstream(), parse_save_options(), print_usage(), save_default_options(), save_vars(), TEXT, tilde_expand(), and warning().
Referenced by Fsave().
octave_value load_save_system::save_default_options | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 303 of file load-save.cc.
References m_save_default_options, and set_internal_variable().
Referenced by Fsave_default_options(), and interpreter::maximum_braindamage().
|
inline |
Definition at line 131 of file load-save.h.
References m_save_default_options, and set().
|
inline |
Definition at line 126 of file load-save.h.
References m_save_default_options.
Referenced by save().
|
private |
Definition at line 1003 of file load-save.cc.
References do_save(), m, and glob_match::match().
Referenced by save_vars().
octave_value load_save_system::save_header_format_string | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 319 of file load-save.cc.
References m_save_header_format_string, and set_internal_variable().
Referenced by Fsave_header_format_string().
|
inline |
Definition at line 157 of file load-save.h.
References format(), m_save_header_format_string, and set().
|
inline |
Definition at line 152 of file load-save.h.
References m_save_header_format_string.
void load_save_system::save_vars | ( | const string_vector & | argv, |
int | argv_idx, | ||
int | argc, | ||
std::ostream & | os, | ||
const load_save_format & | fmt, | ||
bool | save_as_floats, | ||
bool | write_header_info | ||
) |
Definition at line 676 of file load-save.cc.
References error(), interpreter::is_variable(), octave_value::isstruct(), m_interpreter, octave_value::numel(), save_fields(), octave_value::scalar_map_value(), interpreter::varval(), warning(), and write_header().
Referenced by save().
|
private |
Definition at line 913 of file load-save.cc.
References do_save(), interpreter::get_evaluator(), tree_evaluator::glob_symbol_info(), and m_interpreter.
|
inlineprivate |
Definition at line 261 of file load-save.h.
Referenced by crash_dumps_octave_core(), octave_core_file_limit(), octave_core_file_name(), octave_core_file_options(), save_default_options(), and save_header_format_string().
|
private |
Definition at line 828 of file load-save.cc.
References BINARY, hdf5_fstreambase::file_id, float_format_to_mopt_digit(), HDF5, len, m_save_header_format_string, MAT5_BINARY, MAT7_BINARY, min(), native_float_format(), OCTAVE_VERSION, TEXT, load_save_format::type(), and words_big_endian().
Referenced by dump_octave_core(), and save_vars().
|
private |
Definition at line 205 of file load-save.h.
Referenced by crash_dumps_octave_core(), and dump_octave_core().
|
private |
Definition at line 201 of file load-save.h.
Referenced by dump_octave_core(), install_loaded_variable(), and save_vars().
|
private |
Definition at line 209 of file load-save.h.
Referenced by dump_octave_core(), and octave_core_file_limit().
|
private |
Definition at line 212 of file load-save.h.
Referenced by dump_octave_core(), and octave_core_file_name().
|
private |
Definition at line 219 of file load-save.h.
Referenced by dump_octave_core(), and octave_core_file_options().
|
private |
Definition at line 216 of file load-save.h.
Referenced by save_default_options().
|
private |
Definition at line 224 of file load-save.h.
Referenced by save_header_format_string(), and write_header().