GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
tstdiostream< BUF_T, STREAM_T, FILE_T > Class Template Reference

#include "oct-stdstrm.h"

Inheritance diagram for tstdiostream< BUF_T, STREAM_T, FILE_T >:
Collaboration diagram for tstdiostream< BUF_T, STREAM_T, FILE_T >:

Public Member Functions

 tstdiostream (const std::string &n, FILE_T f=0, int fid=0, std::ios::openmode m=std::ios::in|std::ios::out, mach_info::float_format ff=mach_info::native_float_format(), const std::string &encoding="utf-8", typename BUF_T::close_fcn cf=BUF_T::file_close)
 
 tstdiostream (const tstdiostream &)=delete
 
bool bad (void) const
 
void clear (void)
 
void close (void)
 
void do_close (void)
 
bool eof (void) const
 
std::string error (bool clear, int &err_num)
 
int file_number (void) const
 
std::istream * input_stream (void)
 
bool is_open (void) const
 
std::string name (void) const
 
bool ok (void) const
 
tstdiostreamoperator= (const tstdiostream &)=delete
 
std::ostream * output_stream (void)
 
std::ostream * preferred_output_stream (void)
 
BUF_T * rdbuf (void) const
 
int seek (off_t offset, int origin)
 
off_t tell (void)
 

Protected Member Functions

 ~tstdiostream (void)
 
OCTINTERP_API void clearerr (void)
 
std::string encoding (void) const
 
OCTINTERP_API void error (const std::string &msg)
 
OCTINTERP_API void error (const std::string &who, const std::string &msg)
 
mach_info::float_format float_format (void) const
 
int mode (void) const
 

Protected Attributes

int m_fnum
 
std::ios::openmode m_mode
 
std::string m_name
 
STREAM_Tm_stream
 

Private Types

typedef string::deletable_facet< string::codecvt_u8 > convfacet_u8
 

Private Member Functions

OCTINTERP_API std::string do_gets (octave_idx_type max_len, bool &err, bool strip_newline, const std::string &who)
 
OCTINTERP_API int do_numeric_printf_conv (std::ostream &os, const printf_format_elt *elt, int nsa, int sa_1, int sa_2, const octave_value &val, const std::string &who)
 
OCTINTERP_API bool do_oscanf (const scanf_format_elt *elt, octave_value &, const std::string &who)
 
OCTINTERP_API int do_printf (printf_format_list &fmt_list, const octave_value_list &args, const std::string &who)
 
OCTINTERP_API 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)
 
OCTINTERP_API octave_value do_textscan (const std::string &fmt, octave_idx_type ntimes, const octave_value_list &options, const std::string &who, octave_idx_type &count)
 
OCTINTERP_API void field_width_error (const std::string &who) const
 
OCTINTERP_API int flush (void)
 
OCTINTERP_API std::string getl (octave_idx_type max_len, bool &err, const std::string &who)
 
OCTINTERP_API std::string gets (octave_idx_type max_len, bool &err, const std::string &who)
 
OCTINTERP_API void invalid_operation (const std::string &who, const char *rw)
 
OCTINTERP_API octave_value_list oscanf (const std::string &fmt, const std::string &who)
 
OCTINTERP_API int printf (const std::string &fmt, const octave_value_list &args, const std::string &who)
 
OCTINTERP_API int puts (const std::string &s, const std::string &who)
 
OCTINTERP_API octave_value scanf (const std::string &fmt, const Array< double > &size, octave_idx_type &count, const std::string &who)
 
OCTINTERP_API off_t skipl (off_t count, bool &err, const std::string &who)
 

Private Attributes

std::ostream * m_conv_ostream
 
std::string m_encoding
 
std::string m_errmsg
 
bool m_fail
 
mach_info::float_format m_flt_fmt
 
bool m_open_state
 

Detailed Description

template<typename BUF_T, typename STREAM_T, typename FILE_T>
class tstdiostream< BUF_T, STREAM_T, FILE_T >

Definition at line 39 of file oct-stdstrm.h.

Member Typedef Documentation

◆ convfacet_u8

typedef string::deletable_facet<string::codecvt_u8> base_stream::convfacet_u8
privateinherited

Definition at line 215 of file oct-stream.h.

Constructor & Destructor Documentation

◆ tstdiostream() [1/2]

template<typename BUF_T , typename STREAM_T , typename FILE_T >
tstdiostream< BUF_T, STREAM_T, FILE_T >::tstdiostream ( const std::string &  n,
FILE_T  f = 0,
int  fid = 0,
std::ios::openmode  m = std::ios::in | std::ios::out,
mach_info::float_format  ff = mach_info::native_float_format (),
const std::string &  encoding = "utf-8",
typename BUF_T::close_fcn  cf = BUF_T::file_close 
)
inline

