mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-09-09 20:33:39 -04:00
fixed exceptions and typeDesc for constraints
This commit is contained in:
parent
b6b87d65f7
commit
f08a70dbd7
@ -363,6 +363,7 @@ MultiArg<T>::MultiArg(const std::string& flag,
|
|||||||
Constraint<T>* constraint,
|
Constraint<T>* constraint,
|
||||||
Visitor* v)
|
Visitor* v)
|
||||||
: Arg( flag, name, desc, req, true, v ),
|
: Arg( flag, name, desc, req, true, v ),
|
||||||
|
_typeDesc( constraint->shortID() ),
|
||||||
_constraint( constraint )
|
_constraint( constraint )
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@ -375,6 +376,7 @@ MultiArg<T>::MultiArg(const std::string& flag,
|
|||||||
CmdLineInterface& parser,
|
CmdLineInterface& parser,
|
||||||
Visitor* v)
|
Visitor* v)
|
||||||
: Arg( flag, name, desc, req, true, v ),
|
: Arg( flag, name, desc, req, true, v ),
|
||||||
|
_typeDesc( constraint->shortID() ),
|
||||||
_constraint( constraint )
|
_constraint( constraint )
|
||||||
{
|
{
|
||||||
parser.add( this );
|
parser.add( this );
|
||||||
@ -484,7 +486,8 @@ void MultiArg<T>::_extractValue( const std::string& val )
|
|||||||
if ( ! _constraint->check( _values.back() ) )
|
if ( ! _constraint->check( _values.back() ) )
|
||||||
throw( CmdLineParseException( "Value '" + val +
|
throw( CmdLineParseException( "Value '" + val +
|
||||||
"' does not meet constraint: " +
|
"' does not meet constraint: " +
|
||||||
_constraint->description() ) );
|
_constraint->description(),
|
||||||
|
toString() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -402,6 +402,7 @@ ValueArg<T>::ValueArg(const std::string& flag,
|
|||||||
Visitor* v)
|
Visitor* v)
|
||||||
: Arg(flag, name, desc, req, true, v),
|
: Arg(flag, name, desc, req, true, v),
|
||||||
_value( val ),
|
_value( val ),
|
||||||
|
_typeDesc( constraint->shortID() ),
|
||||||
_constraint( constraint )
|
_constraint( constraint )
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@ -415,8 +416,9 @@ ValueArg<T>::ValueArg(const std::string& flag,
|
|||||||
CmdLineInterface& parser,
|
CmdLineInterface& parser,
|
||||||
Visitor* v)
|
Visitor* v)
|
||||||
: Arg(flag, name, desc, req, true, v),
|
: Arg(flag, name, desc, req, true, v),
|
||||||
_value( val ),
|
_value( val ),
|
||||||
_constraint( constraint )
|
_typeDesc( constraint->shortID() ),
|
||||||
|
_constraint( constraint )
|
||||||
{
|
{
|
||||||
parser.add( this );
|
parser.add( this );
|
||||||
}
|
}
|
||||||
@ -513,7 +515,8 @@ void ValueArg<T>::_extractValue( const std::string& val )
|
|||||||
if ( ! _constraint->check( _value ) )
|
if ( ! _constraint->check( _value ) )
|
||||||
throw( CmdLineParseException( "Value '" + val +
|
throw( CmdLineParseException( "Value '" + val +
|
||||||
"' does not meet constraint: " +
|
"' does not meet constraint: " +
|
||||||
_constraint->description() ) );
|
_constraint->description(),
|
||||||
|
toString() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace TCLAP
|
} // namespace TCLAP
|
||||||
|
Loading…
x
Reference in New Issue
Block a user