mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-09-09 20:33:39 -04:00
Cleanup: Unify indentation and line length across files.
Consistenly use 4 space indent (no tabs) and < 80 char lines. The files were very inconsistent and hard to edit.
This commit is contained in:
parent
b162f59fcb
commit
b3f85f4965
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
*
|
*
|
||||||
* file: SwitchArg.h
|
* file: SwitchArg.h
|
||||||
@ -38,7 +37,7 @@ namespace TCLAP {
|
|||||||
*/
|
*/
|
||||||
class SwitchArg : public Arg
|
class SwitchArg : public Arg
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value of the switch.
|
* The value of the switch.
|
||||||
@ -51,7 +50,7 @@ class SwitchArg : public Arg
|
|||||||
*/
|
*/
|
||||||
bool _default;
|
bool _default;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SwitchArg constructor.
|
* SwitchArg constructor.
|
||||||
@ -123,7 +122,7 @@ class SwitchArg : public Arg
|
|||||||
|
|
||||||
virtual void reset();
|
virtual void reset();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* Checks to see if we've found the last match in
|
* Checks to see if we've found the last match in
|
||||||
* a combined string.
|
* a combined string.
|
||||||
@ -144,7 +143,7 @@ inline SwitchArg::SwitchArg(const std::string& flag,
|
|||||||
const std::string& desc,
|
const std::string& desc,
|
||||||
bool default_val,
|
bool default_val,
|
||||||
Visitor* v )
|
Visitor* v )
|
||||||
: Arg(flag, name, desc, false, false, v),
|
: Arg(flag, name, desc, false, false, v),
|
||||||
_value( default_val ),
|
_value( default_val ),
|
||||||
_default( default_val )
|
_default( default_val )
|
||||||
{ }
|
{ }
|
||||||
@ -155,7 +154,7 @@ inline SwitchArg::SwitchArg(const std::string& flag,
|
|||||||
CmdLineInterface& parser,
|
CmdLineInterface& parser,
|
||||||
bool default_val,
|
bool default_val,
|
||||||
Visitor* v )
|
Visitor* v )
|
||||||
: Arg(flag, name, desc, false, false, v),
|
: Arg(flag, name, desc, false, false, v),
|
||||||
_value( default_val ),
|
_value( default_val ),
|
||||||
_default(default_val)
|
_default(default_val)
|
||||||
{
|
{
|
||||||
@ -186,7 +185,7 @@ inline bool SwitchArg::combinedSwitchesMatch(std::string& combinedSwitches )
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// make sure the delimiter isn't in the string
|
// make sure the delimiter isn't in the string
|
||||||
if ( combinedSwitches.find_first_of( Arg::delimiter() ) != std::string::npos )
|
if ( combinedSwitches.find_first_of(Arg::delimiter()) != std::string::npos)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// ok, we're not specifying a ValueArg, so we know that we have
|
// ok, we're not specifying a ValueArg, so we know that we have
|
||||||
|
@ -42,7 +42,7 @@ namespace TCLAP {
|
|||||||
template<class T>
|
template<class T>
|
||||||
class ValueArg : public Arg
|
class ValueArg : public Arg
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value parsed from the command line.
|
* The value parsed from the command line.
|
||||||
@ -79,7 +79,7 @@ class ValueArg : public Arg
|
|||||||
*/
|
*/
|
||||||
void _extractValue( const std::string& val );
|
void _extractValue( const std::string& val );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Labeled ValueArg constructor.
|
* Labeled ValueArg constructor.
|
||||||
@ -262,7 +262,7 @@ ValueArg<T>::ValueArg(const std::string& flag,
|
|||||||
T val,
|
T val,
|
||||||
const std::string& typeDesc,
|
const std::string& typeDesc,
|
||||||
Visitor* v)
|
Visitor* v)
|
||||||
: Arg(flag, name, desc, req, true, v),
|
: Arg(flag, name, desc, req, true, v),
|
||||||
_value( val ),
|
_value( val ),
|
||||||
_default( val ),
|
_default( val ),
|
||||||
_typeDesc( typeDesc ),
|
_typeDesc( typeDesc ),
|
||||||
@ -278,7 +278,7 @@ ValueArg<T>::ValueArg(const std::string& flag,
|
|||||||
const std::string& typeDesc,
|
const std::string& typeDesc,
|
||||||
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 ),
|
||||||
_default( val ),
|
_default( val ),
|
||||||
_typeDesc( typeDesc ),
|
_typeDesc( typeDesc ),
|
||||||
@ -295,7 +295,7 @@ ValueArg<T>::ValueArg(const std::string& flag,
|
|||||||
T val,
|
T val,
|
||||||
Constraint<T>* constraint,
|
Constraint<T>* constraint,
|
||||||
Visitor* v)
|
Visitor* v)
|
||||||
: Arg(flag, name, desc, req, true, v),
|
: Arg(flag, name, desc, req, true, v),
|
||||||
_value( val ),
|
_value( val ),
|
||||||
_default( val ),
|
_default( val ),
|
||||||
_typeDesc( constraint->shortID() ),
|
_typeDesc( constraint->shortID() ),
|
||||||
@ -311,7 +311,7 @@ ValueArg<T>::ValueArg(const std::string& flag,
|
|||||||
Constraint<T>* constraint,
|
Constraint<T>* constraint,
|
||||||
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 ),
|
||||||
_default( val ),
|
_default( val ),
|
||||||
_typeDesc( constraint->shortID() ), // TODO(macbishop): Will crash
|
_typeDesc( constraint->shortID() ), // TODO(macbishop): Will crash
|
||||||
@ -350,17 +350,15 @@ bool ValueArg<T>::processArg(int *i, std::vector<std::string>& args)
|
|||||||
if ( _alreadySet )
|
if ( _alreadySet )
|
||||||
{
|
{
|
||||||
if ( _xorSet )
|
if ( _xorSet )
|
||||||
throw( CmdLineParseException(
|
throw( CmdLineParseException("Mutually exclusive argument"
|
||||||
"Mutually exclusive argument already set!",
|
" already set!", toString()));
|
||||||
toString()) );
|
|
||||||
else
|
else
|
||||||
throw( CmdLineParseException("Argument already set!",
|
throw( CmdLineParseException("Argument already set!",
|
||||||
toString()) );
|
toString()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Arg::delimiter() != ' ' && value == "" )
|
if ( Arg::delimiter() != ' ' && value == "" )
|
||||||
throw( ArgParseException(
|
throw( ArgParseException("Couldn't find delimiter for this argument!",
|
||||||
"Couldn't find delimiter for this argument!",
|
|
||||||
toString() ) );
|
toString() ) );
|
||||||
|
|
||||||
if ( value == "" )
|
if ( value == "" )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user