Cleanup & indent .h files

This commit is contained in:
Philippe Vaucher
2014-03-19 11:39:10 +01:00
parent 460205e943
commit 7da25fc0df
43 changed files with 5827 additions and 5733 deletions

View File

@@ -26,34 +26,44 @@
#include <string>
namespace TCLAP {
namespace TCLAP
{
class OptionalUnlabeledTracker
{
public:
public:
static void check( bool req, const std::string& argName );
static void check( bool req, const std::string& argName );
static void gotOptional() { alreadyOptionalRef() = true; }
static void gotOptional()
{
alreadyOptionalRef() = true;
}
static bool& alreadyOptional() { return alreadyOptionalRef(); }
static bool& alreadyOptional()
{
return alreadyOptionalRef();
}
private:
private:
static bool& alreadyOptionalRef() { static bool ct = false; return ct; }
static bool& alreadyOptionalRef()
{
static bool ct = false;
return ct;
}
};
inline void OptionalUnlabeledTracker::check( bool req, const std::string& argName )
{
if ( OptionalUnlabeledTracker::alreadyOptional() )
throw( SpecificationException(
"You can't specify ANY Unlabeled Arg following an optional Unlabeled Arg",
argName ) );
if ( !req )
OptionalUnlabeledTracker::gotOptional();
if ( OptionalUnlabeledTracker::alreadyOptional() )
throw( SpecificationException(
"You can't specify ANY Unlabeled Arg following an optional Unlabeled Arg",
argName ) );
if ( !req )
OptionalUnlabeledTracker::gotOptional();
}