#include "oct-stream.h"
Static Public Member Functions | |
static std::string | mode_as_string (int mode) |
Private Member Functions | |
octave_value | finalize_read (std::list< void *> &input_buf_list, octave_idx_type input_buf_elts, octave_idx_type elts_read, octave_idx_type nr, octave_idx_type nc, oct_data_conv::data_type input_type, oct_data_conv::data_type output_type, mach_info::float_format ffmt) |
void | invalid_operation (const std::string &who, const char *rw) |
bool | stream_ok (bool clear=true) const |
Private Attributes | |
base_stream * | rep |
Definition at line 243 of file oct-stream.h.
octave::stream::stream | ( | base_stream * | bs = nullptr | ) |
Definition at line 5958 of file oct-stream.cc.
References octave::base_stream::count, and rep.
octave::stream::~stream | ( | void | ) |
Definition at line 5965 of file oct-stream.cc.
References octave::base_stream::count, and rep.
octave::stream::stream | ( | const stream & | s | ) |
Definition at line 5971 of file oct-stream.cc.
References octave::base_stream::count, and rep.
|
inline |
Definition at line 376 of file oct-stream.h.
Referenced by seek().
void octave::stream::close | ( | void | ) |
Definition at line 6263 of file oct-stream.cc.
References octave::base_stream::close(), rep, and stream_ok().
Referenced by octave::stream_list::clear(), and octave::stream_list::remove().
bool octave::stream::eof | ( | void | ) | const |
Definition at line 7194 of file oct-stream.cc.
References octave::base_stream::eof(), rep, retval, and stream_ok().
Referenced by octave_ostrstream::eof(), and octave::read_data().
std::string octave::stream::error | ( | bool | clear, |
int & | err_num | ||
) |
Definition at line 7205 of file oct-stream.cc.
References octave::base_stream::error(), rep, retval, stream_ok(), and string.
Referenced by finalize_read(), getl(), gets(), oscanf(), printf(), puts(), read(), scanf(), seek(), skipl(), and write().
|
inline |
Definition at line 334 of file oct-stream.h.
References error().
|
inline |
Definition at line 342 of file oct-stream.h.
|
inline |
|
inline |
Definition at line 350 of file oct-stream.h.
Referenced by Fdup2(), and octave::stream_list::insert().
|
private |
Definition at line 6419 of file oct-stream.cc.
References oct_data_conv::dt_char, oct_data_conv::dt_double, oct_data_conv::dt_int16, oct_data_conv::dt_int32, oct_data_conv::dt_int64, oct_data_conv::dt_int8, oct_data_conv::dt_logical, oct_data_conv::dt_schar, oct_data_conv::dt_single, oct_data_conv::dt_uchar, oct_data_conv::dt_uint16, oct_data_conv::dt_uint32, oct_data_conv::dt_uint64, oct_data_conv::dt_uint8, oct_data_conv::dt_unknown, error(), FILL_TABLE_ROW, float_format(), octave::mach_info::flt_fmt_ieee_big_endian, octave::mach_info::flt_fmt_ieee_little_endian, octave::mach_info::flt_fmt_unknown, i, initialized, retval, swap, and octave::mach_info::words_big_endian().
Referenced by read().
mach_info::float_format octave::stream::float_format | ( | void | ) | const |
Definition at line 7238 of file oct-stream.cc.
References octave::base_stream::float_format(), octave::mach_info::flt_fmt_unknown, rep, retval, and stream_ok().
Referenced by finalize_read(), octave::stream_list::list_open_files(), and write().
int octave::stream::flush | ( | void | ) |
Definition at line 5996 of file oct-stream.cc.
References octave::base_stream::flush(), rep, retval, and stream_ok().
Referenced by octave::base_stream::flush(), and octave::base_stream::puts().
std::string octave::stream::getl | ( | octave_idx_type | max_len, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6007 of file oct-stream.cc.
References err, octave::base_stream::getl(), rep, retval, stream_ok(), and string.
Referenced by getl().
std::string octave::stream::getl | ( | const octave_value & | max_len, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6018 of file oct-stream.cc.
References octave::convert_to_valid_int(), err, error(), getl(), and octave_value::is_defined().
std::string octave::stream::gets | ( | octave_idx_type | max_len, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6042 of file oct-stream.cc.
References err, octave::base_stream::gets(), rep, retval, stream_ok(), and string.
Referenced by gets().
std::string octave::stream::gets | ( | const octave_value & | max_len, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6053 of file oct-stream.cc.
References octave::convert_to_valid_int(), err, error(), gets(), and octave_value::is_defined().
|
inline |
Definition at line 366 of file oct-stream.h.
Referenced by read().
|
inlineprivate |
Definition at line 398 of file oct-stream.h.
References octave::base_stream::invalid_operation().
bool octave::stream::is_open | ( | void | ) | const |
Definition at line 6252 of file oct-stream.cc.
References octave::base_stream::is_open(), rep, retval, and stream_ok().
|
inline |
Definition at line 352 of file oct-stream.h.
Referenced by octave::stream_list::clear(), and octave::stream_list::remove().
int octave::stream::mode | ( | void | ) | const |
Definition at line 7227 of file oct-stream.cc.
References octave::base_stream::mode(), rep, retval, and stream_ok().
Referenced by octave::stream_list::list_open_files(), and mode_as_string().
|
static |
Definition at line 7249 of file oct-stream.cc.
References mode(), retval, string, and octave::math::trunc().
std::string octave::stream::name | ( | void | ) | const |
Definition at line 7216 of file oct-stream.cc.
References octave::base_stream::name(), rep, retval, stream_ok(), and string.
Referenced by octave::stream_list::clear(), octave::stream_list::get_file_number(), octave::stream_list::list_open_files(), octave::jit_call::print(), octave_fcn_handle::save_ascii(), and octave_fcn_handle::save_binary().
|
inline |
Definition at line 354 of file oct-stream.h.
|
inline |
Definition at line 356 of file oct-stream.h.
Definition at line 5979 of file oct-stream.cc.
References octave::base_stream::count, rep, and s.
octave_value_list octave::stream::oscanf | ( | const std::string & | fmt, |
const std::string & | who | ||
) |
Definition at line 7082 of file oct-stream.cc.
References octave::base_stream::oscanf(), rep, retval, and stream_ok().
Referenced by oscanf().
octave_value_list octave::stream::oscanf | ( | const octave_value & | fmt, |
const std::string & | who | ||
) |
Definition at line 7093 of file oct-stream.cc.
References do_string_escapes(), error(), octave_value::is_sq_string(), octave_value::is_string(), oscanf(), retval, string, and octave_value::string_value().
|
inline |
Definition at line 371 of file oct-stream.h.
Referenced by skip_bytes(), and write_bytes().
int octave::stream::printf | ( | const std::string & | fmt, |
const octave_value_list & | args, | ||
const std::string & | who | ||
) |
Definition at line 7126 of file oct-stream.cc.
References octave::base_stream::printf(), rep, retval, and stream_ok().
Referenced by printf().
int octave::stream::printf | ( | const octave_value & | fmt, |
const octave_value_list & | args, | ||
const std::string & | who | ||
) |
Definition at line 7138 of file oct-stream.cc.
References do_string_escapes(), error(), octave_value::is_sq_string(), octave_value::is_string(), printf(), retval, string, and octave_value::string_value().
int octave::stream::puts | ( | const std::string & | s, |
const std::string & | who | ||
) |
Definition at line 7162 of file oct-stream.cc.
References octave::base_stream::puts(), rep, retval, s, and stream_ok().
Referenced by puts().
int octave::stream::puts | ( | const octave_value & | s, |
const std::string & | who | ||
) |
Definition at line 7175 of file oct-stream.cc.
References error(), octave_value::is_string(), puts(), retval, s, string, and octave_value::string_value().
octave_value octave::stream::read | ( | const Array< double > & | size, |
octave_idx_type | block_size, | ||
oct_data_conv::data_type | input_type, | ||
oct_data_conv::data_type | output_type, | ||
octave_idx_type | skip, | ||
mach_info::float_format | flt_fmt, | ||
octave_idx_type & | count | ||
) |
Definition at line 6507 of file oct-stream.cc.
References oct_data_conv::data_type_size(), error(), finalize_read(), octave::get_size(), input_stream(), invalid_operation(), is, max(), retval, seek(), SEEK_CUR, SEEK_END, SEEK_SET, stream_ok(), and tell().
Referenced by octave::read_data().
int octave::stream::rewind | ( | void | ) |
Definition at line 6246 of file oct-stream.cc.
References seek(), and SEEK_SET.
Referenced by Ffrewind().
octave_value octave::stream::scanf | ( | const std::string & | fmt, |
const Array< double > & | size, | ||
octave_idx_type & | count, | ||
const std::string & | who | ||
) |
Definition at line 7046 of file oct-stream.cc.
References rep, retval, octave::base_stream::scanf(), and stream_ok().
Referenced by scanf().
octave_value octave::stream::scanf | ( | const octave_value & | fmt, |
const Array< double > & | size, | ||
octave_idx_type & | count, | ||
const std::string & | who | ||
) |
Definition at line 7058 of file oct-stream.cc.
References do_string_escapes(), error(), octave_value::is_sq_string(), octave_value::is_string(), retval, scanf(), string, and octave_value::string_value().
int octave::stream::seek | ( | off_t | offset, |
int | origin | ||
) |
Definition at line 6118 of file oct-stream.cc.
References clearerr(), rep, octave::base_stream::seek(), SEEK_CUR, SEEK_END, SEEK_SET, stream_ok(), and octave::base_stream::tell().
Referenced by read(), rewind(), seek(), and skip_bytes().
int octave::stream::seek | ( | const octave_value & | offset, |
const octave_value & | origin | ||
) |
Definition at line 6179 of file oct-stream.cc.
References octave::convert_to_valid_int(), error(), octave_value::is_string(), retval, seek(), SEEK_CUR, SEEK_END, SEEK_SET, string, octave_value::string_value(), val, and octave_value::xint64_scalar_value().
off_t octave::stream::skipl | ( | off_t | count, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6077 of file oct-stream.cc.
References err, rep, retval, octave::base_stream::skipl(), and stream_ok().
Referenced by skipl().
off_t octave::stream::skipl | ( | const octave_value & | count, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6088 of file oct-stream.cc.
References octave::convert_to_valid_int(), err, error(), octave_value::is_defined(), octave_value::is_scalar_type(), octave::math::isinf(), octave_value::scalar_value(), and skipl().
off_t octave::stream::tell | ( | void | ) |
Definition at line 6235 of file oct-stream.cc.
References rep, retval, stream_ok(), and octave::base_stream::tell().
Referenced by read(), and skip_bytes().
octave_value octave::stream::textscan | ( | const std::string & | fmt, |
octave_idx_type | ntimes, | ||
const octave_value_list & | options, | ||
const std::string & | who, | ||
octave_idx_type & | count | ||
) |
Definition at line 7116 of file oct-stream.cc.
References octave::base_stream::do_textscan(), octave_value(), options, rep, and stream_ok().
octave_idx_type octave::stream::write | ( | const octave_value & | data, |
octave_idx_type | block_size, | ||
oct_data_conv::data_type | output_type, | ||
octave_idx_type | skip, | ||
mach_info::float_format | flt_fmt | ||
) |
Definition at line 6704 of file oct-stream.cc.
References error(), float_format(), flt_fmt, octave::mach_info::flt_fmt_unknown, invalid_operation(), retval, stream_ok(), and octave_value::write().
Referenced by do_fwrite(), octave_char_matrix_str::save_ascii(), octave_fcn_inline::save_binary(), octave_float_complex_diag_matrix::save_binary(), octave_complex_diag_matrix::save_binary(), octave_float_diag_matrix::save_binary(), octave_base_int_matrix< intNDArray< OCTAVE_INT_T > >::save_binary(), octave_diag_matrix::save_binary(), octave_sparse_bool_matrix::save_binary(), octave_fcn_handle::save_binary(), octave_sparse_complex_matrix::save_binary(), octave_struct::save_binary(), octave_sparse_matrix::save_binary(), octave_float_complex_matrix::save_binary(), octave_cell::save_binary(), octave_complex_matrix::save_binary(), octave_char_matrix_str::save_binary(), octave_base_int_scalar< OCTAVE_INT_T >::save_binary(), octave_float_complex::save_binary(), octave_complex::save_binary(), octave_class::save_binary(), octave_float_matrix::save_binary(), octave_bool_matrix::save_binary(), octave_perm_matrix::save_binary(), octave_matrix::save_binary(), octave_bool::save_binary(), octave_float_scalar::save_binary(), octave_scalar::save_binary(), octave_scalar_struct::save_binary(), octave_range::save_binary(), save_binary_data(), save_mat5_binary_element(), save_mat_binary_data(), skip_bytes(), octave_float_complex_matrix::write(), octave_complex_matrix::write(), octave_char_matrix_str::write(), octave_float_complex::write(), octave_complex::write(), octave_float_matrix::write(), octave_bool_matrix::write(), octave_matrix::write(), octave_bool::write(), octave_float_scalar::write(), octave_scalar::write(), octave_range::write(), OCTAVE_VALUE_INT_MATRIX_T::write(), OCTAVE_VALUE_INT_SCALAR_T::write(), write_bytes(), octave::write_data(), write_doubles(), write_floats(), write_header(), write_mat5_array(), and write_mat5_integer_data().
octave_idx_type octave::stream::write | ( | const Array< T > & | data, |
octave_idx_type | block_size, | ||
oct_data_conv::data_type | output_type, | ||
octave_idx_type | skip, | ||
mach_info::float_format | flt_fmt | ||
) |
Definition at line 6944 of file oct-stream.cc.
References octave::convert_data(), Array< T >::data(), oct_data_conv::data_type_size(), flt_fmt, octave::mach_info::flt_fmt_ieee_big_endian, octave::mach_info::flt_fmt_ieee_little_endian, i, Array< T >::numel(), OCTAVE_LOCAL_BUFFER, skip_bytes(), swap, octave::mach_info::words_big_endian(), and write_bytes().
Definition at line 6877 of file oct-stream.cc.
References os, output_stream(), and write().
Referenced by write().
|
private |