FBX SDK Reference Guide: kfbxrenamingstrategybase.h Source File
00001 /**************************************************************************************
00002 
00003 Copyright (C) 2008 Autodesk, Inc. and/or its licensors.
00004 All Rights Reserved.
00005 
00006 The coded instructions, statements, computer programs, and/or related material 
00007 (collectively the "Data") in these files contain unpublished information 
00008 proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00009 Canada and United States of America federal copyright law and by international 
00010 treaties. 
00011 
00012 The Data may not be disclosed or distributed to third parties, in whole or in
00013 part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00014 
00015 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00016 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00017 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00018 BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00019 NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00020 WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00021 OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00022 
00023 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00024 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00025 OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00026 SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00027 OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00028 HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00029 FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00030 ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00031 WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00032 OR DAMAGE. 
00033 
00034 **************************************************************************************/
00035 
00036 #ifndef _KFBX_RENAMING_STRATEGY_BASE_H_
00037 #define _KFBX_RENAMING_STRATEGY_BASE_H_
00038 
00039 #include <fbxfilesdk/kfbxplugins/kfbxscene.h>
00040 #include <fbxfilesdk/components/kbaselib/klib/kname.h>
00041 
00042 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00043 //Base class for renaming strategy.
00044 class KFBX_DLL KFbxRenamingStrategyBase
00045 {
00046 public:
00047 
00048     //default constructor
00049     KFbxRenamingStrategyBase();
00050 
00051     //constructor
00052     KFbxRenamingStrategyBase(char pNameSpaceSymbol);
00053 
00054     //destructor
00055     virtual ~KFbxRenamingStrategyBase();
00056 
00057     //This put all the names in the scene back to the original values
00058     //Returns true if some names have been modified.
00059     virtual bool DecodeScene(KFbxScene* pScene)=0;
00060 
00061     //This renames all the names in the scene
00062     //Returns true if some names have been modified.
00063     virtual bool EncodeScene(KFbxScene* pScene)=0;
00064 
00065     //This find the original name of a given string
00066     //Returns true if the name has been modified.
00067     virtual bool DecodeString(KName& pString)=0;
00068 
00069     //This find the renaming name of a given string
00070     //Returns true if the name has been modified.
00071     virtual bool EncodeString(KName& pString)=0;
00072 
00073     virtual void CleanUp();
00074 
00075     struct NameCell
00076     {
00077         NameCell(char const* pName) :
00078     mName(pName),
00079         mInstanceCount(0)
00080     {
00081     }
00082 
00083     KString mName;
00084     int mInstanceCount;     
00085     };    
00086 
00087     char                     mNamespaceSymbol;
00088     KCharPtrSet                 mStringNameArray;
00089 
00090 };
00091 
00092 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00093 
00094 #endif