Octave string utility functions. More...
Functions | |
template<typename T > | |
bool | strcmp (const T &str_a, const T &str_b) |
True if strings are the same. More... | |
template<typename T > | |
bool | strcmp (const T &str_a, const typename T::value_type *str_b) |
True if string is the same as character sequence. More... | |
template<typename T > | |
bool | strcmpi (const T &str_a, const T &str_b) |
True if strings are the same, ignoring case. More... | |
template<typename T > | |
bool | strcmpi (const T &str_a, const typename T::value_type *str_b) |
True if string is the same as character sequence, ignoring case. More... | |
template<typename T > | |
bool | strncmp (const T &str_a, const T &str_b, const typename T::size_type n) |
True if the first N characters are the same. More... | |
template<typename T > | |
bool | strncmp (const T &str_a, const typename T::value_type *str_b, const typename T::size_type n) |
True if the first N characters are the same. More... | |
template<typename T > | |
bool | strncmpi (const T &str_a, const T &str_b, const typename T::size_type n) |
True if the first N characters are the same, ignoring case. More... | |
template<typename T > | |
bool | strncmpi (const T &str_a, const typename T::value_type *str_b, const typename T::size_type n) |
True if the first N characters are the same, ignoring case. More... | |
Octave string utility functions.
This functions provide a C++ interface to most string functions available in the Octave interpreter.
Specializations for Array may consider its dimensions in addition to the actual string contents.
bool octave::string::strcmp | ( | const T & | str_a, |
const T & | str_b | ||
) |
True if strings are the same.
When comparing whole Array of chars, the actual Array dimensions are significant. A column vector and row vector with the same char array, will still return false.
Definition at line 112 of file oct-string.cc.
References numel(), and sizes_cmp().
Referenced by mxArray_struct::get_field_number(), mxArray_base::is_class(), main(), mexGetVariable(), mexPutVariable(), octave_get_sig_number(), octave::bp_table::parse_dbfunction_params(), and verror().
bool octave::string::strcmp | ( | const T & | str_a, |
const typename T::value_type * | str_b | ||
) |
True if string is the same as character sequence.
Compares a string to the null-terminated character sequence beginning at the character pointed to by str_b.
For purposes of comparison of dimensions, the character sequence is considered to be a row vector.
Definition at line 120 of file oct-string.cc.
References numel(), and sizes_cmp().
bool octave::string::strcmpi | ( | const T & | str_a, |
const T & | str_b | ||
) |
True if strings are the same, ignoring case.
When comparing whole Array of chars, the actual Array dimensions are significant. A column vector and row vector with the same char array, will still return false.
Definition at line 129 of file oct-string.cc.
References numel(), and sizes_cmp().
Referenced by Feig(), QtHandles::Utils::fromHVAlign(), and Gchol().
bool octave::string::strcmpi | ( | const T & | str_a, |
const typename T::value_type * | str_b | ||
) |
True if string is the same as character sequence, ignoring case.
For purposes of comparison of dimensions, the character sequence is considered to be a row vector.
Definition at line 137 of file oct-string.cc.
References numel(), and sizes_cmp().
bool octave::string::strncmp | ( | const T & | str_a, |
const T & | str_b, | ||
const typename T::size_type | n | ||
) |
True if the first N characters are the same.
The comparison is done in the first N characters, the actual dimensions of the Array are irrelevant. A row vector and a column vector of the same still return true.
Definition at line 146 of file oct-string.cc.
References numel().
Referenced by almost_match(), octave::textscan::lookahead(), read_binary_file_header(), octave::textscan::scan_complex(), and octave::textscan::skip_whitespace().
bool octave::string::strncmp | ( | const T & | str_a, |
const typename T::value_type * | str_b, | ||
const typename T::size_type | n | ||
) |
True if the first N characters are the same.
Definition at line 155 of file oct-string.cc.
References numel().
bool octave::string::strncmpi | ( | const T & | str_a, |
const T & | str_b, | ||
const typename T::size_type | n | ||
) |
True if the first N characters are the same, ignoring case.
The comparison is done in the first N characters, the actual dimensions of the Array are irrelevant. A row vector and a column vector of the same still return true.
Definition at line 165 of file oct-string.cc.
References numel().
Referenced by get_mapper_fun_options().
bool octave::string::strncmpi | ( | const T & | str_a, |
const typename T::value_type * | str_b, | ||
const typename T::size_type | n | ||
) |
True if the first N characters are the same, ignoring case.
Definition at line 174 of file oct-string.cc.
References numel().