Definition at line 44 of file oct-stdstrm.h.

◆ tstdiostream() [2/2]

template<typename BUF_T , typename STREAM_T , typename FILE_T >
tstdiostream< BUF_T, STREAM_T, FILE_T >::tstdiostream ( const tstdiostream< BUF_T, STREAM_T, FILE_T > &  )
delete

◆ ~tstdiostream()

template<typename BUF_T , typename STREAM_T , typename FILE_T >
tstdiostream< BUF_T, STREAM_T, FILE_T >::~tstdiostream ( void  )
inlineprotected

Definition at line 112 of file oct-stdstrm.h.

Member Function Documentation

◆ bad()

template<typename BUF_T , typename STREAM_T , typename FILE_T >
bool tstdiostream< BUF_T, STREAM_T, FILE_T >::bad ( void  ) const
inline

Definition at line 96 of file oct-stdstrm.h.

◆ clear()

template<typename BUF_T , typename STREAM_T , typename FILE_T >
void tstdiostream< BUF_T, STREAM_T, FILE_T >::clear ( void  )
inline

Definition at line 98 of file oct-stdstrm.h.

◆ clearerr()

void base_stream::clearerr ( void  )
protectedinherited

◆ close()

void base_stream::close ( void  )
inlineinherited

Definition at line 152 of file oct-stream.h.

References stream::is_open().

◆ do_close()

template<typename BUF_T , typename STREAM_T , typename FILE_T >
void tstdiostream< BUF_T, STREAM_T, FILE_T >::do_close ( void  )
inlinevirtual

Reimplemented from base_stream.

Definition at line 104 of file oct-stdstrm.h.

◆ do_gets()

◆ do_numeric_printf_conv()

◆ do_oscanf()

◆ do_printf()

◆ do_scanf()

◆ do_textscan()

octave_value base_stream::do_textscan ( const std::string &  fmt,
octave_idx_type  ntimes,
const octave_value_list options,
const std::string &  who,
octave_idx_type count 
)
privateinherited

◆ encoding()

std::string base_stream::encoding ( void  ) const
inlineprotectedinherited

◆ eof()

template<typename BUF_T , typename STREAM_T , typename FILE_T >
bool tstdiostream< BUF_T, STREAM_T, FILE_T >::eof ( void  ) const
inlinevirtual

Implements base_stream.

Definition at line 72 of file oct-stdstrm.h.

◆ error() [1/3]

◆ error() [2/3]

void base_stream::error ( const std::string &  msg)
protectedinherited

Definition at line 4073 of file oct-stream.cc.

References base_stream::m_errmsg, and base_stream::m_fail.

◆ error() [3/3]

void base_stream::error ( const std::string &  who,
const std::string &  msg 
)
protectedinherited

◆ field_width_error()

void base_stream::field_width_error ( const std::string &  who) const
privateinherited

Definition at line 5936 of file oct-stream.cc.

References base_stream::error(), and textscan_format_list::who.

Referenced by base_stream::do_printf().

◆ file_number()

template<typename BUF_T , typename STREAM_T , typename FILE_T >
int tstdiostream< BUF_T, STREAM_T, FILE_T >::file_number ( void  ) const
inlinevirtual

Reimplemented from base_stream.

Definition at line 94 of file oct-stdstrm.h.

◆ float_format()

mach_info::float_format base_stream::float_format ( void  ) const
inlineprotectedinherited

Definition at line 185 of file oct-stream.h.

◆ flush()

int base_stream::flush ( void  )
privateinherited

◆ getl()

std::string base_stream::getl ( octave_idx_type  max_len,
bool &  err,
const std::string &  who 
)
privateinherited

Definition at line 4214 of file oct-stream.cc.

References base_stream::do_gets(), and textscan_format_list::who.

◆ gets()

std::string base_stream::gets ( octave_idx_type  max_len,
bool &  err,
const std::string &  who 
)
privateinherited

Definition at line 4221 of file oct-stream.cc.

References base_stream::do_gets(), and textscan_format_list::who.

◆ input_stream()

template<typename BUF_T , typename STREAM_T , typename FILE_T >
std::istream* tstdiostream< BUF_T, STREAM_T, FILE_T >::input_stream ( void  )
inlinevirtual

Reimplemented from base_stream.

Definition at line 78 of file oct-stdstrm.h.

◆ invalid_operation()

void base_stream::invalid_operation ( const std::string &  who,
const char *  rw 
)
privateinherited

◆ is_open()

bool base_stream::is_open ( void  ) const
inlineinherited

