GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave::textscan Class Reference
Collaboration diagram for octave::textscan:

Public Member Functions

 textscan (const std::string &who_arg="textscan")
 
 textscan (const textscan &)=delete
 
 ~textscan (void)=default
 
textscanoperator= (const textscan &)=delete
 
octave_value scan (std::istream &isp, const std::string &fmt, octave_idx_type ntimes, const octave_value_list &options, octave_idx_type &read_count)
 

Private Member Functions

octave_value do_scan (std::istream &isp, textscan_format_list &fmt_list, octave_idx_type ntimes)
 
bool is_delim (unsigned char ch) const
 
bool isspace (unsigned int ch) const
 
int lookahead (delimited_stream &is, const Cell &targets, int max_len, bool case_sensitive=true) const
 
bool match_literal (delimited_stream &isp, const textscan_format_elt &elem)
 
void parse_options (const octave_value_list &args, textscan_format_list &fmt_list)
 
double read_double (delimited_stream &is, const textscan_format_elt &fmt) const
 
int read_format_once (delimited_stream &isp, textscan_format_list &fmt_list, std::list< octave_value > &retval, Array< octave_idx_type > row, int &done_after)
 
std::string read_until (delimited_stream &is, const Cell &delimiters, const std::string &ends) const
 
int scan_bracket (delimited_stream &is, const std::string &pattern, std::string &val) const
 
int scan_caret (delimited_stream &is, const std::string &pattern, std::string &val) const
 
void scan_complex (delimited_stream &is, const textscan_format_elt &fmt, Complex &val) const
 
void scan_cstring (delimited_stream &is, const textscan_format_elt &fmt, std::string &val) const
 
void scan_one (delimited_stream &is, const textscan_format_elt &fmt, octave_value &ov, Array< octave_idx_type > row)
 
void scan_qstring (delimited_stream &is, const textscan_format_elt &fmt, std::string &val)
 
void scan_string (delimited_stream &is, const textscan_format_elt &fmt, std::string &val) const
 
int skip_delim (delimited_stream &is)
 
int skip_whitespace (delimited_stream &is, bool EOLstop=false)
 
bool whitespace_delim (void) const
 

Private Attributes

std::string buf
 
octave_idx_type buffer_size
 
bool collect_output
 
int comment_char
 
int comment_len
 
Cell comment_style
 
std::string date_locale
 
bool default_exp
 
int delim_len
 
Cell delim_list
 
std::string delim_table
 
std::string delims
 
octave_value empty_value
 
short eol1
 
short eol2
 
std::string exp_chars
 
int header_lines
 
Cell inf_nan
 
octave_idx_type lines
 
bool multiple_delims_as_one
 
short return_on_error
 
Cell treat_as_empty
 
int treat_as_empty_len
 
std::string whitespace
 
std::string whitespace_table
 
std::string who
 

Friends

class textscan_format_list
 

Detailed Description

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

Constructor & Destructor Documentation

◆ textscan() [1/2]

octave::textscan::textscan ( const std::string who_arg = "textscan")

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

◆ textscan() [2/2]

octave::textscan::textscan ( const textscan )
delete

◆ ~textscan()

octave::textscan::~textscan ( void  )
default

Member Function Documentation

◆ do_scan()

◆ is_delim()

bool octave::textscan::is_delim ( unsigned char  ch) const
inlineprivate

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

Referenced by read_format_once(), scan_string(), and skip_delim().

◆ isspace()

bool octave::textscan::isspace ( unsigned int  ch) const
inlineprivate

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

Referenced by parse_options(), skip_delim(), and skip_whitespace().

◆ lookahead()

int octave::textscan::lookahead ( delimited_stream is,
const Cell targets,
int  max_len,
bool  case_sensitive = true 
) const
private

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

References i, is, Array< T >::numel(), s, string, octave::string::strncmp(), and tmp.

Referenced by read_double(), read_format_once(), and skip_delim().

◆ match_literal()

bool octave::textscan::match_literal ( delimited_stream isp,
const textscan_format_elt elem 
)
private

◆ operator=()

textscan& octave::textscan::operator= ( const textscan )
delete

◆ parse_options()

◆ read_double()

double octave::textscan::read_double ( delimited_stream is,
const textscan_format_elt fmt 
) const
private

◆ read_format_once()

◆ read_until()

std::string octave::textscan::read_until ( delimited_stream is,
const Cell delimiters,
const std::string ends 
) const
private

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

References done, eol1, eol2, i, is, octave_value::length(), next, Array< T >::numel(), retval, scan_caret(), start, and string.

Referenced by scan_string().

◆ scan()

