mtpdataproviders/mtppictbridgedp/pictbridgeengine/src/dpsxmlparser.cpp
author hgs
Thu, 04 Nov 2010 15:31:42 +0800
changeset 60 841f70763fbe
parent 49 c20dd21d1eb4
permissions -rw-r--r--
201044_04
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     1
/*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     2
* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies).
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     3
* All rights reserved.
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     8
*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     9
* Initial Contributors:
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    11
*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    12
* Contributors:
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    13
*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    14
* Description:  This class parses the dps xml script. 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    15
*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    16
*/
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    17
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    18
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    19
#include "dpsxmlparser.h"
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    20
#include "dpsconst.h"
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    21
#include "pictbridge.h"
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    22
#include "dpsxmlstring.h"
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    23
#include "OstTraceDefinitions.h"
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    24
#ifdef OST_TRACE_COMPILER_IN_USE
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    25
#include "dpsxmlparserTraces.h"
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    26
#endif
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    27
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    28
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    29
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    30
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    31
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    32
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    33
CDpsXmlParser* CDpsXmlParser::NewL(CDpsEngine* aEngine)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    34
	{
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    35
    CDpsXmlParser* self = new (ELeave) CDpsXmlParser(aEngine);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    36
    return self;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    37
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    38
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    39
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    40
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    41
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    42
//	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    43
CDpsXmlParser::~CDpsXmlParser()
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    44
    {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    45
    OstTraceFunctionEntry0( CDPSXMLPARSER_CDPSXMLPARSER_DES_ENTRY );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    46
    iDpsArgs.Close();
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    47
    OstTraceFunctionExit0( CDPSXMLPARSER_CDPSXMLPARSER_DES_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    48
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    49
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    50
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    51
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    52
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    53
//	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    54
CDpsXmlParser::CDpsXmlParser(CDpsEngine* aEngine) : iEngine(aEngine)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    55
    {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    56
    OstTraceFunctionEntry0( DUP1_CDPSXMLPARSER_CDPSXMLPARSER_CONS_ENTRY );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    57
	Reset();
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    58
	OstTraceFunctionExit0( DUP1_CDPSXMLPARSER_CDPSXMLPARSER_CONS_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    59
	}
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    60
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    61
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    62
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    63
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    64
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    65
void CDpsXmlParser::OnStartDocumentL(
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    66
		const RDocumentParameters& /*aDocParam*/, TInt aErrorCode)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    67
    {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    68
    OstTraceFunctionEntry0( CDPSXMLPARSER_ONSTARTDOCUMENTL_ENTRY );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    69
    if (aErrorCode != KErrNone)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    70
        {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    71
        OstTrace1( TRACE_ERROR, CDPSXMLPARSER_ONSTARTDOCUMENTL, "---, error code is %d", aErrorCode );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    72
        User::Leave(aErrorCode);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    73
        }
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    74
	OstTraceFunctionExit0( CDPSXMLPARSER_ONSTARTDOCUMENTL_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    75
	}
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    76
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    77
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    78
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    79
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    80
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    81
void CDpsXmlParser::OnEndDocumentL(TInt aErrorCode)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    82
	{
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    83
    OstTraceFunctionEntry0( CDPSXMLPARSER_ONENDDOCUMENTL_ENTRY );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    84
    if (aErrorCode != KErrNone)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    85
        {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    86
        OstTrace1( TRACE_ERROR, CDPSXMLPARSER_ONENDDOCUMENTL, "---, error code is %d", aErrorCode );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    87
        User::Leave(aErrorCode);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    88
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    89
    
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
    90
    OstTraceFunctionExit0( CDPSXMLPARSER_ONENDDOCUMENTL_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    91
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    92
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    93
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    94
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    95
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    96
//	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    97
void CDpsXmlParser::OnStartElementL(const RTagInfo& aElement, 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    98
									const RAttributeArray& aAttributes, 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    99
									TInt aErrCode)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   100
    {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   101
    OstTraceFunctionEntry0( CDPSXMLPARSER_ONSTARTELEMENTL_ENTRY );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   102
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   103
    if (aErrCode != KErrNone)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   104
        {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   105
        OstTrace1( TRACE_ERROR, CDPSXMLPARSER_ONSTARTELEMENTL, "---, error code is %d", aErrCode );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   106
        User::Leave(aErrCode);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   107
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   108
    if (aAttributes.Count() > 1)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   109
        {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   110
        OstTrace0( TRACE_ERROR, DUP1_CDPSXMLPARSER_ONSTARTELEMENTL, "---cannot have more than one attribute!" );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   111
        User::Leave(KErrArgument);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   112
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   113
    	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   114
    // Gets the name of the tag
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   115
    const TDesC8& name = aElement.LocalName().DesC();
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   116
    
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   117
    OstTraceExt1( TRACE_NORMAL, DUP2_CDPSXMLPARSER_ONSTARTELEMENTL, "---Start---%s", name );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   118
    //Checks the element
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   119
    // this is the first layer <dps>
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   120
    if (!name.Compare(KDpsXml))
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   121
        {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   122
        iAction = EDpsXmlStart;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   123
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   124
    // this is the second layer	<input|output>
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   125
    else if (!name.Compare(KDpsXmlOutput))
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   126
        {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   127
        iAction = EDpsXmlOutput;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   128
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   129
    else if (!name.Compare(KDpsXmlInput))
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   130
        {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   131
        // operation and event cannot be distiguised here
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   132
        iAction = EDpsXmlInput;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   133
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   134
    // this is the third layer <operation|event|result>	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   135
    else if (iAction == EDpsXmlOutput && !name.Compare(KDpsXmlResult))
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   136
        {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   137
        // output must be result
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   138
        iAction = EDpsXmlResult;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   139
        }		
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   140
    else if (iAction == EDpsXmlInput &&
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   141
        (!name.Compare(iEngine->DpsParameters()->iDpsEventStrings[0]) ||
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   142
        !name.Compare(iEngine->DpsParameters()->iDpsEventStrings[1])))
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   143
        {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   144
        if (!name.Compare(iEngine->DpsParameters()->iDpsEventStrings[0]))
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   145
            {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   146
            iDpsEvent = EDpsEvtNotifyJobStatus;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   147
            }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   148
        else
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   149
            {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   150
            iDpsEvent = EDpsEvtNotifyDeviceStatus;	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   151
            }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   152
        iAction = EDpsXmlEvent;	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   153
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   154
    else if (iAction == EDpsXmlInput || iAction == EDpsXmlResult)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   155
        {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   156
        iAction = EDpsXmlOperation;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   157
        for (TInt i= 0; i < EDpsOpMax-1; i++) //i=0 as AppendL() method adds item on first free position in array
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   158
            {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   159
            if (!name.Compare(iEngine->DpsParameters()->iDpsOperationStrings[i]))
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   160
                {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   161
                OstTraceExt1( TRACE_NORMAL, DUP3_CDPSXMLPARSER_ONSTARTELEMENTL, "---found the operation---%s", name );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   162
                iDpsOperation = (TDpsOperation)(i+1);// i+1 to by pass first operation EDpsOpEmpty in enum which is not added to array
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   163
                break;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   164
                }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   165
            }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   166
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   167
		
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   168
    // below is the fourth layer, e.g. the argument list/element. there
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   169
    // could be many arugments, but only one element	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   170
    else if (iAction == EDpsXmlOperation || iAction == EDpsXmlEvent)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   171
        {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   172
        // only element in output is capability
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   173
        if (!name.Compare(iEngine->DpsParameters()->iDpsElementStrings[0]))
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   174
            {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   175
            OstTraceExt1( TRACE_NORMAL, DUP4_CDPSXMLPARSER_ONSTARTELEMENTL, "---the element is %s", name );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   176
            iElement = EDpsCapability;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   177
            }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   178
        else
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   179
            {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   180
            for (TInt i = 0; i < EDpsArgMax; i++)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   181
                {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   182
                if (!name.Compare(iEngine->DpsParameters()->iDpsArgStrings[i]))
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   183
                    {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   184
                    OstTraceExt1( TRACE_NORMAL, DUP5_CDPSXMLPARSER_ONSTARTELEMENTL, "---the argument is %s", name );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   185
                    TDpsArg arg;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   186
                    arg.iElement = (TDpsArgument)i;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   187
                    arg.iContent.Copy(_L(""));
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   188
                    iDpsArgs.Append(arg);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   189
                    break;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   190
                    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   191
                }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   192
            }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   193
		
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   194
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   195
    else
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   196
        {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   197
        // something wrong
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   198
        OstTraceExt1( TRACE_ERROR, DUP6_CDPSXMLPARSER_ONSTARTELEMENTL, "--- non-PB element! %S", name );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   199
        User::Leave(KErrNotSupported);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   200
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   201
    if (aAttributes.Count() == 1)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   202
        {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   203
        ParseAttributesL(aAttributes, name);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   204
        }
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   205
    OstTraceFunctionExit0( CDPSXMLPARSER_ONSTARTELEMENTL_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   206
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   207
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   208
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   209
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   210
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   211
//	     
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   212
void CDpsXmlParser::ParseAttributesL(const RAttributeArray& aAttributes, 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   213
                                     const TDesC8& tag)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   214
    {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   215
    OstTraceFunctionEntry0( CDPSXMLPARSER_PARSEATTRIBUTESL_ENTRY );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   216
    // element
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   217
    const TDesC8& name = aAttributes[0].Attribute().LocalName().DesC();
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   218
    // only "layouts" and "paperTypes" have attributes
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   219
    if (tag.Compare(KDpsXmlPaperTypes) && tag.Compare(KDpsXmlLayouts))
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   220
        {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   221
        // error
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   222
        OstTraceExt1( TRACE_ERROR, CDPSXMLPARSER_PARSEATTRIBUTESL, "--- this tag %s have no attribute", name );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   223
        User::Leave(KErrArgument);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   224
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   225
    // the element of the attributes must be "paperSize"	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   226
    if (name.Compare(KDpsXmlPaperSize))
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   227
        {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   228
        // error
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   229
        OstTraceExt1( TRACE_ERROR, DUP1_CDPSXMLPARSER_PARSEATTRIBUTESL, "--- wrong attribute--- %s", name );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   230
        User::Leave(KErrArgument);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   231
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   232
    // value
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   233
    HBufC8* value = aAttributes[0].Value().DesC().AllocLC();
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   234
    TUint32 result;    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   235
    TLex8 converter(*value);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   236
    TInt error = converter.Val(result, EHex);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   237
    if (error != KErrNone)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   238
        {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   239
        OstTrace1( TRACE_ERROR, DUP2_CDPSXMLPARSER_PARSEATTRIBUTESL, "--- convert error %d", error );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   240
        User::Leave(error);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   241
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   242
    iAttrib = result >> KShiftLength; 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   243
    CleanupStack::PopAndDestroy(value);
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   244
    OstTrace1( TRACE_NORMAL, DUP3_CDPSXMLPARSER_PARSEATTRIBUTESL, "--- attribte value %x", result );
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   245
  
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   246
    OstTraceFunctionExit0( CDPSXMLPARSER_PARSEATTRIBUTESL_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   247
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   248
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   249
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   250
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   251
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   252
//	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   253
void CDpsXmlParser::OnEndElementL(const RTagInfo& aElement, 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   254
								  TInt aErrorCode)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   255
    {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   256
    OstTraceFunctionEntry0( CDPSXMLPARSER_ONENDELEMENTL_ENTRY );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   257
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   258
    if (aErrorCode != KErrNone)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   259
        {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   260
        OstTrace1( TRACE_ERROR, CDPSXMLPARSER_ONENDELEMENTL, "--- error code is %d", aErrorCode );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   261
        User::Leave(aErrorCode);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   262
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   263
        
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   264
    // Get the name of the tag
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   265
    const TDesC8& name = aElement.LocalName().DesC();
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   266
    OstTraceExt1( TRACE_NORMAL, DUP1_CDPSXMLPARSER_ONENDELEMENTL, "%s", name );    
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   267
    OstTraceFunctionExit0( CDPSXMLPARSER_ONENDELEMENTL_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   268
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   269
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   270
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   271
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   272
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   273
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   274
void CDpsXmlParser::OnContentL(const TDesC8& aBytes, TInt aErrorCode)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   275
	{
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   276
    OstTraceFunctionEntry0( CDPSXMLPARSER_ONCONTENTL_ENTRY );
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   277
    OstTraceExt1( TRACE_NORMAL, CDPSXMLPARSER_ONCONTENTL, "content is %s", aBytes );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   278
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   279
    if (aErrorCode != KErrNone)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   280
   	    {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   281
        OstTrace1( TRACE_ERROR, DUP1_CDPSXMLPARSER_ONCONTENTL, "--- error code %d", aErrorCode );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   282
        User::Leave(aErrorCode);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   283
        }	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   284
    if (aBytes[0] >= KSOH && aBytes[0] <= KSpace)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   285
        {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   286
        OstTrace1( TRACE_NORMAl, DUP2_CDPSXMLPARSER_ONCONTENTL, "the unprintable char %d", aBytes[0] );
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   287
        OstTraceFunctionExit0( CDPSXMLPARSER_ONCONTENTL_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   288
        return; 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   289
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   290
    // parses the result	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   291
    if (iAction == EDpsXmlResult)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   292
        {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   293
        TUint32 value;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   294
        TLex8 converter(aBytes);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   295
        TInt error = converter.Val(value, EHex);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   296
        if (error != KErrNone)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   297
            {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   298
            OstTrace1( TRACE_ERROR, DUP3_CDPSXMLPARSER_ONCONTENTL, "--- convert error %d", error );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   299
            User::Leave(error);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   300
            }
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   301
        OstTrace1( TRACE_NORMAL, DUP4_CDPSXMLPARSER_ONCONTENTL, "--- result %x", value);
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   302
        
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   303
        // we have got the result
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   304
        iDpsResult.iMajorCode = 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   305
            static_cast<TDpsResultMajorCode>(value >> KShiftLength);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   306
        iDpsResult.iMinorCode = 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   307
            static_cast<TDpsResultMinorCode>(value & KDpsMinorMask);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   308
        }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   309
    // gets the argument	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   310
    else if (iAction == EDpsXmlOperation || iAction == EDpsXmlEvent)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   311
        {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   312
        iDpsArgs[iDpsArgs.Count() - 1].iContent.Copy(aBytes);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   313
        }
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   314
    OstTraceFunctionExit0( DUP1_CDPSXMLPARSER_ONCONTENTL_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   315
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   316
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   317
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   318
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   319
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   320
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   321
void CDpsXmlParser::OnStartPrefixMappingL(const RString& /*aPrefix*/, 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   322
										  const RString& /*aUri*/, 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   323
										  TInt aErrorCode)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   324
    {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   325
    OstTraceFunctionEntry0( CDPSXMLPARSER_ONSTARTPREFIXMAPPINGL_ENTRY );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   326
    if (aErrorCode != KErrNone)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   327
        {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   328
        OstTrace1( TRACE_ERROR, CDPSXMLPARSER_ONSTARTPREFIXMAPPINGL, "--- error code %d", aErrorCode );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   329
        User::Leave(aErrorCode);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   330
        }
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   331
    OstTraceFunctionExit0( CDPSXMLPARSER_ONSTARTPREFIXMAPPINGL_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   332
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   333
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   334
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   335
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   336
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   337
//	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   338
void CDpsXmlParser::OnEndPrefixMappingL(const RString& /*aPrefix*/, 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   339
									    TInt aErrorCode)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   340
    {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   341
    OstTraceFunctionEntry0( CDPSXMLPARSER_ONENDPREFIXMAPPINGL_ENTRY );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   342
    if (aErrorCode != KErrNone)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   343
        {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   344
        OstTrace1( TRACE_ERROR, CDPSXMLPARSER_ONENDPREFIXMAPPINGL, "--- error code %d", aErrorCode );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   345
        User::Leave(aErrorCode);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   346
        }
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   347
    OstTraceFunctionExit0( CDPSXMLPARSER_ONENDPREFIXMAPPINGL_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   348
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   349
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   350
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   351
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   352
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   353
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   354
void CDpsXmlParser::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/, 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   355
                                           TInt aErrorCode)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   356
    {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   357
    OstTraceFunctionEntry0( CDPSXMLPARSER_ONIGNORABLEWHITESPACEL_ENTRY );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   358
    if (aErrorCode != KErrNone)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   359
        {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   360
        OstTrace1( TRACE_ERROR, CDPSXMLPARSER_ONIGNORABLEWHITESPACEL, "--- error code %d", aErrorCode );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   361
        User::Leave(aErrorCode);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   362
        }
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   363
    OstTraceFunctionExit0( CDPSXMLPARSER_ONIGNORABLEWHITESPACEL_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   364
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   365
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   366
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   367
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   368
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   369
//	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   370
void CDpsXmlParser::OnSkippedEntityL(const RString& /*aName*/, 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   371
								     TInt aErrorCode)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   372
	{
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   373
    OstTraceFunctionEntry0( CDPSXMLPARSER_ONSKIPPEDENTITYL_ENTRY );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   374
    if (aErrorCode != KErrNone)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   375
        {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   376
        OstTrace1( TRACE_ERROR, CDPSXMLPARSER_ONSKIPPEDENTITYL, "--- error code %d", aErrorCode );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   377
        User::Leave(aErrorCode);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   378
        }
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   379
    OstTraceFunctionExit0( CDPSXMLPARSER_ONSKIPPEDENTITYL_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   380
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   381
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   382
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   383
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   384
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   385
//	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   386
void CDpsXmlParser::OnProcessingInstructionL(const TDesC8& /*aTarget*/, 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   387
											 const TDesC8& /*aData*/, 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   388
											 TInt aErrorCode)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   389
    {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   390
    OstTraceFunctionEntry0( CDPSXMLPARSER_ONPROCESSINGINSTRUCTIONL_ENTRY );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   391
    if (aErrorCode != KErrNone)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   392
        {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   393
        OstTrace1( TRACE_ERROR, CDPSXMLPARSER_ONPROCESSINGINSTRUCTIONL, "--- error code %d", aErrorCode );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   394
        User::Leave(aErrorCode);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   395
        }
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   396
    OstTraceFunctionExit0( CDPSXMLPARSER_ONPROCESSINGINSTRUCTIONL_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   397
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   398
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   399
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   400
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   401
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   402
//	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   403
void CDpsXmlParser::OnError(TInt aErrorCode)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   404
    {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   405
    OstTraceFunctionEntry0( CDPSXMLPARSER_ONERROR_ENTRY );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   406
    if (aErrorCode != KErrNone)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   407
        {
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   408
        OstTrace1( TRACE_NORMAL, CDPSXMLPARSER_ONERROR, "---error code %d", aErrorCode );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   409
        }
49
c20dd21d1eb4 201035_05
hgs
parents: 29
diff changeset
   410
    OstTraceFunctionExit0( CDPSXMLPARSER_ONERROR_EXIT );
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   411
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   412
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   413
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   414
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   415
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   416
//	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   417
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   418
TAny* CDpsXmlParser::GetExtendedInterface(const TInt32 aUid)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   419
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   420
    return aUid == MDpsExtensionHandler::EInterfaceUid ?
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   421
    static_cast<MDpsExtensionHandler*>(this) : 0;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   422
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   423
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   424
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   425
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   426
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   427
//  
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   428
void CDpsXmlParser::Reset()
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   429
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   430
    iDpsArgs.Reset();
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   431
    iAction = EDpsXmlEmpty;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   432
    iDpsEvent = EDpsEvtEmpty; 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   433
    iDpsOperation = EDpsOpEmpty;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   434
    iElement = EDpsEleEmpty; 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   435
    iAttrib = 0;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   436
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   437