phoneclientserver/EnPolicy/Src/DosEnPolicy/CDOSEmergencyNumberPolicy.cpp
branchRCL_3
changeset 44 987c9837762f
parent 43 7d48bed6ce0c
equal deleted inserted replaced
43:7d48bed6ce0c 44:987c9837762f
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    20 #include "cdosemergencynumberpolicy.h" 
    20 #include "CDOSEmergencyNumberPolicy.h"
    21 #include <mmtsy_names.h>
    21 #include <mmtsy_names.h>
    22 #include <telservicesvariant.hrh>
    22 #include <telservicesvariant.hrh>
    23 
    23 
    24 #include <centralrepository.h>
    24 #include <centralrepository.h>
    25 #include <telservicesinternalcrkeys.h>
    25 #include <telservicesinternalcrkeys.h>
   317             {
   317             {
   318             return EFalse;
   318             return EFalse;
   319             }
   319             }
   320         }
   320         }
   321         
   321         
   322     //match is wrong, only part of ememergency number is matched
   322 	//match is wrong, only part of ememergency number is matched
   323     int newmatchlen = 0;
   323 	int newmatchlen = 0;
   324     for (int i = place; i < iProductSpecificList.Length(); i++)
   324 	for (int i = place; i < iProductSpecificList.Length(); i++)
   325         {
   325 		{
   326         if(iProductSpecificList [i] != KEnPolicySDNumberSeparator )
   326 		if(iProductSpecificList [i] != KEnPolicySDNumberSeparator )
   327             newmatchlen++;
   327 			newmatchlen++;
   328         else
   328 		else
   329             break;  
   329 			break;	
   330         }
   330 		}
   331         
   331 		
   332         if (length != newmatchlen)
   332 		if (length != newmatchlen)
   333             {
   333 			{
   334             return EFalse;
   334 			return EFalse;
   335             }
   335 			}
   336         
   336 		
   337 
   337 
   338     // if we get so far, its ok.
   338     // if we get so far, its ok.
   339     return ETrue;
   339     return ETrue;
   340     }
   340     }
   341     
   341     
   347 //
   347 //
   348 // -----------------------------------------------------------------------------
   348 // -----------------------------------------------------------------------------
   349 //
   349 //
   350 void CDosEmergencyNumberPolicy::ParseNumber( TPhCltTelephoneNumber& aTelNumber )
   350 void CDosEmergencyNumberPolicy::ParseNumber( TPhCltTelephoneNumber& aTelNumber )
   351     {
   351     {
   352     // Does number contains prefix. If yes then remove it
   352 	// Does number contains prefix. If yes then remove it
   353     
   353 	
   354     if ( 0 == aTelNumber.FindC( KSipPrefix ) ||
   354     if ( 0 == aTelNumber.FindC( KSipPrefix ) ||
   355          0 == aTelNumber.FindC( KTelPrefix ) ||
   355          0 == aTelNumber.FindC( KTelPrefix ) ||
   356            0 == aTelNumber.FindC( KSosPrefix ) )
   356 	       0 == aTelNumber.FindC( KSosPrefix ) )
   357         {
   357         {
   358         aTelNumber.Delete( 0, KPrefixLength );
   358         aTelNumber.Delete( 0, KPrefixLength );
   359           }
   359 	      }
   360         // Does Number contains domain part. If yes remove it at beging of @ character.
   360 	    // Does Number contains domain part. If yes remove it at beging of @ character.
   361       TInt atIndex = aTelNumber.Find( KAt );
   361       TInt atIndex = aTelNumber.Find( KAt );
   362       TInt telNumberLength = aTelNumber.Length();
   362       TInt telNumberLength = aTelNumber.Length();
   363         if ( 0 < atIndex && 
   363 	    if ( 0 < atIndex && 
   364              atIndex < telNumberLength )
   364 	         atIndex < telNumberLength )
   365         {
   365         {
   366             aTelNumber.Delete( atIndex, telNumberLength - atIndex );
   366 		    aTelNumber.Delete( atIndex, telNumberLength - atIndex );
   367             }
   367 		    }
   368     }
   368     }
   369 
   369 
   370 // -----------------------------------------------------------------------------
   370 // -----------------------------------------------------------------------------
   371 // CDosEmergencyNumberPolicy::HandleNotifyString
   371 // CDosEmergencyNumberPolicy::HandleNotifyString
   372 // 
   372 //