summaryrefslogtreecommitdiffstats
path: root/Source/cmXCodeObject.h
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2016-05-16 14:34:04 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-16 20:05:19 (GMT)
commitd9fd2f5402eeaa345691313658e02b51038f570b (patch)
treedca71b9a7e267f4c6300da3eb770415381726785 /Source/cmXCodeObject.h
parent82df6deaafb36cbbfd450202bb20b320f637751a (diff)
downloadCMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2
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/cmXCodeObject.h')
-rw-r--r--Source/cmXCodeObject.h184
1 files changed, 89 insertions, 95 deletions
diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h
index d00cf0f..d2f7cb7 100644
--- a/Source/cmXCodeObject.h
+++ b/Source/cmXCodeObject.h
@@ -19,60 +19,71 @@ class cmGeneratorTarget;
class cmXCodeObject
{
public:
- enum Type { OBJECT_LIST, STRING, ATTRIBUTE_GROUP, OBJECT_REF, OBJECT };
- enum PBXType { PBXGroup, PBXBuildStyle, PBXProject, PBXHeadersBuildPhase,
- PBXSourcesBuildPhase, PBXFrameworksBuildPhase,
- PBXNativeTarget, PBXFileReference, PBXBuildFile,
- PBXContainerItemProxy, PBXTargetDependency,
- PBXShellScriptBuildPhase, PBXResourcesBuildPhase,
- PBXApplicationReference, PBXExecutableFileReference,
- PBXLibraryReference, PBXToolTarget, PBXLibraryTarget,
- PBXAggregateTarget,XCBuildConfiguration,XCConfigurationList,
- PBXCopyFilesBuildPhase,
- None
+ enum Type
+ {
+ OBJECT_LIST,
+ STRING,
+ ATTRIBUTE_GROUP,
+ OBJECT_REF,
+ OBJECT
+ };
+ enum PBXType
+ {
+ PBXGroup,
+ PBXBuildStyle,
+ PBXProject,
+ PBXHeadersBuildPhase,
+ PBXSourcesBuildPhase,
+ PBXFrameworksBuildPhase,
+ PBXNativeTarget,
+ PBXFileReference,
+ PBXBuildFile,
+ PBXContainerItemProxy,
+ PBXTargetDependency,
+ PBXShellScriptBuildPhase,
+ PBXResourcesBuildPhase,
+ PBXApplicationReference,
+ PBXExecutableFileReference,
+ PBXLibraryReference,
+ PBXToolTarget,
+ PBXLibraryTarget,
+ PBXAggregateTarget,
+ XCBuildConfiguration,
+ XCConfigurationList,
+ PBXCopyFilesBuildPhase,
+ None
+ };
+ class StringVec : public std::vector<std::string>
+ {
};
- class StringVec: public std::vector<std::string> {};
static const char* PBXTypeNames[];
virtual ~cmXCodeObject();
cmXCodeObject(PBXType ptype, Type type);
- Type GetType() { return this->TypeValue;}
- PBXType GetIsA() { return this->IsA;}
+ Type GetType() { return this->TypeValue; }
+ PBXType GetIsA() { return this->IsA; }
void SetString(const std::string& s);
- const std::string& GetString()
- {
- return this->String;
- }
+ const std::string& GetString() { return this->String; }
void AddAttribute(const std::string& name, cmXCodeObject* value)
- {
- this->ObjectAttributes[name] = value;
- }
+ {
+ this->ObjectAttributes[name] = value;
+ }
- void SetObject(cmXCodeObject* value)
- {
- this->Object = value;
- }
- cmXCodeObject* GetObject()
- {
- return this->Object;
- }
- void AddObject(cmXCodeObject* value)
- {
- this->List.push_back(value);
- }
+ void SetObject(cmXCodeObject* value) { this->Object = value; }
+ cmXCodeObject* GetObject() { return this->Object; }
+ void AddObject(cmXCodeObject* value) { this->List.push_back(value); }
bool HasObject(cmXCodeObject* o)
{
- return !(std::find(this->List.begin(), this->List.end(), o)
- == this->List.end());
+ return !(std::find(this->List.begin(), this->List.end(), o) ==
+ this->List.end());
}
void AddUniqueObject(cmXCodeObject* value)
{
- if(std::find(this->List.begin(), this->List.end(), value)
- == this->List.end())
- {
+ if (std::find(this->List.begin(), this->List.end(), value) ==
+ this->List.end()) {
this->List.push_back(value);
- }
+ }
}
static void Indent(int level, std::ostream& out);
void Print(std::ostream& out);
@@ -82,72 +93,55 @@ public:
const cmXCodeObject* parent);
virtual void PrintComment(std::ostream&) {}
- static void PrintList(std::vector<cmXCodeObject*> const&,
- std::ostream& out);
- const std::string& GetId()
- {
- return this->Id;
- }
- void SetId(const std::string& id)
- {
- this->Id = id;
- }
- cmGeneratorTarget* GetTarget()
- {
- return this->Target;
- }
- void SetTarget(cmGeneratorTarget* t)
- {
- this->Target = t;
- }
- const std::string& GetComment() {return this->Comment;}
- bool HasComment() { return (!this->Comment.empty());}
+ static void PrintList(std::vector<cmXCodeObject*> const&, std::ostream& out);
+ const std::string& GetId() { return this->Id; }
+ void SetId(const std::string& id) { this->Id = id; }
+ cmGeneratorTarget* GetTarget() { return this->Target; }
+ void SetTarget(cmGeneratorTarget* t) { this->Target = t; }
+ const std::string& GetComment() { return this->Comment; }
+ bool HasComment() { return (!this->Comment.empty()); }
cmXCodeObject* GetObject(const char* name)
- {
- if(this->ObjectAttributes.count(name))
- {
- return this->ObjectAttributes[name];
- }
- return 0;
+ {
+ if (this->ObjectAttributes.count(name)) {
+ return this->ObjectAttributes[name];
}
+ return 0;
+ }
// search the attribute list for an object of the specified type
cmXCodeObject* GetObject(cmXCodeObject::PBXType t)
- {
- for(std::vector<cmXCodeObject*>::iterator i = this->List.begin();
- i != this->List.end(); ++i)
- {
- cmXCodeObject* o = *i;
- if(o->IsA == t)
- {
- return o;
- }
- }
- return 0;
+ {
+ for (std::vector<cmXCodeObject*>::iterator i = this->List.begin();
+ i != this->List.end(); ++i) {
+ cmXCodeObject* o = *i;
+ if (o->IsA == t) {
+ return o;
+ }
}
+ return 0;
+ }
- void CopyAttributes(cmXCodeObject* );
+ void CopyAttributes(cmXCodeObject*);
- void AddDependLibrary(const std::string& configName,
- const std::string& l)
- {
- this->DependLibraries[configName].push_back(l);
- }
+ void AddDependLibrary(const std::string& configName, const std::string& l)
+ {
+ this->DependLibraries[configName].push_back(l);
+ }
std::map<std::string, StringVec> const& GetDependLibraries()
- {
- return this->DependLibraries;
- }
- void AddDependTarget(const std::string& configName,
- const std::string& tName)
- {
- this->DependTargets[configName].push_back(tName);
- }
+ {
+ return this->DependLibraries;
+ }
+ void AddDependTarget(const std::string& configName, const std::string& tName)
+ {
+ this->DependTargets[configName].push_back(tName);
+ }
std::map<std::string, StringVec> const& GetDependTargets()
- {
+ {
return this->DependTargets;
- }
- std::vector<cmXCodeObject*> const& GetObjectList() { return this->List;}
- void SetComment(const std::string& c) { this->Comment = c;}
- static void PrintString(std::ostream& os,std::string String);
+ }
+ std::vector<cmXCodeObject*> const& GetObjectList() { return this->List; }
+ void SetComment(const std::string& c) { this->Comment = c; }
+ static void PrintString(std::ostream& os, std::string String);
+
protected:
void PrintString(std::ostream& os) const;