kfbxref.h

Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_FBXCORE_FBXXREF_KFBXREF_H
00005 #define FBXFILESDK_FBXCORE_FBXXREF_KFBXREF_H
00006 
00007 /**************************************************************************************
00008 
00009  Copyright (C) 2001 - 2009 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material 
00013  (collectively the "Data") in these files contain unpublished information 
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00015  Canada and United States of America federal copyright law and by international 
00016  treaties. 
00017  
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00028  
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE. 
00039 
00040 **************************************************************************************/
00041 
00042 #include <fbxfilesdk/fbxcore/fbxxref/fbxxref_def.h>
00043 
00044 #include <fbxfilesdk/kfbxplugins/kfbxsdkmanager.h>
00045 
00046 namespace FBXXREF_NAMESPACE {
00047 
00048     class KXRefManagerProject;
00049     class KFbxDocument;
00050 
00051 
00055     class KFBX_DLL KFbxXRefManager {
00056         public:
00057 
00059             KFbxXRefManager();
00060 
00062             virtual ~KFbxXRefManager();
00063 
00068 
00070                 static const char* sTemporaryFileProject;
00071 
00073                 static const char* sConfigurationProject;
00074 
00076                 static const char* sLocalizationProject;
00077 
00088                 static const char* sEmbeddedFileProject;
00090 
00091         public:
00092 
00101                 static int     GetUrlCount(KFbxProperty const &pProperty);
00102 
00108                 static int     GetUrlCount(fbxString const& pUrl);
00109 
00115                 static bool IsRelativeUrl  (KFbxProperty const &pProperty,int pIndex);
00116 
00122                 static KString GetUrl(KFbxProperty const &pProperty,int pIndex);
00123 
00130                 bool GetResolvedUrl (KFbxProperty const &pProperty,int pIndex,KString & pResolvedPath) const;
00131             
00138                 bool GetResolvedUrl (char const* pUrl, KFbxDocument* pDoc, KString& pResolvedPath) const;
00140 
00158                 bool GetFirstMatchingUrl(char const* pPrefix, char const* pOptExt, const KFbxDocument* pDoc, KString& pResolvedPath) const;
00159 
00164 
00172                 bool        AddXRefProject   (const char *pName,const char *pUrl);
00173 
00182                 bool        AddXRefProject   (const char *pName,const char *pExtension,const char *pUrl);
00183 
00190                 bool        AddXRefProject   (KFbxDocument* pDoc);
00191 
00196                 bool        RemoveXRefProject(const char *pName);
00197 
00201                 bool        RemoveAllXRefProjects();
00202 
00206                 int         GetXRefProjectCount() const;
00207 
00212                 const char *GetXRefProjectName(int pIndex) const;
00213 
00218                 const char* GetXRefProjectUrl(const char* pName);   // FIXME: Should be const, will break AV.
00219 
00224                 const char* GetXRefProjectUrl(const char* pName) const;
00225 
00230                 const char* GetXRefProjectUrl(int pIndex) const;
00231 
00236                 inline bool HasXRefProject( const char* pName ) { return GetXRefProjectUrl(pName) != NULL; }
00237 
00243                 bool GetResolvedUrl (char const *pUrl,KString & pResolvePath) const;
00244 
00246         private:
00247             KArrayTemplate<KXRefManagerProject*>    mProjects;
00248 
00249             static bool UrlExist(const char* pUrl);
00250     };
00251 
00252 }
00253 
00254 #endif // FBXFILESDK_FBXCORE_FBXXREF_KFBXREF_H
00255