GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
oct-stream.cc File Reference
#include <cassert>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <deque>
#include <fstream>
#include <limits>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include "Array.h"
#include "Cell.h"
#include "byte-swap.h"
#include "lo-ieee.h"
#include "lo-mappers.h"
#include "lo-utils.h"
#include "oct-locbuf.h"
#include "octave-preserve-stream-state.h"
#include "quit.h"
#include "str-vec.h"
#include "strcase-wrappers.h"
#include "error.h"
#include "errwarn.h"
#include "input.h"
#include "interpreter-private.h"
#include "interpreter.h"
#include "octave.h"
#include "oct-iostrm.h"
#include "oct-stdstrm.h"
#include "oct-string.h"
#include "oct-stream.h"
#include "ov.h"
#include "ovl.h"
#include "pager.h"
#include "utils.h"

Go to the source code of this file.

Macros

#define BEGIN_C_CONVERSION()
 
#define BEGIN_CHAR_CLASS_CONVERSION()
 
#define BEGIN_S_CONVERSION()
 
#define DO_LITERAL_CONVERSION()
 
#define DO_PCT_CONVERSION()
 
#define DO_WHITESPACE_CONVERSION()
 
#define FILL_TABLE_ROW(T, V)
 
#define FINISH_CHARACTER_CONVERSION()
 
#define INSTANTIATE_WRITE(T)
 
#define TABLE_ELT(T, U, V, W)    conv_fptr_table[oct_data_conv::T][oct_data_conv::U] = convert_and_copy<V, W>
 

Typedefs

typedef octave_value(* conv_fptr) (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, bool swap, bool do_float_fmt_conv, bool do_NA_conv, mach_info::float_format from_flt_fmt)
 

Functions

template void do_scanf_conv (std::istream &, const scanf_format_elt &, double *, Matrix &, double *, octave_idx_type &, octave_idx_type &, octave_idx_type, octave_idx_type, bool)
 
std::string base_stream::() error (bool clear_err, int &err_num)
 
void base_stream::() error (const std::string &msg,)
 
void base_stream::() error (const std::string &who, const std::string &msg)
 
template<>
std::istream & octave_scan (std::istream &is, const scanf_format_elt &fmt, double *valptr)
 

Macro Definition Documentation

◆ BEGIN_C_CONVERSION

#define BEGIN_C_CONVERSION ( )
Value:
is.unsetf (std::ios::skipws); \
\
int width = (elt->width ? elt->width : 1); \
\
std::string tmp (width, '\0'); \
\
int c = std::istream::traits_type::eof (); \
int n = 0; \
\
while (is && n < width \
&& (c = is.get ()) != std::istream::traits_type::eof ()) \
tmp[n++] = static_cast<char> (c); \
\
if (c == std::istream::traits_type::eof ()) \
is.clear (is.rdstate () & (~std::ios::failbit)); \
\
tmp.resize (n)
octave_idx_type n
Definition: mx-inlines.cc:761

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

◆ BEGIN_CHAR_CLASS_CONVERSION

#define BEGIN_CHAR_CLASS_CONVERSION ( )

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

◆ BEGIN_S_CONVERSION

#define BEGIN_S_CONVERSION ( )

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

◆ DO_LITERAL_CONVERSION

#define DO_LITERAL_CONVERSION ( )
Value:
do \
{ \
int c = std::istream::traits_type::eof (); \
\
int n = fmt.length (); \
int i = 0; \
\
while (i < n && is \
&& (c = is.get ()) != std::istream::traits_type::eof ()) \
{ \
if (c == static_cast<unsigned char> (fmt[i])) \
{ \
i++; \
continue; \
} \
else \
{ \
is.putback (c); \
break; \
} \
} \
\
if (i != n) \
is.setstate (std::ios::failbit); \
} \
while (0)

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

◆ DO_PCT_CONVERSION

#define DO_PCT_CONVERSION ( )
Value:
do \
{ \
int c = is.get (); \
\
if (c != std::istream::traits_type::eof ()) \
{ \
if (c != '%') \
{ \
is.putback (c); \
is.setstate (std::ios::failbit); \
} \
} \
else \
is.setstate (std::ios::failbit); \
} \
while (0)

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

◆ DO_WHITESPACE_CONVERSION

#define DO_WHITESPACE_CONVERSION ( )
Value:
do \
{ \
int c = std::istream::traits_type::eof (); \
\
/* get all whitespace characters */ \
while (is && (c = is.get ()) != std::istream::traits_type::eof () \
&& isspace (c)) \
{ /* skip whitespace */ } \
\
if (c == std::istream::traits_type::eof ()) \
/* reset failbit at eof */ \
is.clear (is.rdstate () & (~std::ios::failbit)); \
else \
/* put back non-whitespace character */ \
is.putback (c); \
} \
while (0)

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

◆ FILL_TABLE_ROW

#define FILL_TABLE_ROW (   T,
  V 
)
Value:
TABLE_ELT (T, dt_int8, V, int8NDArray); \
TABLE_ELT (T, dt_uint8, V, uint8NDArray); \
TABLE_ELT (T, dt_int16, V, int16NDArray); \
TABLE_ELT (T, dt_uint16, V, uint16NDArray); \
TABLE_ELT (T, dt_int32, V, int32NDArray); \
TABLE_ELT (T, dt_uint32, V, uint32NDArray); \
TABLE_ELT (T, dt_int64, V, int64NDArray); \
TABLE_ELT (T, dt_uint64, V, uint64NDArray); \
TABLE_ELT (T, dt_single, V, FloatNDArray); \
TABLE_ELT (T, dt_double, V, NDArray); \
TABLE_ELT (T, dt_char, V, charNDArray); \
TABLE_ELT (T, dt_schar, V, charNDArray); \
TABLE_ELT (T, dt_uchar, V, charNDArray); \
TABLE_ELT (T, dt_logical, V, boolNDArray);
F77_RET_T const F77_INT const F77_INT const F77_INT const F77_DBLE const F77_DBLE F77_INT F77_DBLE * V
#define TABLE_ELT(T, U, V, W)
Definition: oct-stream.cc:6501

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

◆ FINISH_CHARACTER_CONVERSION

#define FINISH_CHARACTER_CONVERSION ( )

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

◆ INSTANTIATE_WRITE

#define INSTANTIATE_WRITE (   T)
Value:
template \
OCTINTERP_API octave_idx_type \
stream::write (const Array<T>& data, octave_idx_type block_size, \
oct_data_conv::data_type output_type, \
float_format
Definition: mach-info.h:38

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

◆ TABLE_ELT

#define TABLE_ELT (   T,
  U,
  V,
 
)     conv_fptr_table[oct_data_conv::T][oct_data_conv::U] = convert_and_copy<V, W>

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

Typedef Documentation

◆ conv_fptr

typedef octave_value(* conv_fptr) (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, bool swap, bool do_float_fmt_conv, bool do_NA_conv, mach_info::float_format from_flt_fmt)

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

Function Documentation

◆ do_scanf_conv()

template void do_scanf_conv ( std::istream &  ,
const scanf_format_elt &  ,
double *  ,
Matrix ,
double *  ,
octave_idx_type ,
octave_idx_type ,
octave_idx_type  ,
octave_idx_type  ,
bool   
)

◆ error() [1/3]

std::string base_stream::() error ( bool  clear_err,
int &  err_num 
)

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

References base_stream::clear().

◆ error() [2/3]

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

◆ error() [3/3]

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

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

◆ octave_scan()

template<>
std::istream& octave_scan ( std::istream &  is,
const scanf_format_elt &  fmt,
double *  valptr 
)

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

References panic_impossible.