31#ifndef ARGS__UTILS_HPP__INCLUDED
32#define ARGS__UTILS_HPP__INCLUDED
50#define DISABLE_COPY( Class ) \
51 Class( const Class & ) = delete; \
52 Class & operator= ( const Class & ) = delete;
60#define UNUSED( Var ) (void)Var;
71constexpr typename std::add_const< T >::type &
77template <
typename T >
89 return (
word.find(
SL(
"--" ) ) == 0 );
99isFlag(
const String & word )
101 if( !isArgument( word ) )
103 if( word.find(
SL(
'-' ) ) == 0 )
117isCorrectFlag(
const String & flag )
119 if( flag.empty() || flag.length() > 1 )
122 static const String availableSymbols(
SL(
"0123456789"
123 "abcdefghijklmnopqrstuvwxyz"
124 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) );
126 return ( availableSymbols.find( flag ) != String::npos );
136isCorrectName(
const String & name )
141 static const String availableSymbols(
SL(
"0123456789"
142 "abcdefghijklmnopqrstuvwxyz"
143 "ABCDEFGHIJKLMNOPQRSTUVWXYZ-_" ) );
147 if( availableSymbols.find( c ) == String::npos )
161isMisspelledName(
const String & misspelled,
164 if( !misspelled.empty() && !correct.empty() )
169 std::sort( ms.begin(), ms.end() );
170 std::sort( cs.begin(), cs.end() );
178template<
typename T =
void >
183template<
typename T >
constexpr std::add_const< T >::type & asConst(T &t) noexcept
Adds const to non-const objects.
std::string String
String type.
String::value_type Char
Char type.
static const String c_string