00001 /* 00002 Copyright (C) 2005-2007 Feeling Software Inc. 00003 Portions of the code are: 00004 Copyright (C) 2005-2007 Sony Computer Entertainment America 00005 00006 MIT License: http://www.opensource.org/licenses/mit-license.php 00007 */ 00008 00014 #ifndef __FCD_OBJECT_WITH_ID_H_ 00015 #define __FCD_OBJECT_WITH_ID_H_ 00016 00017 #ifndef __FCD_OBJECT_H_ 00018 #include "FCDocument/FCDObject.h" 00019 #endif // __FCD_OBJECT_H_ 00020 #ifndef _FU_PARAMETER_H_ 00021 #include "FUtils/FUParameter.h" 00022 #endif // _FU_PARAMETER_H_ 00023 00037 class FCOLLADA_EXPORT FCDObjectWithId : public FCDObject 00038 { 00039 private: 00040 DeclareObjectType(FCDObject); 00041 00042 DeclareParameter(fm::string, FUParameterQualifiers::SIMPLE, daeId, FC("Unique Id")); 00043 00044 private: 00045 DeclareFlag(UniqueId, 0); 00046 public: 00047 DeclareFlag(DaeIdChanged, 1); 00048 DeclareFlagCount(2); 00049 00050 public: 00054 FCDObjectWithId(FCDocument* document, const char* baseId = "ObjectWithID"); 00055 00057 virtual ~FCDObjectWithId(); 00058 00063 const fm::string& GetDaeId() const; 00064 00070 void SetDaeId(const fm::string& id); 00071 00077 void SetDaeId(fm::string& id); 00078 00082 void RemoveDaeId(); 00083 00088 void Clone(FCDObjectWithId* clone) const; 00089 00095 static fm::string CleanId(const char* id); 00096 inline static const fm::string CleanId(const fm::string& id) { return CleanId(id.c_str()); } 00104 static fm::string CleanSubId(const char* sid); 00105 inline static const fm::string CleanSubId(const fm::string& sid) { return CleanSubId(sid.c_str()); } 00106 }; 00107 00108 #endif // __FCD_OBJECT_WITH_ID_H_