00001 #ifndef FBXFILESDK_FBXCORE_FBXXREF_KFBXREF_H
00002 #define FBXFILESDK_FBXCORE_FBXXREF_KFBXREF_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include <fbxfilesdk/fbxcore/fbxxref/fbxxref_def.h>
00040
00041 #include <fbxfilesdk/kfbxplugins/kfbxsdkmanager.h>
00042
00043 namespace FBXXREF_NAMESPACE {
00044
00045 class KXRefManagerProject;
00046 class KFbxDocument;
00047
00048
00051 class KFBX_DLL KFbxXRefManager {
00052 public:
00053 KFbxXRefManager();
00054 virtual ~KFbxXRefManager();
00055
00060
00062 static const char* sTemporaryFileProject;
00063
00065 static const char* sConfigurationProject;
00066
00068 static const char* sLocalizationProject;
00069
00081 static const char* sEmbeddedFileProject;
00083
00084 public:
00085
00094 static int GetUrlCount(KFbxProperty const &pProperty);
00095
00101 static int GetUrlCount(fbxString const& pUrl);
00102
00108 static bool IsRelativeUrl (KFbxProperty const &pProperty,int pIndex);
00109
00115 static KString GetUrl(KFbxProperty const &pProperty,int pIndex);
00116
00123 bool GetResolvedUrl (KFbxProperty const &pProperty,int pIndex,KString & pResolvedPath) const;
00125
00126
00127 bool GetResolvedUrl (char const* pUrl, KFbxDocument* pDoc, KString& pResolvedPath) const;
00128
00148 bool GetFirstMatchingUrl(char const* pPrefix, char const* pOptExt, const KFbxDocument* pDoc, KString& pResolvedPath) const;
00149
00154
00162 bool AddXRefProject (const char *pName,const char *pUrl);
00163
00172 bool AddXRefProject (const char *pName,const char *pExtension,const char *pUrl);
00180 bool AddXRefProject (KFbxDocument* pDoc);
00181
00186 bool RemoveXRefProject(const char *pName);
00187
00189 bool RemoveAllXRefProjects();
00190
00194 int GetXRefProjectCount() const;
00195
00200 const char *GetXRefProjectName(int pIndex) const;
00201
00206 const char* GetXRefProjectUrl(const char* pName);
00207
00212 const char* GetXRefProjectUrl(const char* pName) const;
00213
00218 const char* GetXRefProjectUrl(int pIndex) const;
00219
00224 inline bool HasXRefProject( const char* pName ) { return GetXRefProjectUrl(pName) != NULL; }
00225
00231 bool GetResolvedUrl (char const *pUrl,KString & pResolvePath) const;
00232
00234 private:
00235 KArrayTemplate<KXRefManagerProject*> mProjects;
00236
00237 static bool UrlExist(const char* pUrl);
00238 };
00239
00240 }
00241
00242 #endif // FBXFILESDK_FBXCORE_FBXXREF_KFBXREF_H
00243