2005-01-25 01:35:54 +03:00
|
|
|
#ifndef cmXCodeObject_h
|
|
|
|
#define cmXCodeObject_h
|
|
|
|
|
2005-01-22 00:25:36 +03:00
|
|
|
#include "cmStandardIncludes.h"
|
2005-02-04 01:42:55 +03:00
|
|
|
class cmTarget;
|
2005-01-22 00:25:36 +03:00
|
|
|
|
|
|
|
class cmXCodeObject
|
|
|
|
{
|
|
|
|
public:
|
2005-01-25 23:26:57 +03:00
|
|
|
enum Type { OBJECT_LIST, STRING, ATTRIBUTE_GROUP, OBJECT_REF, OBJECT };
|
2005-01-22 00:25:36 +03:00
|
|
|
enum PBXType { PBXGroup, PBXBuildStyle, PBXProject, PBXHeadersBuildPhase,
|
2005-02-04 01:42:55 +03:00
|
|
|
PBXSourcesBuildPhase, PBXFrameworksBuildPhase,
|
|
|
|
PBXNativeTarget, PBXFileReference, PBXBuildFile,
|
|
|
|
PBXContainerItemProxy, PBXTargetDependency,
|
|
|
|
PBXShellScriptBuildPhase, PBXResourcesBuildPhase,
|
|
|
|
PBXApplicationReference, PBXExecutableFileReference,
|
|
|
|
PBXLibraryReference, PBXToolTarget, PBXLibraryTarget,
|
|
|
|
PBXAggregateTarget,
|
2005-01-22 00:25:36 +03:00
|
|
|
None
|
|
|
|
};
|
|
|
|
static const char* PBXTypeNames[];
|
2005-02-04 01:42:55 +03:00
|
|
|
~cmXCodeObject();
|
2005-01-22 00:25:36 +03:00
|
|
|
cmXCodeObject(PBXType ptype, Type type);
|
2005-01-25 23:26:57 +03:00
|
|
|
void SetString(const char* s)
|
2005-01-22 00:25:36 +03:00
|
|
|
{
|
2005-02-03 01:16:07 +03:00
|
|
|
m_String = "\"";
|
|
|
|
m_String += s;
|
|
|
|
m_String += "\"";
|
2005-01-22 00:25:36 +03:00
|
|
|
}
|
2005-01-25 23:26:57 +03:00
|
|
|
|
2005-01-22 00:25:36 +03:00
|
|
|
void AddAttribute(const char* name, cmXCodeObject* value)
|
|
|
|
{
|
|
|
|
m_ObjectAttributes[name] = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetObject(cmXCodeObject* value)
|
|
|
|
{
|
|
|
|
m_Object = value;
|
|
|
|
}
|
|
|
|
void AddObject(cmXCodeObject* value)
|
|
|
|
{
|
|
|
|
m_List.push_back(value);
|
|
|
|
}
|
2005-01-25 01:35:54 +03:00
|
|
|
static void Indent(int level, std::ostream& out);
|
2005-01-22 00:25:36 +03:00
|
|
|
void Print(std::ostream& out);
|
2005-01-25 01:35:54 +03:00
|
|
|
static void PrintList(std::vector<cmXCodeObject*> const&, std::ostream& out);
|
2005-01-22 00:25:36 +03:00
|
|
|
const char* GetId()
|
|
|
|
{
|
|
|
|
return m_Id.c_str();
|
|
|
|
}
|
2005-02-04 01:42:55 +03:00
|
|
|
cmTarget* GetcmTarget()
|
|
|
|
{
|
|
|
|
return m_cmTarget;
|
|
|
|
}
|
|
|
|
void SetcmTarget(cmTarget* t)
|
|
|
|
{
|
|
|
|
m_cmTarget = t;
|
|
|
|
}
|
|
|
|
cmXCodeObject* GetObject(const char* name)
|
|
|
|
{
|
|
|
|
if(m_ObjectAttributes.count(name))
|
|
|
|
{
|
|
|
|
return m_ObjectAttributes[name];
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-01-25 01:35:54 +03:00
|
|
|
private:
|
2005-02-04 01:42:55 +03:00
|
|
|
cmTarget* m_cmTarget;
|
2005-01-22 00:25:36 +03:00
|
|
|
Type m_Type;
|
|
|
|
cmStdString m_Id;
|
|
|
|
PBXType m_IsA;
|
2005-01-25 23:26:57 +03:00
|
|
|
cmStdString m_String;
|
2005-01-22 00:25:36 +03:00
|
|
|
cmXCodeObject* m_Object;
|
|
|
|
std::vector<cmXCodeObject*> m_List;
|
|
|
|
std::map<cmStdString, cmXCodeObject*> m_ObjectAttributes;
|
|
|
|
};
|
2005-01-25 01:35:54 +03:00
|
|
|
#endif
|