imgtools/romtools/rofsbuild/r_build.cpp
changeset 640 ac0bbc1e5d79
parent 626 ac03b93ca9c4
child 654 7c11c3d8d025
equal deleted inserted replaced
639:0e65f93be3cb 640:ac0bbc1e5d79
    56 #include "cache/cachegenerator.hpp"
    56 #include "cache/cachegenerator.hpp"
    57 #include "cache/cachevalidator.hpp"
    57 #include "cache/cachevalidator.hpp"
    58 #include "cache/cacheablelist.hpp"
    58 #include "cache/cacheablelist.hpp"
    59 #include "cache/cachemanager.hpp"
    59 #include "cache/cachemanager.hpp"
    60 
    60 
       
    61 #include "uniconv.hpp"
    61 extern TUint checkSum(const void* aPtr);
    62 extern TUint checkSum(const void* aPtr);
    62 
    63 
    63 extern ECompression gCompress;
    64 extern ECompression gCompress;
    64 extern TUint gCompressionMethod;
    65 extern TUint gCompressionMethod;
    65 extern TInt  gCodePagingOverride;
    66 extern TInt  gCodePagingOverride;
    66 extern TInt  gDataPagingOverride;
    67 extern TInt  gDataPagingOverride;
    67 extern TInt  gLogLevel;
    68 extern TInt  gLogLevel;
    68 extern bool gCache;
    69 extern bool gCache;
       
    70 extern TBool gIsOBYUTF8;
    69 TBool gDriveImage=EFalse;	// for drive image support.
    71 TBool gDriveImage=EFalse;	// for drive image support.
    70 
    72 
    71 
    73 
    72 TInt TRomNode::Count=0;
    74 TInt TRomNode::Count=0;
    73 TRomNode* TRomNode::TheFirstNode = NULL;
    75 TRomNode* TRomNode::TheFirstNode = NULL;
   788 iFirstDllDataEntry(0),	iName(0),iFileName(0),iNext(0), iNextInArea(0),
   790 iFirstDllDataEntry(0),	iName(0),iFileName(0),iNext(0), iNextInArea(0),
   789 iExecutable(EFalse), iFileOffset(EFalse), iCompressEnabled(0),
   791 iExecutable(EFalse), iFileOffset(EFalse), iCompressEnabled(0),
   790 iHidden(0), iRomNode(0), iRealFileSize(0)
   792 iHidden(0), iRomNode(0), iRealFileSize(0)
   791 {
   793 {
   792 	if (aFileName)
   794 	if (aFileName)
       
   795 	{
   793    		iFileName = NormaliseFileName(aFileName);
   796    		iFileName = NormaliseFileName(aFileName);
       
   797    		if(gIsOBYUTF8 && !UniConv::IsPureASCIITextStream(iFileName))
       
   798    		{
       
   799 			char* tempnname = strdup(iFileName);
       
   800 			unsigned int namelen = 0;
       
   801 			if(UniConv::UTF82DefaultCodePage(tempnname, strlen(tempnname), &iFileName, &namelen) < 0)
       
   802 				Print(EError, "Invalid filename encoding: %s\n", tempnname);
       
   803 			free(tempnname);
       
   804    		}
       
   805 	}
   794 	if (aName)
   806 	if (aName)
       
   807 	{
   795 		iName = NormaliseFileName(aName);
   808 		iName = NormaliseFileName(aName);
       
   809 		if(!gIsOBYUTF8 && !UniConv::IsPureASCIITextStream(iName))
       
   810 		{
       
   811 			char* tempnname = strdup(iName);
       
   812 			unsigned int namelen = 0;
       
   813 			if(UniConv::DefaultCodePage2UTF8(tempnname, strlen(tempnname), &iName, &namelen) < 0)
       
   814 				Print(EError, "Invalid filename encoding: %s\n", tempnname);
       
   815 			free(tempnname);
       
   816 		}
       
   817 	}
   796 	memset(iUids,0 ,sizeof(TCheckedUid));
   818 	memset(iUids,0 ,sizeof(TCheckedUid));
   797 }
   819 }
   798 //
   820 //
   799 // Destructor
   821 // Destructor
   800 //
   822 //