GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
string_vector Class Reference

#include "str-vec.h"

Public Member Functions

 string_vector ()=default
 
 string_vector (const Array< std::string > &s)
 
 string_vector (const char *const *s)
 
 string_vector (const char *const *s, octave_idx_type n)
 
 string_vector (const char *s)
 
 string_vector (const std::string &s)
 
template<template< typename... > class String_Container, typename... Other>
 string_vector (const String_Container< std::string, Other... > &lst)
 Constructor for STL containers of std::string. More...
 
 string_vector (const string_vector &)=default
 
 string_vector (octave_idx_type n)
 
 string_vector (string_vector &&)=default
 
 ~string_vector ()=default
 
string_vectorappend (const std::string &s)
 
string_vectorappend (const string_vector &sv)
 
char ** c_str_vec () const
 
std::string & elem (octave_idx_type i)
 
std::string elem (octave_idx_type i) const
 
bool empty () const
 
bool isempty () const
 
std::string join (const std::string &sep="") const
 
string_vector linear_slice (octave_idx_type lo, octave_idx_type up) const
 
std::ostream & list_in_columns (std::ostream &, int width=0, const std::string &prefix="") const
 
template<typename U , typename F >
Array< U > map (F fcn) const
 
octave_idx_type max_length () const
 
octave_idx_type numel () const
 
std::string & operator() (octave_idx_type i)
 
std::string operator() (octave_idx_type i) const
 
string_vectoroperator= (const string_vector &)=default
 
string_vectoroperator= (string_vector &&)=default
 
std::string & operator[] (octave_idx_type i)
 
std::string operator[] (octave_idx_type i) const
 
void resize (octave_idx_type n, const std::string &rfv="")
 
string_vectorsort (bool make_uniq=false)
 
std::list< std::string > std_list () const
 
string_vectoruniq ()
 
std::string & xelem (octave_idx_type i)
 
std::string xelem (octave_idx_type i) const
 

Static Public Member Functions

static void delete_c_str_vec (const char *const *)
 

Detailed Description

Definition at line 37 of file str-vec.h.

Constructor & Destructor Documentation

◆ string_vector() [1/10]

string_vector::string_vector ( )
default

◆ string_vector() [2/10]

string_vector::string_vector ( octave_idx_type  n)
inlineexplicit

Definition at line 45 of file str-vec.h.

◆ string_vector() [3/10]

string_vector::string_vector ( const char *  s)
inline

Definition at line 47 of file str-vec.h.

◆ string_vector() [4/10]

string_vector::string_vector ( const std::string &  s)
inline

Definition at line 49 of file str-vec.h.

◆ string_vector() [5/10]

string_vector::string_vector ( const string_vector )
default

◆ string_vector() [6/10]

string_vector::string_vector ( string_vector &&  )
default

◆ string_vector() [7/10]

template<template< typename... > class String_Container, typename... Other>
string_vector::string_vector ( const String_Container< std::string, Other... > &  lst)

Constructor for STL containers of std::string.

Templated constructor for any template class with std::string as the first parameter, and begin, end, and size methods, i.e., a class with similar interface as the STL containers.

Definition at line 157 of file str-vec.h.

References elem(), and resize().

◆ string_vector() [8/10]

string_vector::string_vector ( const Array< std::string > &  s)
inline

Definition at line 64 of file str-vec.h.

◆ string_vector() [9/10]

string_vector::string_vector ( const char *const *  s)

Definition at line 47 of file str-vec.cc.

References elem(), n, and resize().

◆ string_vector() [10/10]

string_vector::string_vector ( const char *const *  s,
octave_idx_type  n 
)

Definition at line 69 of file str-vec.cc.

References elem(), and n.

◆ ~string_vector()

string_vector::~string_vector ( )
default

Member Function Documentation

◆ append() [1/2]

string_vector & string_vector::append ( const std::string &  s)

◆ append() [2/2]

string_vector & string_vector::append ( const string_vector sv)

Definition at line 122 of file str-vec.cc.

