#include "oct-stream.h"
Public Member Functions | |
stream (base_stream *bs=nullptr) | |
stream (const stream &)=default | |
~stream ()=default | |
void | clearerr () |
void | close () |
std::string | encoding () |
bool | eof () const |
std::string | error (bool clear, int &err_num) |
std::string | error (bool clear=false) |
void | error (const char *msg) |
void | error (const std::string &msg) |
int | file_number () |
mach_info::float_format | float_format () const |
int | flush () |
std::string | getl (const octave_value &max_len, bool &err, const std::string &who) |
std::string | getl (octave_idx_type max_len, bool &err, const std::string &who) |
std::string | gets (const octave_value &max_len, bool &err, const std::string &who) |
std::string | gets (octave_idx_type max_len, bool &err, const std::string &who) |
std::istream * | input_stream () |
bool | is_open () const |
bool | is_valid () const |
int | mode () const |
std::string | name () const |
bool | ok () const |
operator bool () const | |
stream & | operator= (const stream &)=default |
octave_value_list | oscanf (const octave_value &fmt, const std::string &who) |
octave_value_list | oscanf (const std::string &fmt, const std::string &who) |
std::ostream * | output_stream () |
std::ostream * | preferred_output_stream () |
int | printf (const octave_value &fmt, const octave_value_list &args, const std::string &who) |
int | printf (const std::string &fmt, const octave_value_list &args, const std::string &who) |
int | puts (const octave_value &s, const std::string &who) |
int | puts (const std::string &s, const std::string &who) |
octave_value | 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) |
int | rewind () |
octave_value | scanf (const octave_value &fmt, const Array< double > &size, octave_idx_type &count, const std::string &who) |
octave_value | scanf (const std::string &fmt, const Array< double > &size, octave_idx_type &count, const std::string &who) |
int | seek (const octave_value &offset, const octave_value &origin) |
int | seek (off_t offset, int origin) |
bool | skip_bytes (std::size_t n_elts) |
off_t | skipl (const octave_value &count, bool &err, const std::string &who) |
off_t | skipl (off_t count, bool &err, const std::string &who) |
off_t | tell () |
octave_value | textscan (const std::string &fmt, octave_idx_type ntimes, const octave_value_list &options, const std::string &who, octave_idx_type &count) |
template<typename T > | |
octave_idx_type | 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) |
octave_idx_type | 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) |
bool | write_bytes (const void *data, std::size_t n_elts) |
Static Public Member Functions | |
static std::string | mode_as_string (int mode) |
Definition at line 298 of file oct-stream.h.
|
inline |
Definition at line 303 of file oct-stream.h.
|
default |
|
default |
|
inline |
Definition at line 460 of file oct-stream.h.
void stream::close | ( | ) |
Definition at line 6379 of file oct-stream.cc.
Referenced by stream_list::clear(), and stream_list::remove().
|
inline |
Definition at line 439 of file oct-stream.h.
Referenced by stream_list::get_info().
bool stream::eof | ( | ) | const |
Definition at line 7276 of file oct-stream.cc.
Referenced by Ffeof(), Fsscanf(), and load_save_system::load_vars().
|
inline |
Definition at line 407 of file oct-stream.h.
References error().
|
inline |
|
inline |
Definition at line 415 of file oct-stream.h.
|
inline |
Definition at line 423 of file oct-stream.h.
Referenced by Fdup2(), Ffcntl(), and stream_list::insert().
mach_info::float_format stream::float_format | ( | ) | const |
Definition at line 7320 of file oct-stream.cc.
Referenced by stream_list::get_info(), stream_list::list_open_files(), and write().
int stream::flush | ( | ) |
Definition at line 6111 of file oct-stream.cc.
Referenced by Ffflush().
std::string stream::getl | ( | const octave_value & | max_len, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6133 of file oct-stream.cc.
References error(), getl(), and octave_value::is_defined().
std::string stream::getl | ( | octave_idx_type | max_len, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6122 of file oct-stream.cc.
std::string stream::gets | ( | const octave_value & | max_len, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6168 of file oct-stream.cc.
References error(), gets(), and octave_value::is_defined().
std::string stream::gets | ( | octave_idx_type | max_len, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6157 of file oct-stream.cc.
|
inline |
Definition at line 444 of file oct-stream.h.
Referenced by Fdlmread(), and read().
bool stream::is_open | ( | ) | const |
Definition at line 6368 of file oct-stream.cc.
|
inline |
Definition at line 425 of file oct-stream.h.
Referenced by stream_list::clear(), Fsprintf(), Fsscanf(), stream_list::get_info(), and stream_list::remove().
int stream::mode | ( | ) | const |
Definition at line 7309 of file oct-stream.cc.
Referenced by stream_list::get_info(), stream_list::list_open_files(), and mode_as_string().
|
static |
Definition at line 7331 of file oct-stream.cc.
References mode().
Referenced by stream_list::get_info(), and stream_list::list_open_files().
std::string stream::name | ( | ) | const |
Definition at line 7298 of file oct-stream.cc.
Referenced by stream_list::clear(), stream_list::get_file_number(), stream_list::get_info(), and stream_list::list_open_files().
|
inline |
Definition at line 427 of file oct-stream.h.
|
inline |
Definition at line 429 of file oct-stream.h.
octave_value_list stream::oscanf | ( | const octave_value & | fmt, |
const std::string & | who | ||
) |
Definition at line 7175 of file oct-stream.cc.
References do_string_escapes(), error(), octave_value::is_sq_string(), octave_value::is_string(), oscanf(), and octave_value::string_value().
octave_value_list stream::oscanf | ( | const std::string & | fmt, |
const std::string & | who | ||
) |
Definition at line 7164 of file oct-stream.cc.
|
inline |
Definition at line 449 of file oct-stream.h.
Referenced by skip_bytes(), and write_bytes().
|
inline |
Definition at line 454 of file oct-stream.h.
Referenced by Ffdisp().
int stream::printf | ( | const octave_value & | fmt, |
const octave_value_list & | args, | ||
const std::string & | who | ||
) |
Definition at line 7220 of file oct-stream.cc.
References do_string_escapes(), error(), octave_value::is_sq_string(), octave_value::is_string(), printf(), and octave_value::string_value().
int stream::printf | ( | const std::string & | fmt, |
const octave_value_list & | args, | ||
const std::string & | who | ||
) |
Definition at line 7208 of file oct-stream.cc.
Referenced by Fsprintf(), and printf().
int stream::puts | ( | const octave_value & | s, |
const std::string & | who | ||
) |
Definition at line 7257 of file oct-stream.cc.
References error(), octave_value::is_string(), puts(), and octave_value::string_value().
int stream::puts | ( | const std::string & | s, |
const std::string & | who | ||
) |
Definition at line 7244 of file oct-stream.cc.
Referenced by puts().
octave_value 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 6593 of file oct-stream.cc.
References oct_data_conv::data_type_size(), error(), input_stream(), and panic_if.
int stream::rewind | ( | ) |
Definition at line 6362 of file oct-stream.cc.
References seek(), and SEEK_SET.
Referenced by Ffrewind().
octave_value stream::scanf | ( | const octave_value & | fmt, |
const Array< double > & | size, | ||
octave_idx_type & | count, | ||
const std::string & | who | ||
) |
Definition at line 7140 of file oct-stream.cc.
References do_string_escapes(), error(), octave_value::is_sq_string(), octave_value::is_string(), scanf(), and octave_value::string_value().
octave_value stream::scanf | ( | const std::string & | fmt, |
const Array< double > & | size, | ||
octave_idx_type & | count, | ||
const std::string & | who | ||
) |
Definition at line 7128 of file oct-stream.cc.
int stream::seek | ( | const octave_value & | offset, |
const octave_value & | origin | ||
) |
Definition at line 6295 of file oct-stream.cc.
References error(), octave_value::is_string(), seek(), SEEK_CUR, SEEK_END, SEEK_SET, octave_int< T >::value(), octave_value::xint64_scalar_value(), and octave_value::xstring_value().
Definition at line 6234 of file oct-stream.cc.
References clearerr(), SEEK_CUR, SEEK_END, and SEEK_SET.
Referenced by Ffseek(), rewind(), seek(), and skip_bytes().
bool stream::skip_bytes | ( | std::size_t | n_elts | ) |
Definition at line 6982 of file oct-stream.cc.
References output_stream(), seek(), SEEK_CUR, SEEK_END, SEEK_SET, and tell().
Referenced by write().
off_t stream::skipl | ( | const octave_value & | count, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6203 of file oct-stream.cc.
References error(), octave_value::is_defined(), octave_value::is_scalar_type(), octave_value::scalar_value(), and skipl().
off_t stream::skipl | ( | off_t | count, |
bool & | err, | ||
const std::string & | who | ||
) |
Definition at line 6192 of file oct-stream.cc.
off_t stream::tell | ( | ) |
Definition at line 6351 of file oct-stream.cc.
Referenced by Fftell(), Fsscanf(), and skip_bytes().
octave_value 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 7198 of file oct-stream.cc.
octave_idx_type 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 7026 of file oct-stream.cc.
References Array< T, Alloc >::data(), oct_data_conv::data_type_size(), Array< T, Alloc >::numel(), OCTAVE_LOCAL_BUFFER, skip_bytes(), and write_bytes().
octave_idx_type 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 6786 of file oct-stream.cc.
References error(), float_format(), and octave_value::write().
bool stream::write_bytes | ( | const void * | data, |
std::size_t | n_elts | ||
) |