octave_value octave::textscan::scan ( std::istream &  isp,
const std::string fmt,
octave_idx_type  ntimes,
const octave_value_list options,
octave_idx_type read_count 
)

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

References do_scan(), options, parse_options(), result, and state.

Referenced by octave::base_stream::do_textscan().

◆ scan_bracket()

int octave::textscan::scan_bracket ( delimited_stream is,
const std::string pattern,
std::string val 
) const
private

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

References is, pattern(), and val.

Referenced by scan_one().

◆ scan_caret()

int octave::textscan::scan_caret ( delimited_stream is,
const std::string pattern,
std::string val 
) const
private

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

References is, pattern(), and val.

Referenced by read_until(), scan_one(), scan_qstring(), and skip_whitespace().

◆ scan_complex()

◆ scan_cstring()

void octave::textscan::scan_cstring ( delimited_stream is,
const textscan_format_elt fmt,
std::string val 
) const
private

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

References i, is, val, and octave::textscan_format_elt::width.

Referenced by scan_one().

◆ scan_one()

◆ scan_qstring()

void octave::textscan::scan_qstring ( delimited_stream is,
const textscan_format_elt fmt,
std::string val 
)
private

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

References is, scan_caret(), scan_string(), skip_whitespace(), string, and val.

Referenced by scan_one().

◆ scan_string()

void octave::textscan::scan_string ( delimited_stream is,
const textscan_format_elt fmt,
std::string val 
) const
private

◆ skip_delim()

◆ skip_whitespace()

◆ whitespace_delim()

bool octave::textscan::whitespace_delim ( void  ) const
inlineprivate

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

Friends And Related Function Documentation

◆ textscan_format_list

friend class textscan_format_list
friend

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

Member Data Documentation

◆ buf

std::string octave::textscan::buf
private

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

◆ buffer_size

octave_idx_type octave::textscan::buffer_size
private

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

Referenced by do_scan(), and parse_options().

◆ collect_output

bool octave::textscan::collect_output
private

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

Referenced by do_scan(), and parse_options().

◆ comment_char

int octave::textscan::comment_char
private

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

Referenced by parse_options(), and skip_whitespace().

◆ comment_len

int octave::textscan::comment_len
private

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

Referenced by do_scan(), parse_options(), and skip_whitespace().

◆ comment_style

Cell octave::textscan::comment_style
private

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

Referenced by parse_options(), and skip_whitespace().

◆ date_locale

std::string octave::textscan::date_locale
private

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

◆ default_exp

bool octave::textscan::default_exp
private

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

Referenced by parse_options().

◆ delim_len

int octave::textscan::delim_len
private

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

Referenced by do_scan(), parse_options(), read_format_once(), and skip_delim().

◆ delim_list

Cell octave::textscan::delim_list
private

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

Referenced by parse_options(), read_format_once(), scan_string(), and skip_delim().

◆ delim_table

std::string octave::textscan::delim_table
private

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

Referenced by do_scan(), and parse_options().

◆ delims

std::string octave::textscan::delims
private

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

Referenced by do_scan(), and parse_options().

◆ empty_value

octave_value octave::textscan::empty_value
private

◆ eol1

short octave::textscan::eol1
private

◆ eol2

short octave::textscan::eol2
private

◆ exp_chars

std::string octave::textscan::exp_chars
private

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

Referenced by parse_options(), and read_double().

◆ header_lines

int octave::textscan::header_lines
private

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

Referenced by do_scan(), and parse_options().

◆ inf_nan

Cell octave::textscan::inf_nan
private

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

Referenced by read_double().

◆ lines

octave_idx_type octave::textscan::lines
private

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

Referenced by do_scan(), skip_delim(), and skip_whitespace().

◆ multiple_delims_as_one

bool octave::textscan::multiple_delims_as_one
private

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

Referenced by do_scan(), parse_options(), and skip_delim().

◆ return_on_error

short octave::textscan::return_on_error
private

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

Referenced by do_scan(), and parse_options().

◆ treat_as_empty

Cell octave::textscan::treat_as_empty
private

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

Referenced by parse_options(), and scan_complex().

◆ treat_as_empty_len

int octave::textscan::treat_as_empty_len
private

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

Referenced by do_scan(), parse_options(), and scan_complex().

◆ whitespace

std::string octave::textscan::whitespace
private

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

Referenced by do_scan(), and parse_options().

◆ whitespace_table

std::string octave::textscan::whitespace_table
private

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

Referenced by parse_options().

◆ who

std::string octave::textscan::who
private

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

Referenced by do_scan(), parse_options(), and read_format_once().


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