References elem(), len, numel(), and resize().

◆ c_str_vec()

char ** string_vector::c_str_vec ( ) const

Definition at line 157 of file str-vec.cc.

References len, and numel().

Referenced by execvp(), and popen2().

◆ delete_c_str_vec()

void string_vector::delete_c_str_vec ( const char *const *  v)
static

Definition at line 185 of file str-vec.cc.

Referenced by execvp(), and popen2().

◆ elem() [1/2]

std::string& string_vector::elem ( octave_idx_type  i)
inline

Definition at line 104 of file str-vec.h.

Referenced by string_vector(), append(), join(), list_in_columns(), std_list(), and uniq().

◆ elem() [2/2]

std::string string_vector::elem ( octave_idx_type  i) const
inline

Definition at line 106 of file str-vec.h.

◆ empty()

bool string_vector::empty ( ) const
inline

Definition at line 77 of file str-vec.h.

References numel().

Referenced by load_path::display(), F__methods__(), octave::Ffile_in_loadpath(), and octave::Ffile_in_path().

◆ isempty()

bool string_vector::isempty ( ) const
inline

Definition at line 102 of file str-vec.h.

Referenced by tree_index_expression::evaluate_n(), F__fieldnames__(), and Fcellstr().

◆ join()

std::string string_vector::join ( const std::string &  sep = "") const

Definition at line 137 of file str-vec.cc.

References elem(), len, and numel().

Referenced by text::properties::update_text_extent().

◆ linear_slice()

string_vector string_vector::linear_slice ( octave_idx_type  lo,
octave_idx_type  up 
) const
inline

Definition at line 140 of file str-vec.h.

Referenced by octave_value_list::slice().

◆ list_in_columns()

std::ostream & string_vector::list_in_columns ( std::ostream &  os,
int  width = 0,
const std::string &  prefix = "" 
) const

◆ map()

template<typename U , typename F >
Array<U> string_vector::map ( fcn) const
inline

Definition at line 145 of file str-vec.h.

Referenced by Fstr2double().

◆ max_length()

octave_idx_type string_vector::max_length ( ) const
inline

Definition at line 79 of file str-vec.h.

References n, and numel().

Referenced by Fchar(), Fstrvcat(), and octave_cell::string_vector_value().

◆ numel()

◆ operator()() [1/2]

std::string& string_vector::operator() ( octave_idx_type  i)
inline

Definition at line 116 of file str-vec.h.

◆ operator()() [2/2]

std::string string_vector::operator() ( octave_idx_type  i) const
inline

Definition at line 118 of file str-vec.h.

◆ operator=() [1/2]

string_vector& string_vector::operator= ( const string_vector )
default

◆ operator=() [2/2]

string_vector& string_vector::operator= ( string_vector &&  )
default

◆ operator[]() [1/2]

std::string& string_vector::operator[] ( octave_idx_type  i)
inline

Definition at line 112 of file str-vec.h.

◆ operator[]() [2/2]

std::string string_vector::operator[] ( octave_idx_type  i) const
inline

Definition at line 114 of file str-vec.h.

◆ resize()

void string_vector::resize ( octave_idx_type  n,
const std::string &  rfv = "" 
)
inline

◆ sort()

string_vector & string_vector::sort ( bool  make_uniq = false)

◆ std_list()

std::list< std::string > string_vector::std_list ( ) const

Definition at line 172 of file str-vec.cc.

References elem(), len, and numel().

Referenced by octave::search_path_for_all_files().

◆ uniq()

string_vector & string_vector::uniq ( )

Definition at line 89 of file str-vec.cc.

References elem(), len, numel(), and resize().

Referenced by sort().

◆ xelem() [1/2]

std::string& string_vector::xelem ( octave_idx_type  i)
inline

Definition at line 108 of file str-vec.h.

Referenced by octave_fields::fieldnames(), and Cell::string_vector_value().

◆ xelem() [2/2]

std::string string_vector::xelem ( octave_idx_type  i) const
inline

Definition at line 110 of file str-vec.h.


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