summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-29 20:39:45 (GMT)
committerBrad King <brad.king@kitware.com>2009-07-29 20:39:45 (GMT)
commit8ab2548d6c67909a572b2e94993e9acc93fab61a (patch)
tree17298fe72a04d0e1135cd7c660824fbfd54e9acc /Source/cmGlobalXCodeGenerator.cxx
parent2537a72f8efb68f0efe97f7f43fb0a7dfdf12c60 (diff)
downloadCMake-8ab2548d6c67909a572b2e94993e9acc93fab61a.zip
CMake-8ab2548d6c67909a572b2e94993e9acc93fab61a.tar.gz
CMake-8ab2548d6c67909a572b2e94993e9acc93fab61a.tar.bz2
Re-order cmGlobalXCodeGenerator implementation
This defines class cmGlobalXCodeGenerator::BuildObjectListOrString early in the source file so it can be used in more places.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx102
1 files changed, 51 insertions, 51 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 0d3ddce..6687066 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -62,6 +62,57 @@ public:
};
#endif
+// Builds either an object list or a space-separated string from the
+// given inputs.
+class cmGlobalXCodeGenerator::BuildObjectListOrString
+{
+ cmGlobalXCodeGenerator *Generator;
+ cmXCodeObject *Group;
+ bool Empty;
+ std::string String;
+
+public:
+ BuildObjectListOrString(cmGlobalXCodeGenerator *gen, bool buildObjectList)
+ : Generator(gen), Group(0), Empty(true)
+ {
+ if (buildObjectList)
+ {
+ this->Group = this->Generator->CreateObject(cmXCodeObject::OBJECT_LIST);
+ }
+ }
+
+ bool IsEmpty() const { return this->Empty; }
+
+ void Add(const char *newString)
+ {
+ this->Empty = false;
+
+ if (this->Group)
+ {
+ this->Group->AddObject(this->Generator->CreateString(newString));
+ }
+ else
+ {
+ this->String += newString;
+ this->String += ' ';
+ }
+ }
+
+ const std::string &GetString() const { return this->String; }
+
+ cmXCodeObject *CreateList()
+ {
+ if (this->Group)
+ {
+ return this->Group;
+ }
+ else
+ {
+ return this->Generator->CreateString(this->String.c_str());
+ }
+ }
+};
+
//----------------------------------------------------------------------------
cmGlobalXCodeGenerator::cmGlobalXCodeGenerator()
{
@@ -452,57 +503,6 @@ cmStdString GetGroupMapKey(cmTarget& cmtarget, cmSourceFile* sf)
return key;
}
-// Builds either an object list or a space-separated string from the
-// given inputs.
-class cmGlobalXCodeGenerator::BuildObjectListOrString
-{
- cmGlobalXCodeGenerator *Generator;
- cmXCodeObject *Group;
- bool Empty;
- std::string String;
-
-public:
- BuildObjectListOrString(cmGlobalXCodeGenerator *gen, bool buildObjectList)
- : Generator(gen), Group(0), Empty(true)
- {
- if (buildObjectList)
- {
- this->Group = this->Generator->CreateObject(cmXCodeObject::OBJECT_LIST);
- }
- }
-
- bool IsEmpty() const { return this->Empty; }
-
- void Add(const char *newString)
- {
- this->Empty = false;
-
- if (this->Group)
- {
- this->Group->AddObject(this->Generator->CreateString(newString));
- }
- else
- {
- this->String += newString;
- this->String += ' ';
- }
- }
-
- const std::string &GetString() const { return this->String; }
-
- cmXCodeObject *CreateList()
- {
- if (this->Group)
- {
- return this->Group;
- }
- else
- {
- return this->Generator->CreateString(this->String.c_str());
- }
- }
-};
-
//----------------------------------------------------------------------------
cmXCodeObject*
cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,