GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
strfind.cc File Reference
#include <algorithm>
#include <deque>
#include <limits>
#include <string>
#include "oct-locbuf.h"
#include "Cell.h"
#include "builtin-defun-decls.h"
#include "defun.h"
#include "errwarn.h"
#include "error.h"
#include "ov.h"
#include "unwind-prot.h"
#include "utils.h"
Include dependency graph for strfind.cc:

Go to the source code of this file.

Macros

#define ORD(ch)   static_cast<unsigned char>(ch)
 
#define TABSIZE   (std::numeric_limits<unsigned char>::max () + 1)
 

Functions

OCTAVE_EXPORT octave_value_list Fstrfind (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fstrrep (const octave_value_list &args, int)
 
static void qs_preprocess (const Array< char > &needle, octave_idx_type *table)
 
static Array< char > qs_replace (const Array< char > &str, const Array< char > &pat, const Array< char > &rep, const octave_idx_type *table, bool overlaps=true)
 
static Array< octave_idx_typeqs_search (const Array< char > &needle, const Array< char > &haystack, const octave_idx_type *table, bool overlaps=true)
 

Macro Definition Documentation

◆ ORD

#define ORD (   ch)    static_cast<unsigned char>(ch)

Definition at line 48 of file strfind.cc.

◆ TABSIZE

#define TABSIZE   (std::numeric_limits<unsigned char>::max () + 1)

Definition at line 49 of file strfind.cc.

Function Documentation

◆ Fstrfind()

◆ Fstrrep()

◆ qs_preprocess()

static void qs_preprocess ( const Array< char > &  needle,
octave_idx_type table 
)
static

Definition at line 54 of file strfind.cc.

References Array< T >::data(), m, Array< T >::numel(), ORD, TABSIZE, and x.

Referenced by Fstrfind(), and Fstrrep().

◆ qs_replace()

static Array<char> qs_replace ( const Array< char > &  str,
const Array< char > &  pat,
const Array< char > &  rep,
const octave_idx_type table,
bool  overlaps = true 
)
static

◆ qs_search()

static Array<octave_idx_type> qs_search ( const Array< char > &  needle,
const Array< char > &  haystack,
const octave_idx_type table,
bool  overlaps = true 
)
static

Definition at line 67 of file strfind.cc.

References Array< T >::data(), m, min(), n, Array< T >::numel(), ORD, x, and Array< T >::xelem().

Referenced by Fstrfind(), and qs_replace().