23 #if ! defined (octave_oct_stream_h) 24 #define octave_oct_stream_h 1 26 #include "octave-config.h" 36 template <
typename T>
class Array;
53 class scanf_format_elt;
54 class scanf_format_list;
56 class printf_format_elt;
57 class printf_format_list;
69 base_stream (std::ios::openmode arg_md = std::ios::in | std::ios::out,
71 : count (0), md (arg_md),
flt_fmt (ff), fail (
false), open_state (true),
88 virtual int seek (off_t offset,
int origin) = 0;
92 virtual off_t tell (
void) = 0;
96 virtual bool eof (
void)
const = 0;
116 bool is_open (
void)
const {
return open_state; }
133 if (
name () ==
"stdin")
135 else if (
name () ==
"stdout")
137 else if (
name () ==
"stderr")
143 bool ok (
void)
const {
return ! fail; }
151 int mode (
void)
const {
return md; }
166 void clearerr (
void);
225 int nsa,
int sa_1,
int sa_2,
240 void invalid_operation (
const std::string& who,
const char *rw);
273 int seek (off_t offset,
int origin);
280 bool is_open (
void)
const;
295 bool write_bytes (
const void *data,
size_t n_elts);
297 bool skip_bytes (
size_t n_elts);
299 template <
typename T>
330 bool eof (
void)
const;
337 return error (clear, err_num);
352 bool is_valid (
void)
const {
return (rep !=
nullptr); }
354 bool ok (
void)
const {
return rep && rep->ok (); }
356 operator bool ()
const {
return ok (); }
360 int mode (
void)
const;
368 return rep ? rep->input_stream () :
nullptr;
373 return rep ? rep->output_stream () :
nullptr;
376 void clearerr (
void) {
if (rep) rep->clearerr (); }
405 finalize_read (std::list<void *>& input_buf_list,
435 void clear (
bool flush =
true);
464 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS) 466 OCTAVE_DEPRECATED (4.4,
"use 'octave::base_stream' instead")
467 typedef
octave::base_stream octave_base_stream;
470 typedef
octave::stream octave_stream;
473 typedef
octave::stream_list octave_stream_list;
bool stream_ok(bool clear=true) const
void error(const std::string &msg)
identity matrix If supplied two scalar respectively For allows like xample val
Return the CPU time used by your Octave session The first output is the total time spent executing your process and is equal to the sum of second and third which are the number of CPU seconds spent executing in user mode and the number of CPU seconds spent executing in system mode
printf("%s\, nthargout(2, "system", "cmd"))
void error(const char *fmt,...)
void invalid_operation(const std::string &who, const char *rw)
octave::mach_info::float_format flt_fmt
octave_idx_type lookup(const T *x, octave_idx_type n, T y)
refcount< octave_idx_type > count
std::string error(bool clear=false)
std::istream * input_stream(void)
std::ostream * output_stream(void)
mach_info::float_format flt_fmt
nd deftypefn *std::string name
virtual int file_number(void) const
bool is_valid(void) const
void error(const char *msg)
mach_info::float_format float_format(void) const
float_format native_float_format(void)
void invalid_operation(const std::string &who, const char *rw)
virtual void do_close(void)
virtual std::istream * input_stream(void)
N Dimensional Array with copy-on-write semantics.
virtual std::ostream * output_stream(void)
base_stream(std::ios::openmode arg_md=std::ios::in|std::ios::out, mach_info::float_format ff=mach_info::native_float_format())
ostrl_map::const_iterator lookup_cache
OCTAVE_EXPORT octave_value_list only variables visible in the local scope are displayed The following are valid options
OCTAVE_EXPORT octave_value_list error nd deftypefn *const octave_scalar_map err
std::map< int, stream > ostrl_map
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string