adaptationlayer/tsy/nokiatsy_dll/src/tssparser.cpp
author mikaruus <mika.a.ruuskanen@nokia.com>
Thu, 14 Jan 2010 10:44:58 +0200
changeset 5 8ccc39f9d787
parent 0 63b37f68c1ce
child 9 8486d82aef45
permissions -rw-r--r--
New release based on our 2010wk02 release
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     1
/*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     2
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     3
* All rights reserved.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     8
*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     9
* Initial Contributors:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    11
*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    12
* Contributors:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    13
*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    14
* Description: 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    15
*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    16
*/
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    17
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    18
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    19
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    20
// INCLUDE FILES
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    21
#include "tssparser.h" // class definition file
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    22
#include "tsylogger.h"
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
    23
#include "OstTraceDefinitions.h"
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    24
#ifdef OST_TRACE_COMPILER_IN_USE
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
    25
#include "tssparserTraces.h"
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    26
#endif
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    27
 // for TSY logging
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    28
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    29
// ============================ MEMBER FUNCTIONS ===============================
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    30
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    31
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    32
// TSsParser::TSsParser()
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    33
// C++ default constructor can NOT contain any code, that
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    34
// might leave.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    35
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    36
//
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    37
TSsParser::TSsParser()
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    38
    {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    39
TFLOGSTRING( "TSY: TSsParser::TSsParser" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    40
OstTrace0( TRACE_NORMAL, TSSPARSER_TSSPARSER, "TSsParser::TSsParser" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    41
    iSsOperation = SS_OPERATION_UNDEFINED;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    42
    iServiceCode = SS_UNKNOWN_SERVICE;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    43
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    44
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    45
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    46
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    47
// TSsParser::Parse
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    48
// Parses a SS string
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    49
// (other items were commented in a header).
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    50
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    51
//
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    52
TInt TSsParser::Parse( const TDesC& aServiceString )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    53
    {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    54
TFLOGSTRING2( "TSY: TSsParser::Parse, servicestring: %S", &aServiceString );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    55
OstTraceExt1( TRACE_NORMAL, TSSPARSER_PARSE, "TSsParser::Parse;aServiceString=%S", aServiceString );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    56
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    57
    TInt error( KErrNone );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    58
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    59
    // at first check that service string is not too long
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    60
    if( MAX_LENGTH_OF_SERVICE_STRING < aServiceString.Length( ) ||
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    61
         0 >= aServiceString.Length( ) )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    62
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    63
TFLOGSTRING( "TSY: TSsParser::Parse, error: service string too long or does not exist!" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    64
OstTrace0( TRACE_NORMAL, DUP1_TSSPARSER_PARSE, "TSsParser::Parse, error: service string too long or does not exist!" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    65
        error = KErrArgument;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    66
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    67
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    68
    else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    69
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    70
        // copy service string to member variable for parsing
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    71
        iServiceString.Set( aServiceString );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    72
        // operation type: activation, deactivation, interrogation,
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    73
        // registration or erasure
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    74
        error = ExtractSsOperation( );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    75
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    76
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    77
    // If operation was parsed successfully, extract service code
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    78
    if( KErrNone == error )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    79
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    80
        TPtrC tempBuffer;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    81
        ExtractPart( tempBuffer );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    82
        // convert service code to integer
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    83
        iServiceCode = GetInt( tempBuffer );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    84
TFLOGSTRING2( "TSY: TSsParser::Parse, service code: %d", iServiceCode );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    85
OstTraceExt1( TRACE_NORMAL, DUP2_TSSPARSER_PARSE, "TSsParser::Parse;iServiceCode=%hu", iServiceCode );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    86
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    87
        if( SS_UNKNOWN_SERVICE == iServiceCode )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    88
            {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    89
            error = KErrArgument;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    90
TFLOGSTRING( "TSY: TSsParser::Parse, error: illegal sevice code!" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    91
OstTrace0( TRACE_NORMAL, DUP3_TSSPARSER_PARSE, "TSsParser::Parse, error: illegal sevice code!" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    92
            }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    93
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    94
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    95
    // service code was parsed successfully, extract supplementary infos a,b,c
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    96
    if( KErrNone == error )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    97
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    98
        TPtrC tempSiBuffer[MAX_NUM_OF_SUPPLEMENTARY_INFOS];
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    99
        TInt i( 0 );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   100
        TCharacter character( ECharacterIllegal );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   101
        // 3 supplementary info fields may exists, separated by '*'
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   102
        // and ended by '#'.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   103
        // possible combinations for supplementary info:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   104
        // *SIA*SIB*SIC#, *SIA*SIB#, *SIA**SIC#, *SIA#, **SIB*SIC#,
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   105
        // **SIB#, ***SIC#, # (from 3GPP TS 22.030)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   106
        for( i = 0; i <= MAX_NUM_OF_SUPPLEMENTARY_INFOS; i++ )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   107
            {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   108
            character = ExtractSeparator( );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   109
            if( ECharacterSeparator == character &&
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   110
                 i < MAX_NUM_OF_SUPPLEMENTARY_INFOS ) // last mark can't be '*'
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   111
                {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   112
                ExtractPart( tempSiBuffer[i] );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   113
                }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   114
            else if( ECharacterEndMark == character
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   115
                && !iServiceString.Length() )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   116
                {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   117
                // this was the end of string, and there's no more to be parsed
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   118
                break;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   119
                }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   120
            else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   121
                {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   122
                error = KErrArgument;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   123
TFLOGSTRING( "TSY: TSsParser::Parse, error: illegal end mark!" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   124
OstTrace0( TRACE_NORMAL, DUP4_TSSPARSER_PARSE, "TSsParser::Parse, error: illegal end mark!" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   125
                break;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   126
                }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   127
            }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   128
        iSupplementaryInfoA.Set( tempSiBuffer[0] );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   129
        iSupplementaryInfoB.Set( tempSiBuffer[1] );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   130
        iSupplementaryInfoC.Set( tempSiBuffer[2] );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   131
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   132
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   133
TFLOGSTRING2( "TSY: TSsParser::Parse, SS code: %d", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   134
OstTraceExt1( TRACE_NORMAL, DUP5_TSSPARSER_PARSE, "TSsParser::Parse;iSsOperation=%hhu", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   135
TFLOGSTRING2( "TSY: TSsParser::Parse, SS code: %d", iServiceCode );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   136
OstTraceExt1( TRACE_NORMAL, DUP6_TSSPARSER_PARSE, "TSsParser::Parse;iServiceCode=%hu", iServiceCode );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   137
TFLOGSTRING2( "TSY: TSsParser::Parse, SS info A: %S", &iSupplementaryInfoA );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   138
OstTraceExt1( TRACE_NORMAL, DUP7_TSSPARSER_PARSE, "TSsParser::Parse;iSupplementaryInfoA=%S", iSupplementaryInfoA );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   139
TFLOGSTRING2( "TSY: TSsParser::Parse, SS info B: %S", &iSupplementaryInfoB );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   140
OstTraceExt1( TRACE_NORMAL, DUP8_TSSPARSER_PARSE, "TSsParser::Parse;iSupplementaryInfoB=%S", iSupplementaryInfoB );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   141
TFLOGSTRING2( "TSY: TSsParser::Parse, SS info C: %S", &iSupplementaryInfoC );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   142
OstTraceExt1( TRACE_NORMAL, DUP9_TSSPARSER_PARSE, "TSsParser::Parse;iSupplementaryInfoC=%S", iSupplementaryInfoC );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   143
TFLOGSTRING2( "TSY: TSsParser::Parse, SS string left: %S", &iServiceString );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   144
OstTraceExt1( TRACE_NORMAL, DUP10_TSSPARSER_PARSE, "TSsParser::Parse;iServiceString=%S", iServiceString );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   145
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   146
    return error;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   147
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   148
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   149
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   150
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   151
// TSsParser::GetSsOperation
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   152
// Gets ss operation type
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   153
// (other items were commented in a header).
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   154
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   155
//
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   156
void TSsParser::GetSsOperation( TUint8& aSsOperation ) const
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   157
    {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   158
TFLOGSTRING( "TSY: TSsParser::GetSsOperation" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   159
OstTrace0( TRACE_NORMAL, TSSPARSER_GETSSOPERATION, "TSsParser::GetSsOperation" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   160
    aSsOperation = iSsOperation;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   161
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   162
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   163
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   164
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   165
// TSsParser::GetServiceCode
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   166
// Gets ss code
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   167
// (other items were commented in a header).
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   168
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   169
//
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   170
void TSsParser::GetServiceCode( TUint16& aServiceCode ) const
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   171
    {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   172
TFLOGSTRING("TSY: TSsParser::GetServiceCode" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   173
OstTrace0( TRACE_NORMAL, TSSPARSER_GETSERVICECODE, "TSsParser::GetServiceCode" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   174
    aServiceCode = iServiceCode;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   175
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   176
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   177
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   178
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   179
// TSsParser::GetServiceInfo
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   180
// Gets SS infos a,b and c. If does not exist, empty descriptor is returned
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   181
// (other items were commented in a header).
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   182
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   183
//
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   184
void TSsParser::GetServiceInfo(
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   185
    TPtrC& aSupplementaryInfoA,
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   186
    TPtrC& aSupplementaryInfoB,
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   187
    TPtrC& aSupplementaryInfoC ) const
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   188
    {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   189
TFLOGSTRING( "TSY: TSsParser::GetServiceInfo" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   190
OstTrace0( TRACE_NORMAL, TSSPARSER_GETSERVICEINFO, "TSsParser::GetServiceInfo" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   191
    aSupplementaryInfoA.Set( iSupplementaryInfoA );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   192
    aSupplementaryInfoB.Set( iSupplementaryInfoB );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   193
    aSupplementaryInfoC.Set( iSupplementaryInfoC );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   194
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   195
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   196
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   197
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   198
// TSsParser::ExtractSsOperation
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   199
// Parses operation type ( 1 or 2 first elements from service string )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   200
// (other items were commented in a header).
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   201
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   202
//
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   203
TUint8 TSsParser::ExtractSsOperation( )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   204
    {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   205
TFLOGSTRING( "TSY: TSsParser::ExtractSsOperation" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   206
OstTrace0( TRACE_NORMAL, TSSPARSER_EXTRACTSSOPERATION, "TSsParser::ExtractSsOperation" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   207
    TInt error( KErrNone );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   208
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   209
    // SS operation is one or two first characters in the service string
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   210
    if( iServiceString.Left( 2 ) == KSsOperationErasure )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   211
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   212
        iSsOperation = SS_ERASURE; // unregister and deactivate
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   213
        iServiceString.Set( iServiceString.Mid( 2 ) ); // extract remaining part
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   214
TFLOGSTRING2( "TSY: TSsParser::ExtractSsOperation, SS operation: erasure (%d)", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   215
OstTraceExt1( TRACE_NORMAL, DUP1_TSSPARSER_EXTRACTSSOPERATION, "TSsParser::ExtractSsOperation;SS operation: erasure (%hhu)", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   216
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   217
    else if( iServiceString.Left( 2 ) == KSsOperationInterrogation )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   218
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   219
        iSsOperation = SS_INTERROGATION; // check status
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   220
        iServiceString.Set( iServiceString.Mid ( 2 ) );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   221
TFLOGSTRING2( "TSY: TSsParser::ExtractSsOperation, SS operation: interrogation (%d)", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   222
OstTraceExt1( TRACE_NORMAL, DUP2_TSSPARSER_EXTRACTSSOPERATION, "TSsParser::ExtractSsOperation;SS operation: interrogation (%hhu)", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   223
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   224
    else if( iServiceString.Left( 2 ) == KSsOperationRegistration )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   225
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   226
        iSsOperation = SS_REGISTRATION; // register and activate
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   227
        iServiceString.Set( iServiceString.Mid( 2 ) );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   228
TFLOGSTRING2( "TSY: TSsParser::ExtractSsOperation, SS operation: registration (%d)", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   229
OstTraceExt1( TRACE_NORMAL, DUP3_TSSPARSER_EXTRACTSSOPERATION, "TSsParser::ExtractSsOperation;SS operation: registration (%hhu)", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   230
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   231
    else if( iServiceString.Left( 1 ) == KSsOperationActivation )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   232
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   233
        iSsOperation = SS_ACTIVATION; // activate
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   234
        iServiceString.Set( iServiceString.Mid( 1 ) );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   235
TFLOGSTRING2( "TSY: TSsParser::ExtractSsOperation, SS operation: activation (%d)", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   236
OstTraceExt1( TRACE_NORMAL, DUP4_TSSPARSER_EXTRACTSSOPERATION, "TSsParser::ExtractSsOperation;SS operation: activation (%hhu)", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   237
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   238
    else if( iServiceString.Left( 1 ) == KSsOperationDeactivation )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   239
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   240
        iSsOperation = SS_DEACTIVATION; // unregister
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   241
        iServiceString.Set( iServiceString.Mid( 1 ) );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   242
TFLOGSTRING2( "TSY: TSsParser::ExtractSsOperation, SS operation: deactivation (%d)", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   243
OstTraceExt1( TRACE_NORMAL, DUP5_TSSPARSER_EXTRACTSSOPERATION, "TSsParser::ExtractSsOperation;SS operation: deactivation (%hhu)", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   244
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   245
    else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   246
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   247
        iSsOperation = SS_OPERATION_UNDEFINED;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   248
TFLOGSTRING2( "TSY: TSsParser::ExtractSsOperation, SS operation: undefined (%d)", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   249
OstTraceExt1( TRACE_NORMAL, DUP6_TSSPARSER_EXTRACTSSOPERATION, "TSsParser::ExtractSsOperation;SS operation: undefined (%hhu)", iSsOperation );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   250
        error = KErrArgument;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   251
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   252
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   253
    return error;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   254
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   255
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   256
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   257
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   258
// TSsParser::ExtractPart
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   259
// Extras individual parts from service string
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   260
// (other items were commented in a header).
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   261
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   262
//
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   263
void TSsParser::ExtractPart( TPtrC& aPart )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   264
    {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   265
TFLOGSTRING( "TSY: TSsParser::ExtractPart" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   266
OstTrace0( TRACE_NORMAL, TSSPARSER_EXTRACTPART, "TSsParser::ExtractPart" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   267
    TUint i( 0 );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   268
    // service code and supplementary info ends to '*' or '#'
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   269
    // if there is no data to be extracted, empty buffer is returned.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   270
    while( i < iServiceString.Length( ) &&
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   271
           iServiceString[i] != '*' &&
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   272
           iServiceString[i] != '#' )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   273
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   274
        i++;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   275
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   276
    // extracted part is returned as reference variable
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   277
    aPart.Set( iServiceString.Left( i ) );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   278
TFLOGSTRING2( "TSY: TSsParser::ExtractPart, extracted string: %S", &aPart );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   279
OstTraceExt1( TRACE_NORMAL, DUP1_TSSPARSER_EXTRACTPART, "TSsParser::ExtractPart;aPart=%S", aPart );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   280
    // set remaining part of service string
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   281
    iServiceString.Set( iServiceString.Mid( i ) );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   282
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   283
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   284
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   285
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   286
// TSsParser::ExtractSeparator
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   287
// Extracts separator marks from service string
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   288
// (other items were commented in a header).
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   289
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   290
//
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   291
TCharacter TSsParser::ExtractSeparator( )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   292
    {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   293
TFLOGSTRING( "TSY: TSsParser::ExtractSeparator" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   294
OstTrace0( TRACE_NORMAL, TSSPARSER_EXTRACTSEPARATOR, "TSsParser::ExtractSeparator" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   295
    TCharacter mark( ECharacterIllegal );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   296
    // There should be at least the end mark '#' left in string
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   297
    if( iServiceString.Length() > 0 )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   298
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   299
        if( '#' == iServiceString[0] )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   300
            {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   301
TFLOGSTRING( "TSY: TSsParser::ExtractSeparator: end mark '#'" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   302
OstTrace0( TRACE_NORMAL, DUP1_TSSPARSER_EXTRACTSEPARATOR, "TSsParser::ExtractSeparator, end mark '#'" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   303
            mark = ECharacterEndMark;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   304
            }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   305
        else if( '*' == iServiceString[0] )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   306
            {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   307
TFLOGSTRING( "TSY: TSsParser::ExtractSeparator: separator mark '*'" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   308
OstTrace0( TRACE_NORMAL, DUP2_TSSPARSER_EXTRACTSEPARATOR, "TSsParser::ExtractSeparator, separator mark '*'" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   309
            mark = ECharacterSeparator;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   310
            }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   311
        // no else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   312
        iServiceString.Set( iServiceString.Mid( 1 ) );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   313
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   314
    else // end mark was missing
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   315
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   316
TFLOGSTRING( "TSY: TSsParser::ExtractSeparator: illegal ss string, no end mark!" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   317
OstTrace0( TRACE_NORMAL, DUP3_TSSPARSER_EXTRACTSEPARATOR, "TSsParser::ExtractSeparator, illegal ss string, no end mark!" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   318
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   319
    return mark;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   320
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   321
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   322
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   323
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   324
// TSsParser::GetInt
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   325
// Convert descriptor to integer
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   326
// (other items were commented in a header).
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   327
// -----------------------------------------------------------------------------
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   328
//
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   329
TInt TSsParser::GetInt( const TDesC& aString )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   330
    {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   331
TFLOGSTRING( "TSY: TSsParser::GetInt" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   332
OstTrace0( TRACE_NORMAL, TSSPARSER_GETINT, "TSsParser::GetInt" );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   333
    TInt code;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   334
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   335
    if( TLex( aString ).Val( code ) != KErrNone)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   336
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   337
        code = SS_ALL_TELE_AND_BEARER;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   338
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   339
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   340
    return code;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   341
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   342
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   343
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   344
//  End of File