FBX SDK Reference Guide: kfbxref.h Source File
00001 #ifndef _KFBXKXREF_H
00002 #define _KFBXKXREF_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 <fbxcore/fbxxref/fbxxref_def.h>
00040 
00041 #include <kfbxplugins/kfbxsdkmanager.h>
00042 
00043 namespace FBXXREF_NAMESPACE {
00044 
00045     class KXRefManagerProject;
00046     class KFbxDocument;
00047 
00048 
00051     class FBXXREF_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 
00093                 static int     GetUrlCount(KFbxProperty const &pProperty);
00094                 static int     GetUrlCount(fbxString const& pUrl);
00095 
00100                 static bool IsRelativeUrl  (KFbxProperty const &pProperty,int pIndex);
00101 
00105                 static KString GetUrl(KFbxProperty const &pProperty,int pIndex);
00106 
00111                 bool GetResolvedUrl (KFbxProperty const &pProperty,int pIndex,KString & pResolvedPath) const;
00113 
00114 
00115             bool GetResolvedUrl (char const* pUrl, KFbxDocument* pDoc, KString& pResolvedPath) const;
00116 
00131             bool GetFirstMatchingUrl(char const* pPrefix, char const* pOptExt, const KFbxDocument* pDoc, KString& pResolvedPath) const;
00132 
00137 
00145                 bool        AddXRefProject   (const char *pName,const char *pUrl);
00146                 bool        AddXRefProject   (const char *pName,const char *pExtension,const char *pUrl);
00154                 bool        AddXRefProject   (KFbxDocument*);
00155                 bool        RemoveXRefProject(const char *pName);
00156                 bool        RemoveAllXRefProjects();
00157 
00158                 int         GetXRefProjectCount() const;
00159                 const char *GetXRefProjectName(int pIndex) const;
00160 
00165                 const char* GetXRefProjectUrl(const char* pName);   // FIXME: Should be const, will break AV.
00166                 const char* GetXRefProjectUrl(const char* pName) const;
00167                 const char* GetXRefProjectUrl(int pIndex) const;
00168 
00170                 inline bool HasXRefProject( const char* pName ) { return GetXRefProjectUrl(pName) != NULL; }
00171 
00175                 bool GetResolvedUrl (char const *pUrl,KString & pResolvePath) const;
00176 
00178         private:
00179             KArrayTemplate<KXRefManagerProject*>    mProjects;
00180 
00181             static bool UrlExist(const char* pUrl);
00182     };
00183 
00184 }
00185 
00186 #endif // #ifndef _FBXKXREF_H
00187 
00188