#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 | |
load_save_system (interpreter &interp) | |
~load_save_system (void) | |
bool | crash_dumps_octave_core (bool flag) |
octave_value | crash_dumps_octave_core (const octave_value_list &args, int nargout) |
bool | crash_dumps_octave_core (void) const |
void | dump_octave_core (void) |
octave_value_list | load (const octave_value_list &args=octave_value_list(), int nargout=0) |
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 |
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 |
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 |
octave_value_list | save (const octave_value_list &args=octave_value_list(), int nargout=0) |
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 |
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 |
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 load_save_format | get_file_format (const std::string &fname, const std::string &orig_fname, bool &use_zlib, bool quiet=false) |
static string_vector | parse_save_options (const std::string &arg, load_save_format &fmt, bool &append, bool &save_as_floats, bool &use_zlib) |
static 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 | |
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) |
void | do_save (std::ostream &os, const symbol_info &syminfo, const load_save_format &fmt, bool save_as_floats) |
void | dump_octave_core (std::ostream &os, const char *fname, const load_save_format &fmt, bool save_as_floats) |
void | install_loaded_variable (const std::string &name, const octave_value &val, bool global, const std::string &) |
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) |
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) |
void | write_header (std::ostream &os, const load_save_format &fmt) |
Static Private Member Functions | |
static load_save_format | get_file_format (std::istream &file, const std::string &filename) |
static 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.
octave::load_save_system::load_save_system | ( | interpreter & | interp | ) |
Definition at line 259 of file load-save.cc.
octave::load_save_system::~load_save_system | ( | void | ) |
Definition at line 273 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 octave::load_save_system::crash_dumps_octave_core | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 281 of file load-save.cc.
References m_crash_dumps_octave_core, and set_internal_variable().
Referenced by Fcrash_dumps_octave_core(), and octave::interpreter::maximum_braindamage().
|
inline |
Definition at line 87 of file load-save.h.
References m_crash_dumps_octave_core.
|
private |
Definition at line 927 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, name, octave::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, octave::load_save_format::type(), and warning().
Referenced by do_save(), dump_octave_core(), save_fields(), and save_vars().
|
private |
Definition at line 976 of file load-save.cc.
References do_save(), octave_value::is_defined(), octave::symbol_info::is_global(), name, octave::symbol_info::name(), and octave::symbol_info::value().
|
private |
Definition at line 1022 of file load-save.cc.
References octave_value::byte_size(), do_save(), octave::interpreter::get_evaluator(), m_interpreter, m_octave_core_file_limit, message(), name, octave::tree_evaluator::top_scope_symbol_info(), and write_header().
void octave::load_save_system::dump_octave_core | ( | void | ) |
Definition at line 729 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(), octave::sys::ofstream(), parse_save_options(), octave::math::trunc(), octave::load_save_format::type(), and warning().
Referenced by dump_octave_core().
|
static |
Definition at line 329 of file load-save.cc.
References octave::check_gzip_magic(), gzifstream::close(), octave::err_file_open(), octave::sys::get_ASCII_filename(), HDF5, octave::sys::ifstream(), retval, and UNKNOWN.
Referenced by load().
|
staticprivate |
Definition at line 1082 of file load-save.cc.
References BINARY, extract_keyword(), octave::mach_info::flt_fmt_unknown, imag(), len, looks_like_mat_ascii_file(), MAT5_BINARY, MAT_ASCII, MAT_BINARY, octave::read_binary_file_header(), read_mat5_binary_file_header(), read_mat_file_header(), retval, TEXT, and UNKNOWN.
|
staticprivate |
Definition at line 1070 of file load-save.cc.
References octave::sys::env::get_host_name(), octave::sys::env::get_user_name(), and OCTAVE_VERSION.
|
private |
Definition at line 1062 of file load-save.cc.
References octave::interpreter::install_variable(), m_interpreter, and name.
Referenced by load_vars().
octave_value_list octave::load_save_system::load | ( | const octave_value_list & | args = octave_value_list () , |
int | nargout = 0 |
||
) |
Definition at line 1153 of file load-save.cc.
References BINARY, gzifstream::close(), hdf5_fstreambase::close(), err_disabled_feature(), octave::err_file_open(), error(), hdf5_fstreambase::file_id, octave::find_file_to_load(), octave::mach_info::flt_fmt_unknown, octave::format(), get_file_format(), HDF5, octave::sys::ifstream(), octave_value_list::length(), load_vars(), octave_value_list::make_argv(), MAT5_BINARY, MAT7_BINARY, MAT_ASCII, MAT_BINARY, print_usage(), octave::read_binary_file_header(), read_mat5_binary_file_header(), retval, TEXT, octave::sys::file_ops::tilde_expand(), UNKNOWN, and warning().
Referenced by Fload().
octave_value octave::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 379 of file load-save.cc.
References octave_scalar_map::assign(), BINARY, octave_value::columns(), octave::stream::eof(), err_unrecognized_data_fmt(), error(), HDF5, install_loaded_variable(), octave_value::is_defined(), octave::left, string_vector::list_in_columns(), MAT5_BINARY, MAT7_BINARY, MAT_ASCII, MAT_BINARY, octave::matches_patterns(), name, 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(), retval, octave_value::rows(), TEXT, octave::load_save_format::type(), octave_value::type_name(), and warning().
Referenced by load().
octave_value octave::load_save_system::octave_core_file_limit | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 289 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 octave::load_save_system::octave_core_file_name | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 297 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 octave::load_save_system::octave_core_file_options | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 313 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 652 of file load-save.cc.
References string_vector::append(), and parse_save_options().
|
static |
Definition at line 530 of file load-save.cc.
References BINARY, err_disabled_feature(), error(), HDF5, MAT5_BINARY, MAT7_BINARY, MAT_ASCII, MAT_ASCII_LONG, MAT_ASCII_TABS, MAT_BINARY, string_vector::numel(), retval, octave::load_save_format::set_option(), octave::load_save_format::set_type(), TEXT, octave::load_save_format::type(), and warning().
Referenced by dump_octave_core(), parse_save_options(), and save().
octave_value_list octave::load_save_system::save | ( | const octave_value_list & | args = octave_value_list () , |
int | nargout = 0 |
||
) |
Definition at line 1397 of file load-save.cc.
References gzofstream::close(), hdf5_fstreambase::close(), octave::err_file_open(), error(), hdf5_fstreambase::file_id, octave::format(), octave::sys::get_ASCII_filename(), octave::glob_pattern_p(), HDF5, octave_value_list::make_argv(), MAT7_BINARY, string_vector::numel(), octave_stdout, octave_value(), octave::sys::ofstream(), parse_save_options(), print_usage(), retval, save_default_options(), save_vars(), TEXT, octave::sys::file_ops::tilde_expand(), and warning().
Referenced by Fsave().
octave_value octave::load_save_system::save_default_options | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 305 of file load-save.cc.
References m_save_default_options, and set_internal_variable().
Referenced by Fsave_default_options(), and octave::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 996 of file load-save.cc.
References do_save(), m, and glob_match::match().
Referenced by save_vars().
octave_value octave::load_save_system::save_header_format_string | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 321 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 octave::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 octave::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 670 of file load-save.cc.
References error(), octave::interpreter::is_variable(), octave_value::isstruct(), m_interpreter, octave_value::numel(), save_fields(), octave_value::scalar_map_value(), octave::interpreter::varval(), warning(), and write_header().
Referenced by save().
|
private |
Definition at line 906 of file load-save.cc.
References do_save(), octave::interpreter::get_evaluator(), octave::tree_evaluator::glob_symbol_info(), and m_interpreter.
|
inlineprivate |
Definition at line 258 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 822 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(), octave::mach_info::native_float_format(), OCTAVE_VERSION, octave::sys::base_tm::strftime(), TEXT, octave::load_save_format::type(), and octave::mach_info::words_big_endian().
Referenced by dump_octave_core(), and save_vars().
|
private |
Definition at line 207 of file load-save.h.
Referenced by crash_dumps_octave_core(), and dump_octave_core().
|
private |
Definition at line 203 of file load-save.h.
Referenced by dump_octave_core(), install_loaded_variable(), and save_vars().
|
private |
Definition at line 211 of file load-save.h.
Referenced by dump_octave_core(), and octave_core_file_limit().
|
private |
Definition at line 214 of file load-save.h.
Referenced by dump_octave_core(), and octave_core_file_name().
|
private |
Definition at line 221 of file load-save.h.
Referenced by dump_octave_core(), and octave_core_file_options().
|
private |
Definition at line 218 of file load-save.h.
Referenced by save_default_options().
|
private |
Definition at line 226 of file load-save.h.
Referenced by save_header_format_string(), and write_header().