GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include "oct-stream.h"
Public Member Functions | |
octave_base_stream (std::ios::openmode arg_md=std::ios::in|std::ios::out, oct_mach_info::float_format ff=oct_mach_info::native_float_format()) | |
virtual | ~octave_base_stream (void) |
void | close (void) |
virtual void | do_close (void) |
virtual bool | eof (void) const =0 |
std::string | error (bool clear, int &err_num) |
virtual int | file_number (void) const |
virtual std::istream * | input_stream (void) |
bool | is_open (void) const |
virtual std::string | name (void) const =0 |
bool | ok (void) const |
virtual std::ostream * | output_stream (void) |
virtual int | seek (off_t offset, int origin)=0 |
virtual off_t | tell (void)=0 |
Protected Member Functions | |
void | clear (void) |
void | clearerr (void) |
void | error (const std::string &msg) |
void | error (const std::string &who, const std::string &msg) |
oct_mach_info::float_format | float_format (void) const |
int | mode (void) const |
Private Member Functions | |
octave_base_stream (const octave_base_stream &) | |
std::string | do_gets (octave_idx_type max_len, bool &err, bool strip_newline, const std::string &who) |
bool | do_oscanf (const scanf_format_elt *elt, octave_value &, const std::string &who) |
int | do_printf (printf_format_list &fmt_list, const octave_value_list &args, const std::string &who) |
octave_value | do_scanf (scanf_format_list &fmt_list, octave_idx_type nr, octave_idx_type nc, bool one_elt_size_spec, octave_idx_type &count, const std::string &who) |
int | flush (void) |
std::string | getl (octave_idx_type max_len, bool &err, const std::string &who) |
std::string | gets (octave_idx_type max_len, bool &err, const std::string &who) |
void | invalid_operation (const std::string &who, const char *rw) |
octave_base_stream & | operator= (const octave_base_stream &) |
octave_value_list | oscanf (const std::string &fmt, const std::string &who) |
int | printf (const std::string &fmt, const octave_value_list &args, const std::string &who) |
int | puts (const std::string &s, const std::string &who) |
octave_value | scanf (const std::string &fmt, const Array< double > &size, octave_idx_type &count, const std::string &who) |
off_t | skipl (off_t count, bool &err, const std::string &who) |
Private Attributes | |
octave_refcount< octave_idx_type > | count |
std::string | errmsg |
bool | fail |
oct_mach_info::float_format | flt_fmt |
int | md |
bool | open_state |
Friends | |
class | octave_stream |
Definition at line 328 of file oct-stream.h.
|
inline |
Definition at line 336 of file oct-stream.h.
|
inlinevirtual |
Definition at line 343 of file oct-stream.h.
|
private |
Reimplemented in octave_ostrstream, octave_istrstream, octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >, and octave_base_strstream.
Definition at line 896 of file oct-stream.cc.
Referenced by error(), and octave_stream::stream_ok().
Definition at line 903 of file oct-stream.cc.
References input_stream(), and output_stream().
Referenced by octave_stream::clearerr().
Definition at line 382 of file oct-stream.h.
References octave_stream::is_open().
Referenced by octave_stream::close().
Reimplemented in octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >, and octave_fstream.
Definition at line 380 of file oct-stream.h.
|
private |
Definition at line 919 of file oct-stream.cc.
References error(), file_number(), forced_interactive, input_stream(), interactive, and invalid_operation().
Referenced by do_oscanf(), do_scanf(), getl(), and gets().
|
private |
Definition at line 1906 of file oct-stream.cc.
References BEGIN_C_CONVERSION, BEGIN_CHAR_CLASS_CONVERSION, BEGIN_S_CONVERSION, scanf_format_elt::discard, do_gets(), DO_LITERAL_CONVERSION, DO_PCT_CONVERSION, DO_WHITESPACE_CONVERSION, error(), input_stream(), interactive, scanf_format_elt::literal_conversion, name(), OCTAVE_SCAN, ok(), scanf_format_elt::text, scanf_format_elt::type, and scanf_format_elt::whitespace_conversion.
Referenced by oscanf().
|
private |
Definition at line 2383 of file oct-stream.cc.
References printf_format_elt::args, DO_DOUBLE_CONV, do_printf_conv(), printf_value_cache::double_value(), error(), error_state, printf_value_cache::exhausted(), printf_format_list::first(), printf_format_elt::flags, printf_format_elt::fw, printf_value_cache::int_value(), invalid_operation(), lo_ieee_is_NA, lo_ieee_isnan, printf_format_list::next(), printf_format_list::num_conversions(), output_stream(), printf_format_elt::prec, printf_value_cache::string_value(), printf_format_elt::text, printf_format_elt::type, and xisinf().
Referenced by printf().
|
private |
Definition at line 1480 of file oct-stream.cc.
References scanf_format_list::all_character_conversions(), BEGIN_C_CONVERSION, BEGIN_CHAR_CLASS_CONVERSION, BEGIN_S_CONVERSION, octave_value::convert_to_str(), scanf_format_elt::discard, do_gets(), DO_LITERAL_CONVERSION, DO_PCT_CONVERSION, do_scanf_conv(), DO_WHITESPACE_CONVERSION, error(), file_number(), FINISH_CHARACTER_CONVERSION, scanf_format_list::first(), forced_interactive, Array< T >::fortran_vec(), input_stream(), interactive, scanf_format_list::length(), scanf_format_elt::literal_conversion, scanf_format_elt::modifier, name(), scanf_format_list::next(), scanf_format_list::num_conversions(), ok(), panic_impossible, Matrix::resize(), scanf_format_elt::text, scanf_format_elt::type, and scanf_format_elt::whitespace_conversion.
Referenced by scanf().
Implemented in octave_ostrstream, octave_ostream, octave_istrstream, octave_istream, octave_fstream, octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >, and octave_base_iostream.
Referenced by octave_stream::eof().
Definition at line 2610 of file oct-stream.cc.
References clear(), errmsg, and fail.
Referenced by do_gets(), do_oscanf(), do_printf(), do_scanf(), octave_stream::error(), octave_base_iostream::invalid_operation(), invalid_operation(), octave_fstream::octave_fstream(), oscanf(), printf(), puts(), scanf(), octave_base_strstream::seek(), octave_fstream::seek(), skipl(), octave_base_strstream::tell(), and octave_fstream::tell().
|
protected |
Definition at line 882 of file oct-stream.cc.
|
protected |
Definition at line 889 of file oct-stream.cc.
Reimplemented in octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, and octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >.
Definition at line 391 of file oct-stream.h.
References octave_stream::name().
Referenced by do_gets(), do_scanf(), octave_stream::file_number(), and skipl().
|
inlineprotected |
Definition at line 415 of file oct-stream.h.
Referenced by octave_stream::float_format().
Definition at line 2134 of file oct-stream.cc.
References invalid_operation(), and output_stream().
Referenced by octave_stream::flush().
|
private |
Definition at line 1022 of file oct-stream.cc.
References do_gets().
Referenced by octave_stream::getl().
|
private |
Definition at line 1029 of file oct-stream.cc.
References do_gets().
Referenced by octave_stream::gets().
|
inlinevirtual |
Reimplemented in octave_ostrstream, octave_ostream, octave_istrstream, octave_istream, octave_fstream, octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, and octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >.
Definition at line 368 of file oct-stream.h.
Referenced by clearerr(), do_gets(), do_oscanf(), do_scanf(), octave_stream::input_stream(), oscanf(), scanf(), and skipl().
Definition at line 2623 of file oct-stream.cc.
References error().
Referenced by do_gets(), do_printf(), flush(), octave_stream::invalid_operation(), oscanf(), puts(), scanf(), and skipl().
Definition at line 378 of file oct-stream.h.
Referenced by octave_stream::is_open().
Definition at line 413 of file oct-stream.h.
Referenced by octave_fstream::input_stream(), octave_stream::mode(), and octave_fstream::output_stream().
|
pure virtual |
Implemented in octave_fstream, octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >, octave_base_iostream, and octave_base_strstream.
Referenced by do_oscanf(), do_scanf(), and octave_stream::name().
Definition at line 405 of file oct-stream.h.
Referenced by do_oscanf(), do_scanf(), octave_stream::ok(), and oscanf().
|
private |
|
private |
Definition at line 2055 of file oct-stream.cc.
References do_oscanf(), error(), scanf_format_list::first(), input_stream(), invalid_operation(), octave_value::is_defined(), scanf_format_list::length(), scanf_format_list::next(), scanf_format_list::num_conversions(), ok(), and octave_value_list::resize().
Referenced by octave_stream::oscanf().
|
inlinevirtual |
Reimplemented in octave_ostrstream, octave_ostream, octave_istrstream, octave_istream, octave_fstream, octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, and octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >.
Definition at line 374 of file oct-stream.h.
Referenced by clearerr(), do_printf(), flush(), octave_stream::output_stream(), and puts().
|
private |
Definition at line 2553 of file oct-stream.cc.
References do_printf(), error(), and printf_format_list::num_conversions().
Referenced by octave_stream::printf().
|
private |
Definition at line 2570 of file oct-stream.cc.
References error(), invalid_operation(), and output_stream().
Referenced by octave_stream::puts().
|
private |
Definition at line 1869 of file oct-stream.cc.
References do_scanf(), error(), error_state, get_size(), input_stream(), invalid_operation(), and scanf_format_list::num_conversions().
Referenced by octave_stream::scanf().
Implemented in octave_fstream, octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >, octave_base_iostream, and octave_base_strstream.
Referenced by octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >::seek(), and octave_stream::seek().
|
private |
Definition at line 1036 of file oct-stream.cc.
References count, error(), file_number(), forced_interactive, input_stream(), interactive, and invalid_operation().
Referenced by octave_stream::skipl().
|
pure virtual |
Implemented in octave_istrstream, octave_fstream, octave_tstdiostream< BUF_T, STREAM_T, FILE_T >, octave_tstdiostream< c_file_ptr_buf, io_c_file_ptr_stream, FILE * >, octave_tstdiostream< c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile >, octave_base_iostream, and octave_base_strstream.
Referenced by octave_stream::seek(), and octave_stream::tell().
|
friend |
Definition at line 332 of file oct-stream.h.
Referenced by octave_iprocstream::create(), octave_fstream::create(), octave_oprocstream::create(), octave_istream::create(), octave_istrstream::create(), octave_ostream::create(), and octave_ostrstream::create().
|
private |
Definition at line 433 of file oct-stream.h.
Referenced by octave_stream::octave_stream(), octave_stream::operator=(), skipl(), and octave_stream::~octave_stream().
|
private |
Definition at line 449 of file oct-stream.h.
|
private |
Definition at line 443 of file oct-stream.h.
|
private |
Definition at line 440 of file oct-stream.h.
|
private |
Definition at line 437 of file oct-stream.h.
|
private |
Definition at line 446 of file oct-stream.h.