GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
oct-string.cc File Reference
#include "oct-string.h"
#include <algorithm>
#include <cctype>
#include <cstring>
#include <iomanip>
#include <string>
#include "Array.h"
#include "lo-ieee.h"
#include "lo-mappers.h"
#include "uniconv-wrappers.h"
#include "unistr-wrappers.h"
#include "unwind-prot.h"
Include dependency graph for oct-string.cc:

Go to the source code of this file.

Macros

#define INSTANTIATE_OCTAVE_STRING(T)
 

Functions

static std::istringstream & extract_num (std::istringstream &is, double &num, bool &imag, bool &have_sign)
 
static bool is_imag_unit (int c)
 
template<>
octave_idx_type numel (const Array< char > &str)
 
template<typename T >
T::size_type numel (const T &str)
 
template bool octave::string::strcmp< std::string > (const std::string &, const std::string &)
 
template bool octave::string::strcmp< std::string > (const std::string &, const typename std::string ::value_type *)
 
template bool octave::string::strcmpi< std::string > (const std::string &, const std::string &)
 
template bool octave::string::strcmpi< std::string > (const std::string &, const typename std::string ::value_type *)
 
template bool octave::string::strncmp< std::string > (const std::string &, const std::string &, const typename std::string ::size_type)
 
template bool octave::string::strncmp< std::string > (const std::string &, const typename std::string ::value_type *, const typename std::string ::size_type)
 
template bool octave::string::strncmpi< std::string > (const std::string &, const std::string &, const typename std::string ::size_type n)
 
template bool octave::string::strncmpi< std::string > (const std::string &, const typename std::string ::value_type *, const typename std::string ::size_type)
 
template<typename T >
std::string rational_approx (T val, int len)
 
template std::string rational_approx< double > (double val, int len)
 
template std::string rational_approx< float > (float val, int len)
 
static void set_component (Complex &c, double num, bool imag)
 
static double single_num (std::istringstream &is)
 
template<>
bool sizes_cmp (const Array< char > &str_a, const Array< char > &str_b)
 
template<>
bool sizes_cmp (const Array< char > &str_a, const char *str_b)
 
template<typename T >
bool sizes_cmp (const T &str_a, const T &str_b)
 
template<typename T >
bool sizes_cmp (const T &str_a, const typename T::value_type *str_b)
 
template<typename T >
static bool str_data_cmp (const typename T::value_type *a, const typename T::value_type *b, const typename T::size_type n)
 
template<typename T >
static bool str_data_cmpi (const typename T::value_type *a, const typename T::value_type *b, const typename T::size_type n)
 
template<typename T >
T::size_type strlen (const typename T::value_type *str)
 

Macro Definition Documentation

◆ INSTANTIATE_OCTAVE_STRING

#define INSTANTIATE_OCTAVE_STRING (   T)
Value:
template bool octave::string::strcmp<T> (const T&, const T&); \
template bool octave::string::strcmp<T> (const T&, \
const typename T::value_type*); \
template bool octave::string::strcmpi<T> (const T&, const T&); \
template bool octave::string::strcmpi<T> (const T&, \
const typename T::value_type*); \
template bool octave::string::strncmp<T> (const T&, const T&, \
const typename T::size_type); \
template bool octave::string::strncmp<T> (const T&, \
const typename T::value_type*, \
const typename T::size_type); \
template bool octave::string::strncmpi<T> (const T&, const T&, \
const typename T::size_type n); \
template bool octave::string::strncmpi<T> (const T&, \
const typename T::value_type*, \
const typename T::size_type);
octave_idx_type n
Definition: mx-inlines.cc:753

Definition at line 213 of file oct-string.cc.

Function Documentation

◆ extract_num()

static std::istringstream& extract_num ( std::istringstream &  is,
double &  num,
bool &  imag,
bool &  have_sign 
)
static

Definition at line 299 of file oct-string.cc.

References imag(), is_imag_unit(), and single_num().

Referenced by octave::string::str2double().

◆ is_imag_unit()

static bool is_imag_unit ( int  c)
inlinestatic

Definition at line 239 of file oct-string.cc.

Referenced by extract_num().

◆ numel() [1/2]

template<>
octave_idx_type numel ( const Array< char > &  str)

Definition at line 78 of file oct-string.cc.

References Array< T >::numel().

◆ numel() [2/2]

template<typename T >
T::size_type numel ( const T &  str)

Definition at line 71 of file oct-string.cc.

