summaryrefslogtreecommitdiff
path: root/Source/cmCommand.h
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2016-05-16 10:34:04 -0400
committerBrad King <brad.king@kitware.com>2016-05-16 16:05:19 -0400
commitd9fd2f5402eeaa345691313658e02b51038f570b (patch)
treedca71b9a7e267f4c6300da3eb770415381726785 /Source/cmCommand.h
parent82df6deaafb36cbbfd450202bb20b320f637751a (diff)
downloadcmake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
Diffstat (limited to 'Source/cmCommand.h')
-rw-r--r--Source/cmCommand.h71
1 files changed, 30 insertions, 41 deletions
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index d5e394d5e8..01572938f4 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -37,7 +37,10 @@ public:
* Construct the command. By default it is enabled with no makefile.
*/
cmCommand()
- {this->Makefile = 0; this->Enabled = true;}
+ {
+ this->Makefile = 0;
+ this->Enabled = true;
+ }
/**
* Need virtual destructor to destroy real command type.
@@ -47,8 +50,7 @@ public:
/**
* Specify the makefile.
*/
- void SetMakefile(cmMakefile*m)
- {this->Makefile = m; }
+ void SetMakefile(cmMakefile* m) { this->Makefile = m; }
cmMakefile* GetMakefile() { return this->Makefile; }
/**
@@ -57,24 +59,23 @@ public:
* arguments and then invokes the InitialPass.
*/
virtual bool InvokeInitialPass(const std::vector<cmListFileArgument>& args,
- cmExecutionStatus &status)
- {
+ cmExecutionStatus& status)
+ {
std::vector<std::string> expandedArguments;
- if(!this->Makefile->ExpandArguments(args, expandedArguments))
- {
+ if (!this->Makefile->ExpandArguments(args, expandedArguments)) {
// There was an error expanding arguments. It was already
// reported, so we can skip this command without error.
return true;
- }
- return this->InitialPass(expandedArguments,status);
}
+ return this->InitialPass(expandedArguments, status);
+ }
/**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus &) = 0;
+ cmExecutionStatus&) = 0;
/**
* This is called at the end after all the information
@@ -97,10 +98,7 @@ public:
/**
* This determines if the command is invoked when in script mode.
*/
- virtual bool IsScriptable() const
- {
- return false;
- }
+ virtual bool IsScriptable() const { return false; }
/**
* This is used to avoid including this command
@@ -108,10 +106,7 @@ public:
* cmMacroHelperCommand and cmFunctionHelperCommand
* which cannot provide appropriate documentation.
*/
- virtual bool ShouldAppearInDocumentation() const
- {
- return true;
- }
+ virtual bool ShouldAppearInDocumentation() const { return true; }
/**
* The name of the command as specified in CMakeList.txt.
@@ -121,58 +116,52 @@ public:
/**
* Enable the command.
*/
- void EnabledOn()
- {this->Enabled = true;}
+ void EnabledOn() { this->Enabled = true; }
/**
* Disable the command.
*/
- void EnabledOff()
- {this->Enabled = false;}
+ void EnabledOff() { this->Enabled = false; }
/**
* Query whether the command is enabled.
*/
- bool GetEnabled() const
- {return this->Enabled;}
+ bool GetEnabled() const { return this->Enabled; }
/**
* Disable or enable the command.
*/
- void SetEnabled(bool enabled)
- {this->Enabled = enabled;}
+ void SetEnabled(bool enabled) { this->Enabled = enabled; }
/**
* Return the last error string.
*/
const char* GetError()
- {
- if(this->Error.empty())
- {
- this->Error = this->GetName();
- this->Error += " unknown error.";
- }
- return this->Error.c_str();
+ {
+ if (this->Error.empty()) {
+ this->Error = this->GetName();
+ this->Error += " unknown error.";
}
+ return this->Error.c_str();
+ }
/**
* Set the error message
*/
void SetError(const std::string& e)
- {
+ {
this->Error = this->GetName();
this->Error += " ";
this->Error += e;
- }
+ }
/** Check if the command is disallowed by a policy. */
bool Disallowed(cmPolicies::PolicyID pol, const char* e)
- {
- switch(this->Makefile->GetPolicyStatus(pol))
- {
+ {
+ switch (this->Makefile->GetPolicyStatus(pol)) {
case cmPolicies::WARN:
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
- cmPolicies::GetPolicyWarning(pol));
+ cmPolicies::GetPolicyWarning(pol));
case cmPolicies::OLD:
return false;
case cmPolicies::REQUIRED_IF_USED:
@@ -180,9 +169,9 @@ public:
case cmPolicies::NEW:
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e);
break;
- }
- return true;
}
+ return true;
+ }
protected:
cmMakefile* Makefile;