Definition at line 148 of file oct-stream.h.

◆ mode()

int base_stream::mode ( void  ) const
inlineprotectedinherited

Definition at line 183 of file oct-stream.h.

Referenced by fstream::input_stream(), and fstream::output_stream().

◆ name()

template<typename BUF_T , typename STREAM_T , typename FILE_T >
std::string tstdiostream< BUF_T, STREAM_T, FILE_T >::name ( void  ) const
inlinevirtual

Implements base_stream.

Definition at line 76 of file oct-stdstrm.h.

◆ ok()

bool base_stream::ok ( void  ) const
inlineinherited

◆ operator=()

template<typename BUF_T , typename STREAM_T , typename FILE_T >
tstdiostream& tstdiostream< BUF_T, STREAM_T, FILE_T >::operator= ( const tstdiostream< BUF_T, STREAM_T, FILE_T > &  )
delete

◆ oscanf()

◆ output_stream()

template<typename BUF_T , typename STREAM_T , typename FILE_T >
std::ostream* tstdiostream< BUF_T, STREAM_T, FILE_T >::output_stream ( void  )
inlinevirtual

Reimplemented from base_stream.

Definition at line 83 of file oct-stdstrm.h.

◆ preferred_output_stream()

std::ostream* base_stream::preferred_output_stream ( void  )
inlineinherited

◆ printf()

int base_stream::printf ( const std::string &  fmt,
const octave_value_list args,
const std::string &  who 
)
privateinherited

◆ puts()

int base_stream::puts ( const std::string &  s,
const std::string &  who 
)
privateinherited

◆ rdbuf()

template<typename BUF_T , typename STREAM_T , typename FILE_T >
BUF_T* tstdiostream< BUF_T, STREAM_T, FILE_T >::rdbuf ( void  ) const
inline

Definition at line 89 of file oct-stdstrm.h.

◆ scanf()

octave_value base_stream::scanf ( const std::string &  fmt,
const Array< double > &  size,
octave_idx_type count,
const std::string &  who 
)
privateinherited

◆ seek()

template<typename BUF_T , typename STREAM_T , typename FILE_T >
int tstdiostream< BUF_T, STREAM_T, FILE_T >::seek ( off_t  offset,
int  origin 
)
inlinevirtual

Implements base_stream.

Definition at line 61 of file oct-stdstrm.h.

◆ skipl()

off_t base_stream::skipl ( off_t  count,
bool &  err,
const std::string &  who 
)
privateinherited

◆ tell()

template<typename BUF_T , typename STREAM_T , typename FILE_T >
off_t tstdiostream< BUF_T, STREAM_T, FILE_T >::tell ( void  )
inlinevirtual

Implements base_stream.

Definition at line 68 of file oct-stdstrm.h.

Member Data Documentation

◆ m_conv_ostream

std::ostream* base_stream::m_conv_ostream
privateinherited

Definition at line 225 of file oct-stream.h.

◆ m_encoding

std::string base_stream::m_encoding
privateinherited

Definition at line 212 of file oct-stream.h.

◆ m_errmsg

std::string base_stream::m_errmsg
privateinherited

Definition at line 234 of file oct-stream.h.

Referenced by base_stream::clear(), and base_stream::error().

◆ m_fail

bool base_stream::m_fail
privateinherited

Definition at line 228 of file oct-stream.h.

Referenced by base_stream::clear(), and base_stream::error().

◆ m_flt_fmt

mach_info::float_format base_stream::m_flt_fmt
privateinherited

Definition at line 209 of file oct-stream.h.

◆ m_fnum

template<typename BUF_T , typename STREAM_T , typename FILE_T >
int tstdiostream< BUF_T, STREAM_T, FILE_T >::m_fnum
protected

Definition at line 123 of file oct-stdstrm.h.

◆ m_mode

template<typename BUF_T , typename STREAM_T , typename FILE_T >
std::ios::openmode tstdiostream< BUF_T, STREAM_T, FILE_T >::m_mode
protected

Definition at line 118 of file oct-stdstrm.h.

◆ m_name

template<typename BUF_T , typename STREAM_T , typename FILE_T >
std::string tstdiostream< BUF_T, STREAM_T, FILE_T >::m_name
protected

Definition at line 116 of file oct-stdstrm.h.

◆ m_open_state

bool base_stream::m_open_state
privateinherited

Definition at line 231 of file oct-stream.h.

◆ m_stream

template<typename BUF_T , typename STREAM_T , typename FILE_T >
STREAM_T* tstdiostream< BUF_T, STREAM_T, FILE_T >::m_stream
protected

Definition at line 120 of file oct-stdstrm.h.


The documentation for this class was generated from the following file: