Public Member Functions | |
textscan (const std::string &who_arg="textscan", const std::string &encoding="utf-8") | |
textscan (const textscan &)=delete | |
~textscan (void)=default | |
textscan & | operator= (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 |
std::string | m_encoding |
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 |
Definition at line 1786 of file oct-stream.cc.
octave::textscan::textscan | ( | const std::string & | who_arg = "textscan" , |
const std::string & | encoding = "utf-8" |
||
) |
Definition at line 2526 of file oct-stream.cc.
|
delete |
|
default |
|
private |
Definition at line 2561 of file oct-stream.cc.
References buffer_size, collect_output, comment_len, delim_len, delim_table, delims, do_cat_op(), eol1, eol2, error(), header_lines, lines, max(), min(), multiple_delims_as_one, octave::textscan_format_list::num_conversions(), octave::textscan_format_list::numel(), octave_value(), octave::textscan_format_list::out_buf(), ra_idx, octave::textscan_format_list::read_first_row(), read_format_once(), return_on_error, retval, octave::textscan_format_list::set_from_first, skip_delim(), treat_as_empty_len, whitespace, and who.
Referenced by scan().
|
inlineprivate |
Definition at line 1921 of file oct-stream.cc.
Referenced by read_format_once(), scan_string(), and skip_delim().
|
inlineprivate |
Definition at line 1927 of file oct-stream.cc.
Referenced by parse_options(), skip_delim(), and skip_whitespace().
|
private |
Definition at line 3855 of file oct-stream.cc.
References octave::delimited_stream::clear(), Array< T >::numel(), octave::delimited_stream::read(), octave::delimited_stream::seekg(), octave::string::strncmp(), and octave::delimited_stream::tellg().
Referenced by read_double(), read_format_once(), and skip_delim().
|
private |
Definition at line 3967 of file oct-stream.cc.
References octave::delimited_stream::get_undelim(), octave::delimited_stream::putback(), octave::delimited_stream::setstate(), skip_whitespace(), octave::textscan_format_elt::text, and octave::textscan_format_elt::width.
Referenced by read_format_once().
|
private |
Definition at line 3545 of file oct-stream.cc.
References buffer_size, octave_value_list::cell_value(), collect_output, comment_char, comment_len, comment_style, default_exp, delim_len, delim_list, delim_table, delims, octave::do_string_escapes(), empty_value, eol1, eol2, error(), exp_chars, octave::textscan_format_list::has_string, header_lines, isspace(), len, octave_value_list::length(), max(), multiple_delims_as_one, n, Array< T >::numel(), return_on_error, Array< T >::size(), transform(), treat_as_empty, treat_as_empty_len, whitespace, whitespace_table, and who.
Referenced by scan().
|
private |
Definition at line 2762 of file oct-stream.cc.
References octave::delimited_stream::clear(), exp_chars, octave::delimited_stream::get(), Inf, inf_nan, lookahead(), NaN, octave::delimited_stream::peek(), octave::pown(), octave::textscan_format_elt::prec, octave::delimited_stream::putback(), octave::delimited_stream::rdstate(), retval, octave::delimited_stream::setstate(), and octave::textscan_format_elt::width.
Referenced by scan_complex(), and scan_one().
|
private |
Definition at line 3421 of file oct-stream.cc.
References octave::delimited_stream::clear(), delim_len, delim_list, elem, octave::delimited_stream::eof(), error(), octave::delimited_stream::fail(), octave::textscan_format_list::first(), is_delim(), Array< T >::isempty(), octave::textscan_format_elt::literal_conversion, lookahead(), match_literal(), octave::textscan_format_list::next(), octave::textscan_format_list::numel(), octave::delimited_stream::peek(), octave::delimited_stream::rdstate(), retval, scan_one(), octave::delimited_stream::seekg(), octave::delimited_stream::setstate(), skip_delim(), octave::delimited_stream::tellg(), warning(), and who.
Referenced by do_scan().
|
private |
Definition at line 3080 of file oct-stream.cc.
References octave::delimited_stream::eof(), eol1, eol2, octave::delimited_stream::get_undelim(), octave::next, Array< T >::numel(), octave::delimited_stream::putback(), retval, and scan_caret().
Referenced by scan_string().
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 2538 of file oct-stream.cc.
References do_scan(), parse_options(), and octave::state.
|
private |
Definition at line 3177 of file oct-stream.cc.
References octave::delimited_stream::get_undelim(), and octave::delimited_stream::putback().
Referenced by scan_one().
|
private |
Definition at line 3055 of file oct-stream.cc.
References octave::delimited_stream::eof(), octave::delimited_stream::get_undelim(), and octave::delimited_stream::putback().
Referenced by read_until(), scan_one(), scan_qstring(), and skip_whitespace().
|
private |
Definition at line 2914 of file oct-stream.cc.
References octave::delimited_stream::clear(), empty_value, octave::delimited_stream::eof(), octave::delimited_stream::fail(), octave::delimited_stream::get(), Inf, octave::math::is_NaN_or_NA(), Array< T >::numel(), octave::delimited_stream::peek(), octave::delimited_stream::putback(), octave::delimited_stream::rdstate(), octave::delimited_stream::read(), read_double(), octave_value::scalar_value(), octave::delimited_stream::seekg(), octave::state, octave::string::strncmp(), octave::delimited_stream::tellg(), treat_as_empty, and treat_as_empty_len.
Referenced by octave::textscan_format_list::read_first_row(), and scan_one().
|
private |
Definition at line 3229 of file oct-stream.cc.
References octave::delimited_stream::get_undelim(), m_encoding, octave::string::u8_from_encoding(), and octave::textscan_format_elt::width.
Referenced by scan_one().
|
private |
Definition at line 3254 of file oct-stream.cc.
References octave::textscan_format_elt::bitwidth, octave::textscan_format_elt::char_class, octave::delimited_stream::clear(), octave::textscan_format_elt::discard, do_cat_op(), empty_value, octave::delimited_stream::fail(), octave_base_value::fast_elem_insert(), octave::delimited_stream::field_done(), octave_value::internal_rep(), octave_value::isreal(), octave::textscan_format_elt::numeric, octave::delimited_stream::rdstate(), read_double(), scan_bracket(), scan_caret(), scan_complex(), scan_cstring(), scan_qstring(), scan_string(), skip_whitespace(), and octave::textscan_format_elt::type.
Referenced by read_format_once().
|
private |
Definition at line 3197 of file oct-stream.cc.
References octave::delimited_stream::get(), octave::delimited_stream::get_undelim(), m_encoding, octave::delimited_stream::peek(), octave::delimited_stream::peek_undelim(), scan_caret(), scan_string(), skip_whitespace(), and octave::string::u8_from_encoding().
Referenced by scan_one().
|
private |
Definition at line 3129 of file oct-stream.cc.
References delim_list, eol1, eol2, octave::delimited_stream::get(), is_delim(), Array< T >::isempty(), m_encoding, max(), Array< T >::numel(), octave::delimited_stream::putback(), read_until(), octave::string::u8_from_encoding(), and octave::textscan_format_elt::width.
Referenced by scan_one(), and scan_qstring().
|
private |
Definition at line 3893 of file oct-stream.cc.
References delim_len, delim_list, eol1, eol2, octave::delimited_stream::get(), octave::delimited_stream::get_undelim(), is_delim(), isspace(), lines, lookahead(), multiple_delims_as_one, Array< T >::numel(), octave::delimited_stream::peek_undelim(), octave::delimited_stream::putback(), and skip_whitespace().
Referenced by do_scan(), octave::textscan_format_list::read_first_row(), and read_format_once().
|
private |
Definition at line 3768 of file oct-stream.cc.
References octave::delimited_stream::clear(), comment_char, comment_len, comment_style, octave::delimited_stream::eof(), eol1, eol2, octave::delimited_stream::get_undelim(), isspace(), lines, Array< T >::numel(), octave::delimited_stream::peek_undelim(), octave::delimited_stream::putback(), octave::delimited_stream::rdstate(), octave::delimited_stream::read(), scan_caret(), octave::delimited_stream::seekg(), octave::state, octave::string::strncmp(), and octave::delimited_stream::tellg().
Referenced by match_literal(), octave::textscan_format_list::read_first_row(), scan_one(), scan_qstring(), and skip_delim().
|
inlineprivate |
Definition at line 1930 of file oct-stream.cc.
|
friend |
Definition at line 1810 of file oct-stream.cc.
|
private |
Definition at line 1817 of file oct-stream.cc.
|
private |
Definition at line 1840 of file oct-stream.cc.
Referenced by do_scan(), and parse_options().
|
private |
Definition at line 1867 of file oct-stream.cc.
Referenced by do_scan(), and parse_options().
|
private |
Definition at line 1838 of file oct-stream.cc.
Referenced by parse_options(), and skip_whitespace().
|
private |
Definition at line 1835 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), and skip_whitespace().
|
private |
Definition at line 1832 of file oct-stream.cc.
Referenced by parse_options(), and skip_whitespace().
|
private |
Definition at line 1842 of file oct-stream.cc.
|
private |
Definition at line 1869 of file oct-stream.cc.
Referenced by parse_options().
|
private |
Definition at line 1851 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), read_format_once(), and skip_delim().
|
private |
Definition at line 1848 of file oct-stream.cc.
Referenced by parse_options(), read_format_once(), scan_string(), and skip_delim().
|
private |
Definition at line 1827 of file oct-stream.cc.
Referenced by do_scan(), and parse_options().
|
private |
Definition at line 1830 of file oct-stream.cc.
Referenced by do_scan(), and parse_options().
|
private |
Definition at line 1853 of file oct-stream.cc.
Referenced by parse_options(), octave::textscan_format_list::read_first_row(), scan_complex(), and scan_one().
|
private |
Definition at line 1863 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), octave::textscan_format_list::read_first_row(), read_until(), scan_string(), skip_delim(), and skip_whitespace().
|
private |
Definition at line 1864 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), octave::textscan_format_list::read_first_row(), read_until(), scan_string(), skip_delim(), and skip_whitespace().
|
private |
Definition at line 1854 of file oct-stream.cc.
Referenced by parse_options(), and read_double().
|
private |
Definition at line 1855 of file oct-stream.cc.
Referenced by do_scan(), and parse_options().
|
private |
Definition at line 1845 of file oct-stream.cc.
Referenced by read_double().
|
private |
Definition at line 1871 of file oct-stream.cc.
Referenced by do_scan(), skip_delim(), and skip_whitespace().
|
private |
Definition at line 1815 of file oct-stream.cc.
Referenced by scan_cstring(), scan_qstring(), and scan_string().
|
private |
Definition at line 1868 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), and skip_delim().
|
private |
Definition at line 1865 of file oct-stream.cc.
Referenced by do_scan(), and parse_options().
|
private |
Definition at line 1856 of file oct-stream.cc.
Referenced by parse_options(), and scan_complex().
|
private |
Definition at line 1859 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), and scan_complex().
|
private |
Definition at line 1861 of file oct-stream.cc.
Referenced by do_scan(), and parse_options().
|
private |
Definition at line 1824 of file oct-stream.cc.
Referenced by parse_options().
|
private |
Definition at line 1813 of file oct-stream.cc.
Referenced by do_scan(), parse_options(), and read_format_once().