FBX SDK Reference Guide: kfbxio.h Source File
Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_IO_H_
00005 #define _FBXSDK_IO_H_
00006 
00007 /**************************************************************************************
00008 
00009  Copyright © 2001 - 2008 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 
00043 #include <kaydaradef.h>
00044 #ifndef KFBX_DLL
00045     #define KFBX_DLL K_DLLIMPORT
00046 #endif
00047 
00048 #include <kaydara.h>
00049 
00050 #include <klib/kerror.h>
00051 #include <klib/kstring.h>
00052 
00053 #include <kbaselib_forward.h>
00054 #ifndef MB_FBXSDK
00055 #include <kbaselib_nsuse.h>
00056 #endif
00057 
00058 #include <kfbxplugins/kfbxobject.h>
00059 
00060 #ifdef KARCH_DEV_MACOSX_CFM
00061     #include <CFURL.h>
00062     #include <Files.h>
00063 #endif
00064 
00065 #include <fbxfilesdk_nsbegin.h>
00066 
00067 class KFbxSdkManager;
00068 class KFbxStreamOptions;
00069 
00070 #define KFBXIO_END_NODE_STR ("_End")
00071 
00075 class KFBX_DLL KFbxIO : public KFbxObject
00076 
00077 {
00078     KFBXOBJECT_DECLARE(KFbxIO,KFbxObject);
00079 
00080 public:
00081 
00088     static void GetCurrentVersion(int& pMajor, int& pMinor, int& pRevision);
00089 
00095     virtual bool Initialize(const char *pFileName);
00096 
00097 #ifdef KARCH_DEV_MACOSX_CFM
00098     virtual bool Initialize(const FSSpec &pMacFileSpec);
00099     virtual bool Initialize(const FSRef &pMacFileRef);
00100     virtual bool Initialize(const CFURLRef &pMacURL);
00101 #endif
00102 
00106     virtual KString GetFileName();
00107 
00115     virtual void ProgressUpdate(char* pTitle, char* pMessage, char* pDetail, float pPercentDone);
00116 
00121 
00125     KError& GetError();
00126 
00141     typedef enum
00142     {
00143         eFILE_CORRUPTED,
00144         eFILE_VERSION_NOT_SUPPORTED_YET,
00145         eFILE_VERSION_NOT_SUPPORTED_ANYMORE,
00146         eFILE_NOT_OPENED,
00147         eFILE_NOT_CREATED,
00148         eOUT_OF_DISK_SPACE,
00149         eUNINITIALIZED_FILENAME,
00150         eUNIDENTIFIED_ERROR,
00151         eINDEX_OUT_OF_RANGE,
00152         ePASSWORD_ERROR,
00153         eSTREAM_OPTIONS_NOT_SET,
00154         eEMBEDDED_OUT_OF_SPACE,
00155         eERROR_COUNT
00156     } EError;
00157 
00161     EError GetLastErrorID() const;
00162 
00166     const char* GetLastErrorString() const;
00167 
00171     void GetMessage(KString& pMessage) const;
00172 
00174 
00176 //
00177 //  WARNING!
00178 //
00179 //  Anything beyond these lines may not be documented accurately and is
00180 //  subject to change without notice.
00181 //
00183 
00184 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00185 
00186 protected:
00187 
00188     KFbxIO(KFbxSdkManager& pManager,char const* pName);
00189     virtual ~KFbxIO();
00190 
00191     KError mError;
00192     KString mFilename;
00193     KFbxSdkManager* mManager;
00194     KFbxStreamOptions* mStreamOptions;
00195     KString mMessage;
00196 
00197 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00198 
00199 };
00200 
00201 #include <fbxfilesdk_nsend.h>
00202 
00203 #endif // #ifndef _FBXSDK_IO_H_
00204 
00205