Re-order cmGlobalXCodeGenerator implementation
This defines class cmGlobalXCodeGenerator::BuildObjectListOrString early in the source file so it can be used in more places.
This commit is contained in:
parent
2537a72f8e
commit
8ab2548d6c
@ -62,6 +62,57 @@ public:
|
|||||||
};
|
};
|
||||||
#endif
|
#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()
|
cmGlobalXCodeGenerator::cmGlobalXCodeGenerator()
|
||||||
{
|
{
|
||||||
@ -452,57 +503,6 @@ cmStdString GetGroupMapKey(cmTarget& cmtarget, cmSourceFile* sf)
|
|||||||
return key;
|
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*
|
cmXCodeObject*
|
||||||
cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
|
cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user