Referenced by intNDArray< T >::abs(), all_scalar_1x1(), intNDArray< T >::any_element_not_one_or_zero(), Array< T >::as_column(), dim_vector::as_column(), octave_uint64_matrix::as_mxArray(), Array< T >::as_row(), dim_vector::as_row(), Array< T >::assign(), Sparse< T >::assign(), octave_uint64_matrix::bool_array_value(), octave_lazy_index::byte_size(), Array< T >::byte_size(), MArray< double >::changesign(), octave_bool_matrix::char_array_value(), octave_uint64_matrix::char_array_value(), Sparse< T >::checkelem(), Range::cols(), Range::columns(), octave::textscan_format_list::current(), Array< T >::delete_elements(), Sparse< T >::delete_elements(), Array< T >::diag(), octave::do_simple_cellfun(), string_vector::empty(), Fbitshift(), Fgmtime(), Array< T >::fill(), Array< T >::find(), octave_base_diag< DMT, MT >::float_value(), Flocaltime(), Fquit(), MArray< T >::idx_add(), MArray< T >::idx_min(), img_float2uint(), ind2sub(), Sparse< T >::index(), Array< T >::index(), octave_base_diag< DMT, MT >::is_true(), Array< T >::isempty(), DiagArray2< T >::isempty(), Range::isempty(), Array< T >::issorted(), octave_map::length(), Array< T >::lookup(), Array< T >::map(), string_vector::max_length(), octave::textscan_format_list::next(), octave_lazy_index::nnz(), Array< T >::nnz(), Array< T >::nth_element(), intNDArray< T >::operator!(), Array< T >::resize1(), intNDArray< T >::signum(), octave::string::strcmp(), octave::string::strcmpi(), octave::string::strncmp(), octave::string::strncmpi(), Array< T >::test(), octave::jit_operation::to_idx(), and octave::set_path_model::update_data().

◆ octave::string::strcmp< std::string >() [1/2]

template bool octave::string::strcmp< std::string > ( const std::string &  ,
const std::string &   
)

◆ octave::string::strcmp< std::string >() [2/2]

template bool octave::string::strcmp< std::string > ( const std::string &  ,
const typename std::string ::value_type *   
)

◆ octave::string::strcmpi< std::string >() [1/2]

template bool octave::string::strcmpi< std::string > ( const std::string &  ,
const std::string &   
)

◆ octave::string::strcmpi< std::string >() [2/2]

template bool octave::string::strcmpi< std::string > ( const std::string &  ,
const typename std::string ::value_type *   
)

◆ octave::string::strncmp< std::string >() [1/2]

template bool octave::string::strncmp< std::string > ( const std::string &  ,
const std::string &  ,
const typename std::string ::size_type   
)

◆ octave::string::strncmp< std::string >() [2/2]

template bool octave::string::strncmp< std::string > ( const std::string &  ,
const typename std::string ::value_type *  ,
const typename std::string ::size_type   
)

◆ octave::string::strncmpi< std::string >() [1/2]

template bool octave::string::strncmpi< std::string > ( const std::string &  ,
const std::string &  ,
const typename std::string ::size_type  n 
)

◆ octave::string::strncmpi< std::string >() [2/2]

template bool octave::string::strncmpi< std::string > ( const std::string &  ,
const typename std::string ::value_type *  ,
const typename std::string ::size_type   
)

◆ rational_approx()

template<typename T >
std::string rational_approx ( val,
int  len 
)

◆ rational_approx< double >()

template std::string rational_approx< double > ( double  val,
int  len 
)

◆ rational_approx< float >()

template std::string rational_approx< float > ( float  val,
int  len 
)

◆ set_component()

static void set_component ( Complex c,
double  num,
bool  imag 
)
inlinestatic

Definition at line 439 of file oct-string.cc.

References imag().

Referenced by octave::string::str2double().

◆ single_num()

static double single_num ( std::istringstream &  is)
static

Definition at line 243 of file oct-string.cc.

References Inf, NaN, and octave_NA.

Referenced by extract_num().

◆ sizes_cmp() [1/4]

template<>
bool sizes_cmp ( const Array< char > &  str_a,
const Array< char > &  str_b 
)

Definition at line 99 of file oct-string.cc.

References Array< T >::dims().

◆ sizes_cmp() [2/4]

template<>
bool sizes_cmp ( const Array< char > &  str_a,
const char *  str_b 
)

◆ sizes_cmp() [3/4]

template<typename T >
bool sizes_cmp ( const T &  str_a,
const T &  str_b 
)

Definition at line 92 of file oct-string.cc.

Referenced by octave::string::strcmp(), and octave::string::strcmpi().

◆ sizes_cmp() [4/4]

template<typename T >
bool sizes_cmp ( const T &  str_a,
const typename T::value_type *  str_b 
)

Definition at line 106 of file oct-string.cc.

◆ str_data_cmp()

template<typename T >
static bool str_data_cmp ( const typename T::value_type *  a,
const typename T::value_type *  b,
const typename T::size_type  n 
)
static

Definition at line 47 of file oct-string.cc.

References n.

◆ str_data_cmpi()

template<typename T >
static bool str_data_cmpi ( const typename T::value_type *  a,
const typename T::value_type *  b,
const typename T::size_type  n 
)
static

Definition at line 58 of file oct-string.cc.

References n.

◆ strlen()