imgtools/imglib/patchdataprocessor/include/patchdataprocessor.h
changeset 0 044383f39525
child 590 360bd6b35136
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * Class for Patching Exported Data 
       
    16 * @internalComponents
       
    17 * @released
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 #ifndef PATCHDATAPROCESSOR_H
       
    23 #define PATCHDATAPROCESSOR_H
       
    24 
       
    25 #ifdef _MSC_VER
       
    26 	#pragma warning(disable: 4786) // identifier was truncated to '255' characters in the debug information
       
    27 #endif
       
    28 
       
    29 #include <e32def.h>
       
    30 
       
    31 #ifdef _L
       
    32 #undef _L
       
    33 #endif
       
    34 
       
    35 #include <iostream>
       
    36 #include <vector>
       
    37 #include <map>
       
    38 #include <sstream>
       
    39 
       
    40 typedef std::string String;
       
    41 typedef std::vector<String> StringVector;
       
    42 typedef std::vector<StringVector> VectorOfStringVector;
       
    43 typedef std::map<String,String> MapOfString;
       
    44 typedef std::map<String,String>::iterator MapOfStringIterator;
       
    45 typedef std::ostringstream OutputStringStream; 
       
    46 
       
    47 /**
       
    48 Class for patching exported data.
       
    49 
       
    50 @internalComponent
       
    51 @released
       
    52 */
       
    53 class CPatchDataProcessor
       
    54 {
       
    55 	VectorOfStringVector iPatchDataStatements; // Vector of string containing patchdata statements.
       
    56 	MapOfString iRenamedFileMap; // Map containing information of renamed files. 
       
    57 
       
    58 public:	
       
    59 	void AddPatchDataStatement(StringVector aPatchDataStatement);
       
    60 	void AddToRenamedFileMap(String aCurrentName, String aNewName);
       
    61 	VectorOfStringVector GetPatchDataStatements() const;
       
    62 	MapOfString GetRenamedFileMap() const;		
       
    63 };
       
    64 
       
    65 
       
    66 class TRomNode;
       
    67 
       
    68 /**
       
    69 Class to form a patchdata linked-list contatining symbol size, address/ordinal 
       
    70 new value to be patched.
       
    71 
       
    72 @internalComponent
       
    73 @released
       
    74 */
       
    75 class DllDataEntry
       
    76 {
       
    77 	
       
    78 public:
       
    79 	DllDataEntry(TUint32 aSize, TUint32 aNewValue) :
       
    80 				 iSize(aSize), iDataAddress((TUint32)-1), iOrdinal((TUint32)-1), iOffset(0),
       
    81 				 iNewValue(aNewValue), iRomNode(NULL), iNextDllEntry(NULL)
       
    82 	{
       
    83 	}
       
    84 
       
    85 
       
    86 	TUint32			iSize;
       
    87 	TLinAddr		iDataAddress;
       
    88 	TUint32			iOrdinal;
       
    89 	TUint32			iOffset;
       
    90 	TUint32			iNewValue;
       
    91 	TRomNode*		iRomNode;
       
    92 	DllDataEntry*	iNextDllEntry;
       
    93  
       
    94  	void			AddDllDataEntry(DllDataEntry*);
       
    95 	DllDataEntry*	NextDllDataEntry() const;
       
    96 };
       
    97 
       
    98 #endif //PATCHDATAPROCESSOR_H