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

Helper class for make_valid_name function calls. More...

#include "utils.h"

Public Member Functions

 make_valid_name_options ()=default
 Default options for make_valid_name function calls. More...
 
 make_valid_name_options (const octave_value_list &args)
 Extract attribute-value-pairs from an octave_value_list of strings. More...
 
const std::string & get_prefix () const
 
const std::string & get_replacement_style () const
 

Detailed Description

Helper class for make_valid_name function calls.

Extracting options separately for multiple (e.g. 1000+) function calls avoids expensive repetitive parsing of the very same options.

Definition at line 54 of file utils.h.

Constructor & Destructor Documentation

◆ make_valid_name_options() [1/2]

make_valid_name_options::make_valid_name_options ( )
default

Default options for make_valid_name function calls.

Calling the constructor without arguments is equivalent to:

make_valid_name_options (ovl ("ReplacementStyle", "underscore",
"Prefix", "x"));
make_valid_name_options()=default
Default options for make_valid_name function calls.
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
Definition: ovl.h:219

◆ make_valid_name_options() [2/2]

make_valid_name_options::make_valid_name_options ( const octave_value_list args)

Extract attribute-value-pairs from an octave_value_list of strings.

If attributes occur multiple times, the rightmost pair is chosen.

make_valid_name_options (ovl ("ReplacementStyle", "hex", ...));

Definition at line 209 of file utils.cc.

References error(), iskeyword(), octave_value_list::length(), transform(), and octave::valid_identifier().

Member Function Documentation

◆ get_prefix()

const std::string& make_valid_name_options::get_prefix ( ) const
inline
Returns
Prefix, see help matlab.lang.makeValidName.

Definition at line 90 of file utils.h.

Referenced by octave::make_valid_name().

◆ get_replacement_style()

const std::string& make_valid_name_options::get_replacement_style ( ) const
inline
Returns
ReplacementStyle, see help matlab.lang.makeValidName.

Definition at line 86 of file utils.h.

Referenced by octave::make_valid_name().


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