From 8ab2548d6c67909a572b2e94993e9acc93fab61a Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 29 Jul 2009 16:39:45 -0400 Subject: Re-order cmGlobalXCodeGenerator implementation This defines class cmGlobalXCodeGenerator::BuildObjectListOrString early in the source file so it can be used in more places. --- Source/cmGlobalXCodeGenerator.cxx | 102 +++++++++++++++++++------------------- 1 file 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, -- cgit v0.12