FBX SDK Reference Guide: kfbxrenamingstrategyutilities.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 #ifndef _KFBX_RENAMING_STRATEGY_UTILITIES_H_
00036 #define _KFBX_RENAMING_STRATEGY_UTILITIES_H_
00037 
00038 #include <fbxfilesdk/components/kbaselib/klib/kstring.h>
00039 #include <fbxfilesdk/kfbxplugins/kfbxscene.h>
00040 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00041 #define NAMECLASH1_KEY      "_ncl1_" // name (x)
00042 #define NAMECLASH2_KEY      "_ncl2_" // Upper/lower cases clash
00043 
00044 #define UPPERTOLOWER_KEY    "ul"
00045 #define LOWERTOUPPER_KEY    "lu"
00046 
00047 
00048 class KFBX_DLL KFbxRenamingStrategyUtilities
00049 {
00050 public:
00051 
00052     //Check if the string has non alphanumeric values
00053     //if so, change that character by: FBXASC### where ### is the ascii value
00054     //There's a boolean that says if the first char must be alpha only.
00055     static bool EncodeNonAlpha(KString &pString, bool pFirstCharMustBeAlphaOnly=false, KString pPermittedChars="");
00056 
00057     //Take a string that has been encoded by EncodeNonAlpha and reextract the non
00058     //alphanumeric values.
00059     static bool DecodeNonAlpha(KString &pString);
00060 
00061     //ALWAYS call Encode Duplicate BEFORE Encode Case Insensitive.
00062 
00063 
00064     //This will will add the _ncl1_ with the provided pInstanceNumber to the string
00065     //Will always return true
00066     static bool EncodeDuplicate(KString &pString, int pInstanceNumber=0);
00067 
00068     //This will remove the _ncl1_xxx to the string
00069     //Will return true if the pstring has been modified
00070     static bool DecodeDuplicate(KString &pString);
00071 
00072     //This will compare string1 and string2 must be identical except for casing.
00073     //This will compare string 1 and string 2, set string 1 to string2 and append the ncl2 suffix to it
00074     //will return true if pString has been modified
00075     static bool EncodeCaseInsensitive(KString &pString, const KString pString2);
00076 
00077     //This will decode a string that has a ncl2 to it
00078     //Will return true if pString has been modified
00079     static bool DecodeCaseInsensitive(KString &pString);
00080 
00081 };
00082 
00083 
00084 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00085 #endif