commsfwtools/preparedefaultcommsdatabase/Tools/ceddump/inc/ceddumper.h
changeset 0 dfb7c4ff071f
child 25 9d7ce34704c8
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Contains the global definitions needed across the ceddump module/exe
       
    15 //
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @publishedAll
       
    21  @released
       
    22 */
       
    23 
       
    24 #ifndef CEDDUMPER_H
       
    25 #define CEDDUMPER_H
       
    26 
       
    27 
       
    28 #include <e32base.h>
       
    29 #include "filedump.h"
       
    30 #include "ceddumpglobals.h"
       
    31 
       
    32 #ifdef SYMBIAN_NETWORKING_3GPPDEFAULTQOS
       
    33 #include "R99QoSConversion.h"
       
    34 #endif
       
    35 
       
    36 class CConsoleBase;
       
    37 
       
    38 #define MAX_BUFFER_LEN          256 // max length of path/filename/column/table name
       
    39 #define MAX_COL_NAME_LEN        64
       
    40 #define MAX_ARG_LEN				(MAX_BUFFER_LEN * 3) // max length of arg list to program
       
    41 
       
    42 #ifdef __TOOLS2__
       
    43 #define DEFAULTCFGFILENAME		_S("cedout.cfg") //Default out put file ( .cfg format )
       
    44 #else
       
    45 #define DEFAULTCFGFILENAME		_S("C:\\cedout.cfg") //Default out put file ( .cfg format )
       
    46 #endif
       
    47 
       
    48 //_LIT(APPLICATIONNAME,"CommsData Database Dump Utility");
       
    49 //_LIT(APPLICATIONVERSION,"1.0");
       
    50 #define TRUE_VAL				_S("TRUE")
       
    51 #define FALSE_VAL				_S("FALSE")
       
    52 
       
    53 
       
    54 class CCedDumper : public CBase
       
    55 	{
       
    56 	public:
       
    57 		static CCedDumper* NewL();
       
    58 		~CCedDumper();
       
    59 
       
    60 		TInt OpenL();
       
    61 		void HelpDump();
       
    62 		TInt ProcessCommandLineL();
       
    63 		TBool ParseCommandLine();
       
    64 		void DumpContents();
       
    65 		void PrintError(TInt error);
       
    66 		void GetRecordTypeL(TMDBElementId aRecordElementId);
       
    67 		void WriteTableAttributes(TDesC &iTableName);
       
    68 		void WriteTemplateAndRecordsL();
       
    69 		void GetColumnAttributeAndValuesL(TInt aRecordId);
       
    70 		void ResetAllAttrubuteFlags();
       
    71 		TBool ConvertEnums(TPtrC &theColumn, TPtrC &setting);
       
    72 		TBool ConvertRecordLinks(TPtrC &theColumn, TPtrC &setting, CMDBElement* aField);
       
    73 		TBool IsLinkedField(TPtrC &theColumn, TPtrC &setting, CMDBElement& aField);
       
    74 
       
    75 #ifdef SYMBIAN_NETWORKING_3GPPDEFAULTQOS
       
    76 		CR99QoSConversion::TConvRecordType CheckAndPerformConversion(TPtrC &theColumn, TPtrC &setting);
       
    77 		void WriteR99Conversion();
       
    78 #endif
       
    79 // SYMBIAN_NETWORKING_3GPPDEFAULTQOS
       
    80 
       
    81 	protected:
       
    82 		void ConstructL();
       
    83 
       
    84 	private:
       
    85 		TBool FillBufferWithLink(TUint32 aIndex, TPtrC& aColumn, TPtrC& aSetting, CMDBElement* aField);
       
    86 
       
    87 		// This method can handle only Fields pointed by CMDBElement pointers!!!
       
    88 		TBool IsFieldValuesTheSame(CMDBElement* aFirstField, CMDBElement* aSecondField, TInt aFieldTypeValue);
       
    89 		
       
    90 		//This function is for resolving the inconsistent table names in CommsDat and CommDB - unfortunatly CED and CEDDUMP is using
       
    91 		//the CommDB variant. :(((((
       
    92 		//Please note: As long as the naming for the new follows the rule, which is to have the same name in the CommsDat and CommDB components,
       
    93 		//this function doesn't need to be modified.
       
    94 		void ResolveCommsDatTableNameVariant_to_CommdbTableNameVariant(RBuf& aCommsdatTableName);
       
    95 
       
    96 	private:
       
    97 		CMDBSession* iDbSession; // Session to connect to CenRep
       
    98 		CMDBRecordSetBase *iTable; //To get the Record type
       
    99 		CMDBRecordBase* iRecordBase;
       
   100 		CMDBRecordBase* iTemplateRecordBase;
       
   101 		CConsoleBase* iConsole; // Handle to write to console
       
   102 
       
   103 		CFileDump* iFileDumper; // Handle to write to output file
       
   104 
       
   105 		TBuf<MAX_BUFFER_LEN> iCfgFileName; // To hold the out put file name
       
   106 
       
   107 		TBool iIsHiddenSet;
       
   108 		TBool iIsPrivateSet;
       
   109 		TBool iIsProtectedReadSet;
       
   110 		TBool iIsProtectedWriteSet;
       
   111 
       
   112 #ifdef SYMBIAN_NETWORKING_3GPPDEFAULTQOS
       
   113 		TBool iR99Conversion; // flag indicating a conversion of QoS GPRS values from R97/98 to R99/R4
       
   114 		CR99QoSConversion *iR99ConversionRecordsHead;  	// uni direction list head of conversion output tables
       
   115 		CR99QoSConversion *iR99ConversionRecordsCurrent; 	// conversion output table which is being build
       
   116 #endif
       
   117 // SYMBIAN_NETWORKING_3GPPDEFAULTQOS
       
   118         TBool iUseHexFormat;
       
   119         TBool iROHIDSupport;
       
   120 	};
       
   121 
       
   122 #endif