diff -r 17af172ffa5f -r 630d2f34d719 telephonyserverplugins/simatktsy/utility/src/tsatutility.cpp --- a/telephonyserverplugins/simatktsy/utility/src/tsatutility.cpp Thu Aug 19 11:03:36 2010 +0300 +++ b/telephonyserverplugins/simatktsy/utility/src/tsatutility.cpp Tue Aug 31 16:23:08 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -20,8 +20,13 @@ // INCLUDE FILES + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "tsatutilityTraces.h" +#endif + #include "tsatutility.h" // Class header -#include "tflogger.h" // TFLOGSTRING #include // TON and NPI constants // ----------------------------------------------------------------------------- @@ -36,7 +41,7 @@ RSat::TNumberingPlan* aNpi ) { - TFLOGSTRING( "UTILITY: TSatUtility::TonAndNpi" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_TONANDNPI_1, "UTILITY: TSatUtility::TonAndNpi" ); TInt ton( ( aTonAndNpi >> 4 ) & KTONMask ); // TON mask value 0x07 switch ( ton ) @@ -152,7 +157,7 @@ TDes8& aTarget ) { - TFLOGSTRING( "UTILITY: TSatUtility::Packed7to8Unpacked" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_PACKED7TO8UNPACKED_1, "UTILITY: TSatUtility::Packed7to8Unpacked" ); TInt ret( KErrNone ); // The string is in packed GSM default alphabet format. // Converted to 8-bit format @@ -198,9 +203,7 @@ if ( length < sourceLength ) { ret = KErrOverflow; - TFLOGSTRING2( "UTILITY: TSatUtility::Packed7to8Unpacked,\ - Input data too long. %d bytes could not be converted", - ( sourceLength - length ) ); + OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_PACKED7TO8UNPACKED_2, "UTILITY: TSatUtility::Packed7to8Unpacked,Input data too long. %d bytes could not be converted", ( sourceLength - length ) ); } return ret; @@ -217,7 +220,7 @@ TDes8& aOutput ) { - TFLOGSTRING( "UTILITY: TSatUtility::UCSToPacked7" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_UCSTOPACKED7_1, "UTILITY: TSatUtility::UCSToPacked7" ); TBuf8 string; @@ -284,7 +287,7 @@ TDes8& aOutput ) { - TFLOGSTRING( "UTILITY: TSatUtility::BCDToAscii" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_BCDTOASCII_1, "UTILITY: TSatUtility::BCDToAscii" ); TInt ret( KErrNone ); // Convert Abbreviated dialling numbers format back to ASCII format. @@ -311,8 +314,7 @@ if ( length < aInput.Length() ) { ret = KErrOverflow; - TFLOGSTRING2( "UTILITY: TSatUtility::BCDToAscii,Input data too long.\ - %d bytes could not be converted", ( aInput.Length() - length ) ); + OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_BCDTOASCII_2, "UTILITY: TSatUtility::BCDToAscii,Input data too long.%d bytes could not be converted", ( aInput.Length() - length ) ); } return ret; @@ -330,7 +332,7 @@ TDes8& aOutput ) { - TFLOGSTRING( "UTILITY: TSatUtility::AsciiToBCD" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_ASCIITOBCD_1, "UTILITY: TSatUtility::AsciiToBCD" ); TInt ret( KErrNone ); TInt i; TInt j; @@ -373,7 +375,7 @@ } else { - TFLOGSTRING( "UTILITY: TSatUtility::AsciiToBCD, Overflow!" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_ASCIITOBCD_2, "UTILITY: TSatUtility::AsciiToBCD, Overflow!" ); ret = KErrOverflow; } @@ -381,8 +383,7 @@ } else { - TFLOGSTRING3("UTILITY: TSatUtility::AsciiToBCD -- dropped \ - character %d at i=%d", TInt( aInput[i] ), i ); + OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_ASCIITOBCD_3, "UTILITY: TSatUtility::AsciiToBCD -- dropped character %d at i=%d", TInt( aInput[i] ), i ); } } // For @@ -408,7 +409,7 @@ TDes8& aOutput ) { - TFLOGSTRING( "UTILITY: TSatUtility::RemoveWildAndExpansionDigit" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_REMOVEWILDANDEXPANSIONDIGIT_1, "UTILITY: TSatUtility::RemoveWildAndExpansionDigit" ); aOutput.Zero(); TUint8 i( 0 ); TInt maxLength = aOutput.MaxLength(); @@ -436,7 +437,7 @@ TDes& aAlphaId ) { - TFLOGSTRING( "UTILITY: TSatUtility::SetAlphaId" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_SETALPHAID_1, "UTILITY: TSatUtility::SetAlphaId" ); if ( ( KUCS2ArabicCoding == aRawData[0] ) || ( KUCS2GreekCoding == aRawData[0] ) || ( KUCS2TurkishCoding == aRawData[0] ) ) @@ -463,7 +464,7 @@ const TInt aTime ) { - TFLOGSTRING( "UTILITY: TSatUtility::ConvertToSemiOctet" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_CONVERTTOSEMIOCTET_1, "UTILITY: TSatUtility::ConvertToSemiOctet" ); // Converting given time to meet the TP-Service-Centre-Time-Stamp format in // 3GPP TS 23.040. @@ -484,7 +485,7 @@ TDes16& aOutput ) { - TFLOGSTRING( "UTILITY: TSatUtility::Convert7BitToUnicode16" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_CONVERT7BITTOUNICODE16_1, "UTILITY: TSatUtility::Convert7BitToUnicode16" ); TInt i( 0 ); aOutput.Zero(); @@ -582,7 +583,7 @@ TDes8& aOutput ) { - TFLOGSTRING( "UTILITY: TSatUtility::ConvertUnicode16To7Bit" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_CONVERTUNICODE16TO7BIT_1, "UTILITY: TSatUtility::ConvertUnicode16To7Bit" ); TInt i( 0 ); TInt j( 0 ); TInt ret( KErrNone ); @@ -616,9 +617,7 @@ if ( length < aInput.Length() ) { ret = KErrOverflow; - TFLOGSTRING2( "UTILITY: TSatUtility::ConvertUnicode16To7Bit,\ - Input data too long. %d bytes could not be converted", - ( aInput.Length() - length ) ); + OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_CONVERTUNICODE16TO7BIT_2, "UTILITY: TSatUtility::ConvertUnicode16To7Bit,Input data too long. %d bytes could not be converted", ( aInput.Length() - length ) ); } return ret; @@ -635,7 +634,7 @@ RSat::TDuration& aTDuration ) { - TFLOGSTRING( "UTILITY: TSatUtility::FillDurationStructure" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_FILLDURATIONSTRUCTURE_1, "UTILITY: TSatUtility::FillDurationStructure" ); CTlv duration; aTDuration.iTimeUnit = RSat::ENoDurationAvailable; TInt returnValue( aBerTlv.TlvByTagValue( @@ -686,7 +685,7 @@ const TInt aItemNmb ) { - TFLOGSTRING( "UTILITY: TSatUtility::FillIconStructure" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_FILLICONSTRUCTURE_1, "UTILITY: TSatUtility::FillIconStructure" ); CTlv iconId; aTIconId.iQualifier = RSat::ENoIconId; TInt returnValue( aBerTlv.TlvByTagValue( &iconId, KTlvIconIdentifierTag, @@ -719,7 +718,7 @@ TDes& aUnicodeOutput ) { - TFLOGSTRING( "UTILITY: TSatUtility::SetText" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_SETTEXT_1, "UTILITY: TSatUtility::SetText" ); if ( aTextTlv.GetLength() ) { TPtrC8 sourceString; @@ -780,7 +779,7 @@ TDes& aTarget ) { - TFLOGSTRING( "UTILITY: TSatUtility::ConvertAlphaFieldsToUnicode" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_CONVERTALPHAFIELDSTOUNICODE_1, "UTILITY: TSatUtility::ConvertAlphaFieldsToUnicode" ); // ArabicCoding, GreekCoding and TurkishCoding have different coding // methods. There is a tag for each type of alphabet (resp. 80, 81 or 82) // before the text, and there are base pointers used for expanding 1 byte @@ -883,14 +882,14 @@ TDes8& aTarget ) { - TFLOGSTRING( "UTILITY: TSatUtility::Copy16to8LE" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_COPY16TO8LE_1, "UTILITY: TSatUtility::Copy16to8LE" ); TInt ret( KErrNone ); TInt length( 0 ); // Checks that data length are acceblable if ( aSource.Size() > aTarget.MaxSize() ) { - TFLOGSTRING( "UTILITY: TSatUtility::Copy16to8LE, Length exceeded!" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_COPY16TO8LE_2, "UTILITY: TSatUtility::Copy16to8LE, Length exceeded!" ); ret = KErrOverflow; length = ( aTarget.MaxSize() / 2 ); } @@ -920,7 +919,7 @@ TDes16& aTarget ) { - TFLOGSTRING( "UTILITY: TSatUtility::Copy8to16LE" ); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_COPY8TO16LE_1, "UTILITY: TSatUtility::Copy8to16LE" ); TInt ret( KErrNone ); // Check out which string is the shortest and use its length as a limit TInt length ( Min( ( ( aSource.Length() / 2 ) * 2 ), aTarget.MaxSize() ) ); @@ -935,9 +934,7 @@ if ( length < aSource.Length() ) { ret = KErrOverflow; - TFLOGSTRING2( "UTILITY: TSatUtility::ConvertUnicode16To7Bit,\ - Input data too long. %d bytes could not be converted", - ( aSource.Length() - length ) ); + OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_COPY8TO16LE_2, "UTILITY: TSatUtility::ConvertUnicode16To7Bit,Input data too long. %d bytes could not be converted", ( aSource.Length() - length ) ); } return ret; @@ -955,7 +952,7 @@ const TUint8 aDcs ) { - TFLOGSTRING("UTILITY: TSatUtility::DecodeCbsDcs"); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_DECODECBSDCS_1, "UTILITY: TSatUtility::DecodeCbsDcs"); // Constant values are not defined in order to // avoid confusion with too many constants names. @@ -1038,7 +1035,7 @@ default: { // the DCS value is reserved. - TFLOGSTRING("UTILITY: TSatUtility::DecodeCbsDcs, reserved value"); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_DECODECBSDCS_2, "UTILITY: TSatUtility::DecodeCbsDcs, reserved value"); break; } } @@ -1058,7 +1055,7 @@ const TInt aIndex ) { - TFLOGSTRING("UTILITY: TSatUtility::CopyTwo8toOne16LE"); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_COPYTWO8TOONE16LE_1, "UTILITY: TSatUtility::CopyTwo8toOne16LE"); TInt ret( KErrNone ); // Check first that we dont try to read data that is not there.. if ( aSource.Length() > aIndex + 1 ) @@ -1069,8 +1066,7 @@ else { ret = KErrOverflow; - TFLOGSTRING3("UTILITY: TSatUtility::CopyTwo8toOne16LE, Index too high\ - Index: %d, Source data length: %d", aIndex, aSource.Length() ); + OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSATUTILITY_COPYTWO8TOONE16LE_2, "UTILITY: TSatUtility::CopyTwo8toOne16LE, Index too highIndex: %d, Source data length: %d", aIndex, aSource.Length() ); } return ret;