MeVisLab Toolbox Reference
ml::StringSwitch< T, R > Class Template Reference

#include <mlStringSwitch.h>

Public Member Functions

 StringSwitch (const std::string &s)
 
 StringSwitch (const char *s)
 
template<unsigned N>
StringSwitchCase (const char(&s)[N], const T &Value)
 
StringSwitchCase (const std::string &s, const T &Value)
 
template<unsigned N>
StringSwitchEndsWith (const char(&s)[N], const T &Value)
 
template<unsigned N>
StringSwitchStartsWith (const char(&s)[N], const T &Value)
 
template<unsigned N0, unsigned N1>
StringSwitchCases (const char(&S0)[N0], const char(&S1)[N1], const T &Value)
 
template<unsigned N0, unsigned N1, unsigned N2>
StringSwitchCases (const char(&S0)[N0], const char(&S1)[N1], const char(&S2)[N2], const T &Value)
 
template<unsigned N0, unsigned N1, unsigned N2, unsigned N3>
StringSwitchCases (const char(&S0)[N0], const char(&S1)[N1], const char(&S2)[N2], const char(&S3)[N3], const T &Value)
 
template<unsigned N0, unsigned N1, unsigned N2, unsigned N3, unsigned N4>
StringSwitchCases (const char(&S0)[N0], const char(&S1)[N1], const char(&S2)[N2], const char(&S3)[N3], const char(&S4)[N4], const T &Value)
 
R Default (const T &Value) const
 
template<typename Ex , typename ExP1 >
R Throw (const ExP1 &p1) const
 
template<typename Ex , typename ExP1 , typename ExP2 >
R Throw (const ExP1 &p1, const ExP2 &p2) const
 
template<typename Ex , typename ExP1 , typename ExP2 , typename ExP3 >
R Throw (const ExP1 &p1, const ExP2 &p2, const ExP3 &p3) const
 
 operator R () const
 

Detailed Description

template<typename T, typename R = T>
class ml::StringSwitch< T, R >

Definition at line 51 of file mlStringSwitch.h.

Constructor & Destructor Documentation

◆ StringSwitch() [1/2]

template<typename T , typename R = T>
ml::StringSwitch< T, R >::StringSwitch ( const std::string & s)
inlineexplicit

Definition at line 54 of file mlStringSwitch.h.

◆ StringSwitch() [2/2]

template<typename T , typename R = T>
ml::StringSwitch< T, R >::StringSwitch ( const char * s)
inlineexplicit

Definition at line 59 of file mlStringSwitch.h.

Member Function Documentation

◆ Case() [1/2]

template<typename T , typename R = T>
template<unsigned N>
StringSwitch & ml::StringSwitch< T, R >::Case ( const char(&) s[N],
const T & Value )
inline

◆ Case() [2/2]

template<typename T , typename R = T>
StringSwitch & ml::StringSwitch< T, R >::Case ( const std::string & s,
const T & Value )
inline

Definition at line 77 of file mlStringSwitch.h.

◆ Cases() [1/4]

template<typename T , typename R = T>
template<unsigned N0, unsigned N1, unsigned N2, unsigned N3, unsigned N4>
StringSwitch & ml::StringSwitch< T, R >::Cases ( const char(&) S0[N0],
const char(&) S1[N1],
const char(&) S2[N2],
const char(&) S3[N3],
const char(&) S4[N4],
const T & Value )
inline

Definition at line 133 of file mlStringSwitch.h.

References ml::StringSwitch< T, R >::Case(), and mlrange_cast().

◆ Cases() [2/4]

template<typename T , typename R = T>
template<unsigned N0, unsigned N1, unsigned N2, unsigned N3>
StringSwitch & ml::StringSwitch< T, R >::Cases ( const char(&) S0[N0],
const char(&) S1[N1],
const char(&) S2[N2],
const char(&) S3[N3],
const T & Value )
inline

Definition at line 127 of file mlStringSwitch.h.

References ml::StringSwitch< T, R >::Case(), and mlrange_cast().

◆ Cases() [3/4]

template<typename T , typename R = T>
template<unsigned N0, unsigned N1, unsigned N2>
StringSwitch & ml::StringSwitch< T, R >::Cases ( const char(&) S0[N0],
const char(&) S1[N1],
const char(&) S2[N2],
const T & Value )
inline

Definition at line 121 of file mlStringSwitch.h.

References ml::StringSwitch< T, R >::Case(), and mlrange_cast().

◆ Cases() [4/4]

template<typename T , typename R = T>
template<unsigned N0, unsigned N1>
StringSwitch & ml::StringSwitch< T, R >::Cases ( const char(&) S0[N0],
const char(&) S1[N1],
const T & Value )
inline

Definition at line 115 of file mlStringSwitch.h.

References ml::StringSwitch< T, R >::Case(), and mlrange_cast().

◆ Default()

template<typename T , typename R = T>
R ml::StringSwitch< T, R >::Default ( const T & Value) const
inline

Definition at line 138 of file mlStringSwitch.h.

◆ EndsWith()

template<typename T , typename R = T>
template<unsigned N>
StringSwitch & ml::StringSwitch< T, R >::EndsWith ( const char(&) s[N],
const T & Value )
inline

Definition at line 89 of file mlStringSwitch.h.

References N.

◆ operator R()

template<typename T , typename R = T>
ml::StringSwitch< T, R >::operator R ( ) const
inline

Definition at line 177 of file mlStringSwitch.h.

◆ StartsWith()

template<typename T , typename R = T>
template<unsigned N>
StringSwitch & ml::StringSwitch< T, R >::StartsWith ( const char(&) s[N],
const T & Value )
inline

Definition at line 102 of file mlStringSwitch.h.

References N.

◆ Throw() [1/3]

template<typename T , typename R = T>
template<typename Ex , typename ExP1 >
R ml::StringSwitch< T, R >::Throw ( const ExP1 & p1) const
inline

Definition at line 148 of file mlStringSwitch.h.

References mlrange_cast().

◆ Throw() [2/3]

template<typename T , typename R = T>
R ml::StringSwitch< T, R >::Throw ( const ExP1 & p1,
const ExP2 & p2 ) const
inline

Definition at line 158 of file mlStringSwitch.h.

References mlrange_cast().

◆ Throw() [3/3]

template<typename T , typename R = T>
R ml::StringSwitch< T, R >::Throw ( const ExP1 & p1,
const ExP2 & p2,
const ExP3 & p3 ) const
inline

Definition at line 168 of file mlStringSwitch.h.

References mlrange_cast().


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