FBX SDK Reference Guide: kfbxref.h Source File
00001 #ifndef FBXFILESDK_FBXCORE_FBXXREF_KFBXREF_H
00002 #define FBXFILESDK_FBXCORE_FBXXREF_KFBXREF_H
00003 
00004 /**************************************************************************************
00005 
00006  Copyright © 2001 - 2008 Autodesk, Inc. and/or its licensors.
00007  All Rights Reserved.
00008 
00009  The coded instructions, statements, computer programs, and/or related material 
00010  (collectively the "Data") in these files contain unpublished information 
00011  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00012  Canada and United States of America federal copyright law and by international 
00013  treaties. 
00014  
00015  The Data may not be disclosed or distributed to third parties, in whole or in
00016  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00017 
00018  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00019  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00020  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00021  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00022  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00023  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00024  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00028  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00029  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00030  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00031  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00032  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00033  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00034  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00035  OR DAMAGE. 
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);   // FIXME: Should be const, will break AV.
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