connectivitymodules/SeCon/wbxml/conmlhandler/src/sconconmlgenerator.cpp
changeset 40 b63e67867dcd
parent 20 e1de7d03f843
equal deleted inserted replaced
39:9905f7d46607 40:b63e67867dcd
    95 // -----------------------------------------------------------------------------
    95 // -----------------------------------------------------------------------------
    96 // SetCallbacks
    96 // SetCallbacks
    97 // -----------------------------------------------------------------------------
    97 // -----------------------------------------------------------------------------
    98 void CSConConMLGenerator::SetCallback ( MWBXMLConMLCallback* aCallback )
    98 void CSConConMLGenerator::SetCallback ( MWBXMLConMLCallback* aCallback )
    99     {
    99     {
   100     LOGGER_ENTERFN( "CSConConMLGenerator::SetCallbacks()" );
       
   101     iCallback = aCallback;
   100     iCallback = aCallback;
   102     LOGGER_LEAVEFN( "CSConConMLGenerator::SetCallbacks()" );
       
   103     }
   101     }
   104 
   102 
   105 // -----------------------------------------------------------------------------
   103 // -----------------------------------------------------------------------------
   106 // StartDocument
   104 // StartDocument
   107 // -----------------------------------------------------------------------------    
   105 // -----------------------------------------------------------------------------    
   127 // -----------------------------------------------------------------------------
   125 // -----------------------------------------------------------------------------
   128 // StartElementL
   126 // StartElementL
   129 // -----------------------------------------------------------------------------
   127 // -----------------------------------------------------------------------------
   130 void CSConConMLGenerator::StartElementL( TWBXMLTag aTag )
   128 void CSConConMLGenerator::StartElementL( TWBXMLTag aTag )
   131     {
   129     {
   132     LOGGER_ENTERFN( "CSConConMLGenerator::StartElementL()" );
       
   133     if( iCmdStack->Top() != 0 )
   130     if( iCmdStack->Top() != 0 )
   134         {
   131         {
   135         AddElementL(iCmdStack->Top()->BeginElementL( 
   132         AddElementL(iCmdStack->Top()->BeginElementL( 
   136             aTag, TXMLElementParams(iCallback, iCmdStack, iCleanupStack ) ) );
   133             aTag, TXMLElementParams(iCallback, iCmdStack, iCleanupStack ) ) );
   137         }
   134         }
   148             {
   145             {
   149             LOGGER_WRITE( "CSConConMLGenerator::StartElementL() : Leave KWBXMLParserErrorInvalidTag" );
   146             LOGGER_WRITE( "CSConConMLGenerator::StartElementL() : Leave KWBXMLParserErrorInvalidTag" );
   150             User::Leave(KWBXMLParserErrorInvalidTag);
   147             User::Leave(KWBXMLParserErrorInvalidTag);
   151             }
   148             }
   152         }
   149         }
   153     LOGGER_LEAVEFN( "CSConConMLGenerator::StartElementL()" );
       
   154     }
   150     }
   155     
   151     
   156 // -----------------------------------------------------------------------------
   152 // -----------------------------------------------------------------------------
   157 // AddElement
   153 // AddElement
   158 // -----------------------------------------------------------------------------
   154 // -----------------------------------------------------------------------------
   159 void CSConConMLGenerator::AddElementL( CXMLElement* aElement )
   155 void CSConConMLGenerator::AddElementL( CXMLElement* aElement )
   160     {
   156     {
   161     LOGGER_ENTERFN( "CSConConMLGenerator::AddElement()" );
       
   162     if( aElement )
   157     if( aElement )
   163         {
   158         {
   164         iCmdStack->PushL(aElement);
   159         iCmdStack->PushL(aElement);
   165         if( aElement->NeedsCleanup() )
   160         if( aElement->NeedsCleanup() )
   166             {
   161             {
   167             iCleanupStack->PushL(aElement);
   162             iCleanupStack->PushL(aElement);
   168             }
   163             }
   169         }
   164         }
   170     LOGGER_LEAVEFN( "CSConConMLGenerator::AddElement()" );
       
   171     }
   165     }
   172 
   166 
   173 // -----------------------------------------------------------------------------
   167 // -----------------------------------------------------------------------------
   174 // CharactersL
   168 // CharactersL
   175 // -----------------------------------------------------------------------------
   169 // -----------------------------------------------------------------------------
   176 void CSConConMLGenerator::CharactersL( const TDesC8& aBuffer )
   170 void CSConConMLGenerator::CharactersL( const TDesC8& aBuffer )
   177     {
   171     {
   178     LOGGER_ENTERFN( "CSConConMLGenerator::CharactersL()" );
       
   179     if( iCmdStack->Top() != 0 )
   172     if( iCmdStack->Top() != 0 )
   180         {
   173         {
   181         iCmdStack->Top()->SetDataL(aBuffer);
   174         iCmdStack->Top()->SetDataL(aBuffer);
   182         }
   175         }
   183     else
   176     else
   184         {
   177         {
   185         LOGGER_WRITE( "CSConConMLGenerator::CharactersL() : Leave KWBXMLParserErrorInvalidTag" );
   178         LOGGER_WRITE( "CSConConMLGenerator::CharactersL() : Leave KWBXMLParserErrorInvalidTag" );
   186         User::Leave(KWBXMLParserErrorInvalidTag);
   179         User::Leave(KWBXMLParserErrorInvalidTag);
   187         }
   180         }
   188     LOGGER_LEAVEFN( "CSConConMLGenerator::CharactersL()" );
       
   189     }
   181     }
   190     
   182     
   191 // -----------------------------------------------------------------------------
   183 // -----------------------------------------------------------------------------
   192 // EndElementL
   184 // EndElementL
   193 // -----------------------------------------------------------------------------
   185 // -----------------------------------------------------------------------------
   194 void CSConConMLGenerator::EndElementL( TWBXMLTag aTag )
   186 void CSConConMLGenerator::EndElementL( TWBXMLTag aTag )
   195     {
   187     {
   196     LOGGER_ENTERFN( "CSConConMLGenerator::EndElementL()" );
       
   197     if( iCmdStack->Top() != 0 )
   188     if( iCmdStack->Top() != 0 )
   198         {
   189         {
   199         CXMLElement::TAction action = iCmdStack->Top()->EndElementL( 
   190         CXMLElement::TAction action = iCmdStack->Top()->EndElementL( 
   200             iCallback, aTag );
   191             iCallback, aTag );
   201         if( action != CXMLElement::ENone )
   192         if( action != CXMLElement::ENone )
   209                 {
   200                 {
   210                 delete elem;
   201                 delete elem;
   211                 }
   202                 }
   212             }
   203             }
   213         }
   204         }
   214     LOGGER_LEAVEFN( "CSConConMLGenerator::EndElementL()" );
       
   215     }
   205     }
   216     
   206     
   217 // -----------------------------------------------------------------------------
   207 // -----------------------------------------------------------------------------
   218 // WriteMUint32L
   208 // WriteMUint32L
   219 // -----------------------------------------------------------------------------
   209 // -----------------------------------------------------------------------------
   220 void CSConConMLGenerator::WriteMUint32L( TUint32 aValue )
   210 void CSConConMLGenerator::WriteMUint32L( TUint32 aValue )
   221     {
   211     {
   222     LOGGER_ENTERFN( "CSConConMLGenerator::WriteMUint32L()" );
       
   223     TUint8 temp[5];
   212     TUint8 temp[5];
   224     TInt i(4);
   213     TInt i(4);
   225     
   214     
   226     temp[i--] = TUint8(aValue & 0x7F);
   215     temp[i--] = TUint8(aValue & 0x7F);
   227     aValue >>= 7;
   216     aValue >>= 7;
   233             
   222             
   234     while( i < 4 )
   223     while( i < 4 )
   235         {
   224         {
   236         iWBXMLWorkspace->WriteL(temp[++i]);
   225         iWBXMLWorkspace->WriteL(temp[++i]);
   237         }
   226         }
   238     LOGGER_LEAVEFN( "CSConConMLGenerator::WriteMUint32L()" );
       
   239     }
   227     }
   240 
   228 
   241 // -----------------------------------------------------------------------------
   229 // -----------------------------------------------------------------------------
   242 // WriteOpaqueDataL
   230 // WriteOpaqueDataL
   243 // -----------------------------------------------------------------------------
   231 // -----------------------------------------------------------------------------
   244 void CSConConMLGenerator::WriteOpaqueDataL( const TDesC8& aData )
   232 void CSConConMLGenerator::WriteOpaqueDataL( const TDesC8& aData )
   245     {
   233     {
   246     LOGGER_ENTERFN( "CSConConMLGenerator::WriteOpaqueDataL()" );
       
   247     iWBXMLWorkspace->WriteL( OPAQUE );
   234     iWBXMLWorkspace->WriteL( OPAQUE );
   248     WriteMUint32L( aData.Size() );
   235     WriteMUint32L( aData.Size() );
   249     iWBXMLWorkspace->WriteL( aData );
   236     iWBXMLWorkspace->WriteL( aData );
   250     iXMLWorkspace->WriteL( aData );
   237     iXMLWorkspace->WriteL( aData );
   251     LOGGER_LEAVEFN( "CSConConMLGenerator::WriteOpaqueDataL()" );
       
   252     }
   238     }
   253     
   239     
   254 // -----------------------------------------------------------------------------
   240 // -----------------------------------------------------------------------------
   255 // WriteInlineStringL
   241 // WriteInlineStringL
   256 // -----------------------------------------------------------------------------
   242 // -----------------------------------------------------------------------------
   257 void CSConConMLGenerator::WriteInlineStringL( const TDesC8& aData )
   243 void CSConConMLGenerator::WriteInlineStringL( const TDesC8& aData )
   258     {
   244     {
   259     LOGGER_ENTERFN( "CSConConMLGenerator::WriteInlineStringL()" );
       
   260     iWBXMLWorkspace->WriteL( STR_I );
   245     iWBXMLWorkspace->WriteL( STR_I );
   261     iWBXMLWorkspace->WriteL( aData );
   246     iWBXMLWorkspace->WriteL( aData );
   262     iWBXMLWorkspace->WriteL( 0 );
   247     iWBXMLWorkspace->WriteL( 0 );
   263     iXMLWorkspace->WriteL( aData );
   248     iXMLWorkspace->WriteL( aData );
   264     LOGGER_LEAVEFN( "CSConConMLGenerator::WriteInlineStringL()" );
       
   265     }
   249     }
   266     
   250     
   267 // -----------------------------------------------------------------------------
   251 // -----------------------------------------------------------------------------
   268 // IndentL
   252 // IndentL
   269 // -----------------------------------------------------------------------------
   253 // -----------------------------------------------------------------------------
   270 void CSConConMLGenerator::IndentL()
   254 void CSConConMLGenerator::IndentL()
   271     {
   255     {
   272     LOGGER_ENTERFN( "CSConConMLGenerator::IndentL()" );
       
   273     for( TInt i = 0; i < iElemStack.Count() + iInitialIndentLevel; i++ )
   256     for( TInt i = 0; i < iElemStack.Count() + iInitialIndentLevel; i++ )
   274         {
   257         {
   275         iXMLWorkspace->WriteL(KXMLIndent());
   258         iXMLWorkspace->WriteL(KXMLIndent());
   276         }
   259         }
   277     LOGGER_LEAVEFN( "CSConConMLGenerator::IndentL()" );
       
   278     }
   260     }
   279 
   261 
   280 // -----------------------------------------------------------------------------
   262 // -----------------------------------------------------------------------------
   281 // TranslateElement
   263 // TranslateElement
   282 // -----------------------------------------------------------------------------    
   264 // -----------------------------------------------------------------------------    
   283 TPtrC8 CSConConMLGenerator::TranslateElement( TUint8 aElement )
   265 TPtrC8 CSConConMLGenerator::TranslateElement( TUint8 aElement )
   284     {
   266     {
   285     LOGGER_ENTERFN( "CSConConMLGenerator::TranslateElement()" );
       
   286     TPtrC8 buf( KConMLElements );
   267     TPtrC8 buf( KConMLElements );
   287     while( aElement-- )
   268     while( aElement-- )
   288         {
   269         {
   289         TInt pos = buf.Find(KXMLElemenentSeparator());
   270         TInt pos = buf.Find(KXMLElemenentSeparator());
   290         if( pos == KErrNotFound )
   271         if( pos == KErrNotFound )
   298     
   279     
   299     if( pos != KErrNotFound )
   280     if( pos != KErrNotFound )
   300         {
   281         {
   301         buf.Set(buf.Left(pos));
   282         buf.Set(buf.Left(pos));
   302         }
   283         }
   303     LOGGER_LEAVEFN( "CSConConMLGenerator::TranslateElement()" );
       
   304     return buf;
   284     return buf;
   305     }
   285     }
   306     
   286     
   307 // -----------------------------------------------------------------------------
   287 // -----------------------------------------------------------------------------
   308 // EndDocument
   288 // EndDocument
   333 // -----------------------------------------------------------------------------
   313 // -----------------------------------------------------------------------------
   334 // AppendConMLL
   314 // AppendConMLL
   335 // -----------------------------------------------------------------------------
   315 // -----------------------------------------------------------------------------
   336 void CSConConMLGenerator::AppendConMLL( ConML_ConMLPtr_t aContent )
   316 void CSConConMLGenerator::AppendConMLL( ConML_ConMLPtr_t aContent )
   337     {
   317     {
   338     LOGGER_ENTERFN( "CSConConMLGenerator::AppendConMLL()" );
       
   339     BeginDocumentL(KSConConMLVersion, KSConConMLPublicId, KSConConMLUTF8);
   318     BeginDocumentL(KSConConMLVersion, KSConConMLPublicId, KSConConMLUTF8);
   340     BeginElementL(EConML, ETrue);
   319     BeginElementL(EConML, ETrue);
   341     AppendExecuteL( aContent->execute );
   320     AppendExecuteL( aContent->execute );
   342     AppendGetStatusL( aContent->getStatus );
   321     AppendGetStatusL( aContent->getStatus );
   343     AppendCancelL( aContent->cancel );
   322     AppendCancelL( aContent->cancel );
   344     AppendStatusL( aContent->status );
   323     AppendStatusL( aContent->status );
   345     EndElementL(); // EConML
   324     EndElementL(); // EConML
   346     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendConMLL()" );
       
   347     }
   325     }
   348 
   326 
   349 // -----------------------------------------------------------------------------
   327 // -----------------------------------------------------------------------------
   350 // AppendExecuteL
   328 // AppendExecuteL
   351 // -----------------------------------------------------------------------------
   329 // -----------------------------------------------------------------------------
   352 void CSConConMLGenerator::AppendExecuteL( ConML_ExecutePtr_t aContent )
   330 void CSConConMLGenerator::AppendExecuteL( ConML_ExecutePtr_t aContent )
   353     {
   331     {
   354     LOGGER_ENTERFN( "CSConConMLGenerator::AppendExecuteL()" );
       
   355     if ( aContent )
   332     if ( aContent )
   356         {
   333         {
   357         BeginElementL( EConMLExecute, ETrue );
   334         BeginElementL( EConMLExecute, ETrue );
   358         AppendPCDataL( EConMLID, aContent->id );
   335         AppendPCDataL( EConMLID, aContent->id );
   359         AppendInstallL( aContent->install );
   336         AppendInstallL( aContent->install );
   373             {
   350             {
   374             BeginElementL( EConMLReboot );
   351             BeginElementL( EConMLReboot );
   375             }
   352             }
   376         EndElementL(); // EConMLExecute
   353         EndElementL(); // EConMLExecute
   377         }
   354         }
   378     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendExecuteL()" );
       
   379     }
   355     }
   380 
   356 
   381 // -----------------------------------------------------------------------------
   357 // -----------------------------------------------------------------------------
   382 // AppendSupplyDataL
   358 // AppendSupplyDataL
   383 // -----------------------------------------------------------------------------
   359 // -----------------------------------------------------------------------------
   384 void CSConConMLGenerator::AppendSupplyDataL( ConML_SupplyDataPtr_t aContent )
   360 void CSConConMLGenerator::AppendSupplyDataL( ConML_SupplyDataPtr_t aContent )
   385     {
   361     {
   386     LOGGER_ENTERFN( "CSConConMLGenerator::AppendSupplyDataL()" );
       
   387     if ( aContent )
   362     if ( aContent )
   388         {
   363         {
   389         BeginElementL( EConMLSupplyData, ETrue );
   364         BeginElementL( EConMLSupplyData, ETrue );
   390         AppendSIDListL( aContent->sid );
   365         AppendSIDListL( aContent->sid );
   391         AppendResultsL( aContent->results );
   366         AppendResultsL( aContent->results );
   392         EndElementL(); // EConMLSupplyData
   367         EndElementL(); // EConMLSupplyData
   393         }
   368         }
   394     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendSupplyDataL()" );
       
   395     }
   369     }
   396 // -----------------------------------------------------------------------------
   370 // -----------------------------------------------------------------------------
   397 // AppendInstallL
   371 // AppendInstallL
   398 // -----------------------------------------------------------------------------
   372 // -----------------------------------------------------------------------------
   399 void CSConConMLGenerator::AppendInstallL( ConML_InstallPtr_t aContent )
   373 void CSConConMLGenerator::AppendInstallL( ConML_InstallPtr_t aContent )
   400     {
   374     {
   401     LOGGER_ENTERFN( "CSConConMLGenerator::AppendInstallL()" );
       
   402     if ( aContent)
   375     if ( aContent)
   403         {
   376         {
   404         BeginElementL( EConMLInstall, ETrue );
   377         BeginElementL( EConMLInstall, ETrue );
   405         AppendPCDataL( EConMLName, aContent->name );
   378         AppendPCDataL( EConMLName, aContent->name );
   406         if ( aContent->instParams) 
   379         if ( aContent->instParams) 
   415                 }
   388                 }
   416             }
   389             }
   417         AppendResultsL( aContent->results );
   390         AppendResultsL( aContent->results );
   418         EndElementL(); // EConMLInstall
   391         EndElementL(); // EConMLInstall
   419         }
   392         }
   420     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendInstallL()" );
       
   421     }
   393     }
   422 
   394 
   423 // -----------------------------------------------------------------------------
   395 // -----------------------------------------------------------------------------
   424 // AppendCancelL
   396 // AppendCancelL
   425 // -----------------------------------------------------------------------------    
   397 // -----------------------------------------------------------------------------    
   426 void CSConConMLGenerator::AppendCancelL ( ConML_CancelPtr_t aContent )
   398 void CSConConMLGenerator::AppendCancelL ( ConML_CancelPtr_t aContent )
   427     {
   399     {
   428     LOGGER_ENTERFN( "CSConConMLGenerator::AppendCancelL()" );
       
   429     if ( aContent )
   400     if ( aContent )
   430         {
   401         {
   431         BeginElementL( EConMLCancel, ETrue );
   402         BeginElementL( EConMLCancel, ETrue );
   432         AppendPCDataL ( EConMLID, aContent->id );
   403         AppendPCDataL ( EConMLID, aContent->id );
   433         AppendPCDataL( EConMLAll, aContent->all);
   404         AppendPCDataL( EConMLAll, aContent->all);
   434         EndElementL(); // EConMLCancel
   405         EndElementL(); // EConMLCancel
   435         }
   406         }
   436     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendCancelL()" );
       
   437     }
   407     }
   438 
   408 
   439 // -----------------------------------------------------------------------------
   409 // -----------------------------------------------------------------------------
   440 // AppendStatusL
   410 // AppendStatusL
   441 // -----------------------------------------------------------------------------
   411 // -----------------------------------------------------------------------------
   442 void CSConConMLGenerator::AppendStatusL ( ConML_StatusPtr_t aContent )
   412 void CSConConMLGenerator::AppendStatusL ( ConML_StatusPtr_t aContent )
   443     {
   413     {
   444     LOGGER_ENTERFN( "CSConConMLGenerator::AppendStatusL()" );
       
   445     if ( aContent )
   414     if ( aContent )
   446         {
   415         {
   447         if ( aContent->task )
   416         if ( aContent->task )
   448             {
   417             {
   449             BeginElementL( EConMLStatus, ETrue );
   418             BeginElementL( EConMLStatus, ETrue );
   453         else
   422         else
   454             {
   423             {
   455             BeginElementL( EConMLStatus );  
   424             BeginElementL( EConMLStatus );  
   456             }
   425             }
   457         }
   426         }
   458     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendStatusL()" );
       
   459     }
   427     }
   460     
   428     
   461 // -----------------------------------------------------------------------------
   429 // -----------------------------------------------------------------------------
   462 // AppendGetStatusL
   430 // AppendGetStatusL
   463 // -----------------------------------------------------------------------------
   431 // -----------------------------------------------------------------------------
   464 void CSConConMLGenerator::AppendGetStatusL( ConML_GetStatusPtr_t aContent )
   432 void CSConConMLGenerator::AppendGetStatusL( ConML_GetStatusPtr_t aContent )
   465     {
   433     {
   466     LOGGER_ENTERFN( "CSConConMLGenerator::AppendGetStatusL()" );
       
   467     if ( aContent )
   434     if ( aContent )
   468         {
   435         {
   469         BeginElementL( EConMLGetStatus, ETrue );
   436         BeginElementL( EConMLGetStatus, ETrue );
   470         AppendPCDataL( EConMLID, aContent->id);
   437         AppendPCDataL( EConMLID, aContent->id);
   471         if ( aContent->all )
   438         if ( aContent->all )
   472             {
   439             {
   473             BeginElementL( EConMLAll );
   440             BeginElementL( EConMLAll );
   474             }
   441             }
   475         EndElementL(); // EConMLGetStatus
   442         EndElementL(); // EConMLGetStatus
   476         }
   443         }
   477     LOGGER_ENTERFN( "CSConConMLGenerator::AppendGetStatusL()" );
       
   478     }
   444     }
   479 
   445 
   480 // -----------------------------------------------------------------------------
   446 // -----------------------------------------------------------------------------
   481 // AppendRebootL
   447 // AppendRebootL
   482 // -----------------------------------------------------------------------------
   448 // -----------------------------------------------------------------------------
   493 // -----------------------------------------------------------------------------
   459 // -----------------------------------------------------------------------------
   494 // AppendTaskL
   460 // AppendTaskL
   495 // -----------------------------------------------------------------------------
   461 // -----------------------------------------------------------------------------
   496 void CSConConMLGenerator::AppendTaskL( ConML_TaskPtr_t aContent )
   462 void CSConConMLGenerator::AppendTaskL( ConML_TaskPtr_t aContent )
   497     {
   463     {
   498     LOGGER_ENTERFN( "CSConConMLGenerator::AppendTaskL()" );
       
   499     if ( aContent )
   464     if ( aContent )
   500         {
   465         {
   501         BeginElementL( EConMLTask, ETrue );
   466         BeginElementL( EConMLTask, ETrue );
   502         AppendPCDataL( EConMLID, aContent->id );
   467         AppendPCDataL( EConMLID, aContent->id );
   503         AppendInstallL(aContent->install );
   468         AppendInstallL(aContent->install );
   513         AppendSupplyDataL( aContent->supplyData );
   478         AppendSupplyDataL( aContent->supplyData );
   514         AppendRebootL( aContent->reboot );
   479         AppendRebootL( aContent->reboot );
   515         AppendGetMetadataL( aContent->getMetadata );
   480         AppendGetMetadataL( aContent->getMetadata );
   516         EndElementL();
   481         EndElementL();
   517         }
   482         }
   518     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendTaskL()" );
       
   519     }
   483     }
   520     
   484     
   521 // -----------------------------------------------------------------------------
   485 // -----------------------------------------------------------------------------
   522 // AppendTaskListL
   486 // AppendTaskListL
   523 // -----------------------------------------------------------------------------
   487 // -----------------------------------------------------------------------------
   524 void CSConConMLGenerator::AppendTaskListL( ConML_TaskListPtr_t aContent )
   488 void CSConConMLGenerator::AppendTaskListL( ConML_TaskListPtr_t aContent )
   525     {
   489     {
   526     LOGGER_ENTERFN( "CSConConMLGenerator::AppendTaskListL()" );
       
   527     for ( ConML_TaskListPtr_t p = aContent; p && p->data; p=p->next )
   490     for ( ConML_TaskListPtr_t p = aContent; p && p->data; p=p->next )
   528         {
   491         {
   529         AppendTaskL( p->data );
   492         AppendTaskL( p->data );
   530         }
   493         }
   531     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendTaskListL()" );
       
   532     }
   494     }
   533     
   495     
   534 // -----------------------------------------------------------------------------
   496 // -----------------------------------------------------------------------------
   535 // AppendListInstalledAppsL
   497 // AppendListInstalledAppsL
   536 // -----------------------------------------------------------------------------
   498 // -----------------------------------------------------------------------------
   537 void CSConConMLGenerator::AppendListInstalledAppsL ( 
   499 void CSConConMLGenerator::AppendListInstalledAppsL ( 
   538     ConML_ListInstalledAppsPtr_t aContent )
   500     ConML_ListInstalledAppsPtr_t aContent )
   539     {
   501     {
   540     LOGGER_ENTERFN( "CSConConMLGenerator::AppendListInstalledAppsL()" );
       
   541     if ( aContent )
   502     if ( aContent )
   542         {
   503         {
   543         BeginElementL( EConMLListInstalledApps, ETrue );
   504         BeginElementL( EConMLListInstalledApps, ETrue );
   544         AppendDrivesL( aContent->drives );
   505         AppendDrivesL( aContent->drives );
   545         if ( aContent ->all )
   506         if ( aContent ->all )
   547             BeginElementL( EConMLAll );
   508             BeginElementL( EConMLAll );
   548             }
   509             }
   549         AppendResultsL( aContent->results );
   510         AppendResultsL( aContent->results );
   550         EndElementL(); // EConMLListInstalledApps
   511         EndElementL(); // EConMLListInstalledApps
   551         }
   512         }
   552     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendListInstalledAppsL()" );
       
   553     }
   513     }
   554 
   514 
   555 // -----------------------------------------------------------------------------
   515 // -----------------------------------------------------------------------------
   556 // AppendListDataOwnersL
   516 // AppendListDataOwnersL
   557 // -----------------------------------------------------------------------------
   517 // -----------------------------------------------------------------------------
   558 void CSConConMLGenerator::AppendListDataOwnersL ( 
   518 void CSConConMLGenerator::AppendListDataOwnersL ( 
   559     ConML_ListDataOwnersPtr_t aContent )
   519     ConML_ListDataOwnersPtr_t aContent )
   560     {
   520     {
   561     LOGGER_ENTERFN( "CSConConMLGenerator::AppendListDataOwnersL()" );
       
   562     if ( aContent )
   521     if ( aContent )
   563         {
   522         {
   564         if ( aContent->results )
   523         if ( aContent->results )
   565             {
   524             {
   566             BeginElementL( EConMLListDataOwners, ETrue );
   525             BeginElementL( EConMLListDataOwners, ETrue );
   570         else
   529         else
   571             {
   530             {
   572             BeginElementL( EConMLListDataOwners );          
   531             BeginElementL( EConMLListDataOwners );          
   573             }
   532             }
   574         }
   533         }
   575     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendListDataOwnersL()" );
       
   576     }
   534     }
   577 
   535 
   578 // -----------------------------------------------------------------------------
   536 // -----------------------------------------------------------------------------
   579 // CSConConMLGanerator::AppendBUROptionsL
   537 // CSConConMLGanerator::AppendBUROptionsL
   580 // -----------------------------------------------------------------------------
   538 // -----------------------------------------------------------------------------
   581 void CSConConMLGenerator::AppendBUROptionsL( ConML_BUROptionsPtr_t aContent )
   539 void CSConConMLGenerator::AppendBUROptionsL( ConML_BUROptionsPtr_t aContent )
   582     {
   540     {
   583     LOGGER_ENTERFN( "CSConConMLGenerator::AppendBUROptionsL()" );
       
   584     if ( aContent )
   541     if ( aContent )
   585         {
   542         {
   586         BeginElementL( EConMLBUROptions, ETrue );
   543         BeginElementL( EConMLBUROptions, ETrue );
   587         if ( aContent->requiresReboot )
   544         if ( aContent->requiresReboot )
   588             {
   545             {
   600             {
   557             {
   601             BeginElementL( EConMLDelayToPrepareData );
   558             BeginElementL( EConMLDelayToPrepareData );
   602             }
   559             }
   603         EndElementL(); // EConMLBUROptions
   560         EndElementL(); // EConMLBUROptions
   604         }
   561         }
   605     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendBUROptionsL()" );
       
   606     }
   562     }
   607 
   563 
   608 // -----------------------------------------------------------------------------
   564 // -----------------------------------------------------------------------------
   609 // AppendSetBURModeL
   565 // AppendSetBURModeL
   610 // -----------------------------------------------------------------------------
   566 // -----------------------------------------------------------------------------
   611 void CSConConMLGenerator::AppendSetBURModeL( ConML_SetBURModePtr_t aContent )
   567 void CSConConMLGenerator::AppendSetBURModeL( ConML_SetBURModePtr_t aContent )
   612     {
   568     {
   613     LOGGER_ENTERFN( "CSConConMLGenerator::AppendSetBURModeL()" );
       
   614     if ( aContent )
   569     if ( aContent )
   615         {
   570         {
   616         BeginElementL( EConMLSetBURMode, ETrue );
   571         BeginElementL( EConMLSetBURMode, ETrue );
   617         AppendDrivesL( aContent->drives );
   572         AppendDrivesL( aContent->drives );
   618         AppendPCDataL( EConMLPartialType, aContent->partialType );
   573         AppendPCDataL( EConMLPartialType, aContent->partialType );
   619         AppendPCDataL( EConMLIncType, aContent->incType );
   574         AppendPCDataL( EConMLIncType, aContent->incType );
   620         AppendResultsL( aContent->results );
   575         AppendResultsL( aContent->results );
   621         EndElementL(); //EConMLSetBURMode
   576         EndElementL(); //EConMLSetBURMode
   622         }
   577         }
   623     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendSetBURModeL()" );
       
   624     }
   578     }
   625     
   579     
   626 // -----------------------------------------------------------------------------
   580 // -----------------------------------------------------------------------------
   627 // AppendUnInstallL
   581 // AppendUnInstallL
   628 // -----------------------------------------------------------------------------
   582 // -----------------------------------------------------------------------------
   629 void CSConConMLGenerator::AppendUnInstallL( ConML_UnInstallPtr_t aContent )
   583 void CSConConMLGenerator::AppendUnInstallL( ConML_UnInstallPtr_t aContent )
   630     {
   584     {
   631     LOGGER_ENTERFN( "CSConConMLGenerator::AppendUnInstallL()" );
       
   632     if ( aContent )
   585     if ( aContent )
   633         {
   586         {
   634         BeginElementL( EConMLUnInstall, ETrue );
   587         BeginElementL( EConMLUnInstall, ETrue );
   635         AppendApplicationsL( aContent->applications );
   588         AppendApplicationsL( aContent->applications );
   636         AppendInstParamsL( aContent->instParams );
   589         AppendInstParamsL( aContent->instParams );
   637         AppendResultsL( aContent->results );
   590         AppendResultsL( aContent->results );
   638         EndElementL(); // EConMLUnInstall
   591         EndElementL(); // EConMLUnInstall
   639         }
   592         }
   640     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendUnInstallL()" );
       
   641     }
   593     }
   642 
   594 
   643 // -----------------------------------------------------------------------------
   595 // -----------------------------------------------------------------------------
   644 // AppendGetDataSizeL
   596 // AppendGetDataSizeL
   645 // -----------------------------------------------------------------------------
   597 // -----------------------------------------------------------------------------
   646 void CSConConMLGenerator::AppendGetDataSizeL( ConML_GetDataSizePtr_t aContent )
   598 void CSConConMLGenerator::AppendGetDataSizeL( ConML_GetDataSizePtr_t aContent )
   647     {
   599     {
   648     LOGGER_ENTERFN( "CSConConMLGenerator::AppendGetDataSizeL()" );
       
   649     if ( aContent )
   600     if ( aContent )
   650         {
   601         {
   651         BeginElementL( EConMLGetDataSize, ETrue );
   602         BeginElementL( EConMLGetDataSize, ETrue );
   652         AppendDataOwnersL( aContent->dataOwners );
   603         AppendDataOwnersL( aContent->dataOwners );
   653         AppendResultsL( aContent->results );
   604         AppendResultsL( aContent->results );
   654         EndElementL(); //EConMLGetDataSize
   605         EndElementL(); //EConMLGetDataSize
   655         }
   606         }
   656     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendGetDataSizeL()" );
       
   657     }
   607     }
   658 
   608 
   659 // -----------------------------------------------------------------------------
   609 // -----------------------------------------------------------------------------
   660 // AppendRequestDataL
   610 // AppendRequestDataL
   661 // -----------------------------------------------------------------------------
   611 // -----------------------------------------------------------------------------
   662 void CSConConMLGenerator::AppendRequestDataL( ConML_RequestDataPtr_t aContent )
   612 void CSConConMLGenerator::AppendRequestDataL( ConML_RequestDataPtr_t aContent )
   663     {
   613     {
   664     LOGGER_ENTERFN( "CSConConMLGenerator::AppendRequestDataL()" );
       
   665     if ( aContent )
   614     if ( aContent )
   666         {
   615         {
   667         BeginElementL( EConMLRequestData, ETrue );
   616         BeginElementL( EConMLRequestData, ETrue );
   668         AppendSIDListL( aContent->sid );
   617         AppendSIDListL( aContent->sid );
   669         AppendResultsL( aContent->results );
   618         AppendResultsL( aContent->results );
   670         EndElementL();//EConMLRequestData
   619         EndElementL();//EConMLRequestData
   671         }
   620         }
   672     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendRequestDataL()" );
       
   673     }
   621     }
   674 
   622 
   675 // -----------------------------------------------------------------------------
   623 // -----------------------------------------------------------------------------
   676 // AppendUpdateDeviceInfoL
   624 // AppendUpdateDeviceInfoL
   677 // -----------------------------------------------------------------------------
   625 // -----------------------------------------------------------------------------
   678 void CSConConMLGenerator::AppendUpdateDeviceInfoL( 
   626 void CSConConMLGenerator::AppendUpdateDeviceInfoL( 
   679     ConML_UpdateDeviceInfoPtr_t aContent )
   627     ConML_UpdateDeviceInfoPtr_t aContent )
   680     {
   628     {
   681     LOGGER_ENTERFN( "CSConConMLGenerator::AppendUpdateDeviceInfoL()" );
       
   682     if ( aContent )
   629     if ( aContent )
   683         {
   630         {
   684         BeginElementL(EConMLUpdateDeviceInfo, ETrue);
   631         BeginElementL(EConMLUpdateDeviceInfo, ETrue);
   685         AppendDeviceInfoL( aContent-> deviceInfo );
   632         AppendDeviceInfoL( aContent-> deviceInfo );
   686         AppendResultsL( aContent->results );
   633         AppendResultsL( aContent->results );
   687         EndElementL();// EConMLUpdateDeviceInfo
   634         EndElementL();// EConMLUpdateDeviceInfo
   688         }
   635         }
   689     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendUpdateDeviceInfoL()" );
       
   690     }
   636     }
   691 
   637 
   692 // -----------------------------------------------------------------------------
   638 // -----------------------------------------------------------------------------
   693 // AppendListPublicFilesL
   639 // AppendListPublicFilesL
   694 // -----------------------------------------------------------------------------
   640 // -----------------------------------------------------------------------------
   695 void CSConConMLGenerator::AppendListPublicFilesL( 
   641 void CSConConMLGenerator::AppendListPublicFilesL( 
   696     ConML_ListPublicFilesPtr_t aContent )
   642     ConML_ListPublicFilesPtr_t aContent )
   697     {
   643     {
   698     LOGGER_ENTERFN( "CSConConMLGenerator::AppendListPublicFilesL()" );
       
   699     if ( aContent )
   644     if ( aContent )
   700         {
   645         {
   701         BeginElementL( EConMLListPublicFiles, ETrue );
   646         BeginElementL( EConMLListPublicFiles, ETrue );
   702         AppendSIDListL ( aContent->sid );
   647         AppendSIDListL ( aContent->sid );
   703         AppendResultsL( aContent->results );
   648         AppendResultsL( aContent->results );
   704         EndElementL(); // EConMLListPublicFiles
   649         EndElementL(); // EConMLListPublicFiles
   705         }
   650         }
   706     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendListPublicFilesL()" );
       
   707     }
   651     }
   708 
   652 
   709 // -----------------------------------------------------------------------------
   653 // -----------------------------------------------------------------------------
   710 // AppendApplicationL
   654 // AppendApplicationL
   711 // -----------------------------------------------------------------------------
   655 // -----------------------------------------------------------------------------
   712 void CSConConMLGenerator::AppendApplicationL( ConML_ApplicationPtr_t aContent )
   656 void CSConConMLGenerator::AppendApplicationL( ConML_ApplicationPtr_t aContent )
   713     {
   657     {
   714     LOGGER_ENTERFN( "CSConConMLGenerator::AppendApplicationL()" );
       
   715     if ( aContent )
   658     if ( aContent )
   716         {
   659         {
   717         BeginElementL(EConMLApplication, ETrue );
   660         BeginElementL(EConMLApplication, ETrue );
   718         AppendPCDataL( EConMLName, aContent->name );
   661         AppendPCDataL( EConMLName, aContent->name );
   719         AppendPCDataL( EConMLUID, aContent->uid );
   662         AppendPCDataL( EConMLUID, aContent->uid );
   720         EndElementL(); //EConMLApplication
   663         EndElementL(); //EConMLApplication
   721         }
   664         }
   722     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendApplicationL()" );
       
   723     }
   665     }
   724 
   666 
   725 // -----------------------------------------------------------------------------
   667 // -----------------------------------------------------------------------------
   726 // AppendApplicationListL
   668 // AppendApplicationListL
   727 // -----------------------------------------------------------------------------
   669 // -----------------------------------------------------------------------------
   728 void CSConConMLGenerator::AppendApplicationListL( 
   670 void CSConConMLGenerator::AppendApplicationListL( 
   729     ConML_ApplicationListPtr_t aContent )
   671     ConML_ApplicationListPtr_t aContent )
   730     {
   672     {
   731     LOGGER_ENTERFN( "CSConConMLGenerator::AppendApplicationListL()" );
       
   732     for ( ConML_ApplicationListPtr_t p = aContent; p && p->data; p = p->next )
   673     for ( ConML_ApplicationListPtr_t p = aContent; p && p->data; p = p->next )
   733         {
   674         {
   734         AppendApplicationL( p->data );
   675         AppendApplicationL( p->data );
   735         }
   676         }
   736     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendApplicationListL()" );
       
   737     }
   677     }
   738 
   678 
   739 // -----------------------------------------------------------------------------
   679 // -----------------------------------------------------------------------------
   740 // AppendApplicationsL
   680 // AppendApplicationsL
   741 // -----------------------------------------------------------------------------
   681 // -----------------------------------------------------------------------------
   742 void CSConConMLGenerator::AppendApplicationsL( 
   682 void CSConConMLGenerator::AppendApplicationsL( 
   743     ConML_ApplicationsPtr_t aContent )
   683     ConML_ApplicationsPtr_t aContent )
   744     {
   684     {
   745     LOGGER_ENTERFN( "CSConConMLGenerator::AppendApplicationsL()" );
       
   746     if ( aContent )
   685     if ( aContent )
   747         {
   686         {
   748         BeginElementL( EConMLApplications, ETrue );
   687         BeginElementL( EConMLApplications, ETrue );
   749         AppendApplicationListL( aContent->application );
   688         AppendApplicationListL( aContent->application );
   750         EndElementL(); // EConMLApplications
   689         EndElementL(); // EConMLApplications
   751         }
   690         }
   752     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendApplicationsL()" );
       
   753     }
   691     }
   754 
   692 
   755 // -----------------------------------------------------------------------------
   693 // -----------------------------------------------------------------------------
   756 // AppendParamL
   694 // AppendParamL
   757 // -----------------------------------------------------------------------------
   695 // -----------------------------------------------------------------------------
   758 void CSConConMLGenerator::AppendParamL( ConML_ParamPtr_t aContent )
   696 void CSConConMLGenerator::AppendParamL( ConML_ParamPtr_t aContent )
   759     {
   697     {
   760     LOGGER_ENTERFN( "CSConConMLGenerator::AppendParamL()" );
       
   761     if ( aContent )
   698     if ( aContent )
   762         {
   699         {
   763         BeginElementL( EConMLParam, ETrue );
   700         BeginElementL( EConMLParam, ETrue );
   764         AppendPCDataL( EConMLName, aContent->name );
   701         AppendPCDataL( EConMLName, aContent->name );
   765         AppendPCDataL( EConMLValue, aContent->value );
   702         AppendPCDataL( EConMLValue, aContent->value );
   766         EndElementL(); // EConMLParam
   703         EndElementL(); // EConMLParam
   767         }
   704         }
   768     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendParamL()" );
       
   769     }
   705     }
   770 
   706 
   771 // -----------------------------------------------------------------------------
   707 // -----------------------------------------------------------------------------
   772 // AppendParamListL
   708 // AppendParamListL
   773 // -----------------------------------------------------------------------------
   709 // -----------------------------------------------------------------------------
   774 void CSConConMLGenerator::AppendParamListL( ConML_ParamListPtr_t aContent )
   710 void CSConConMLGenerator::AppendParamListL( ConML_ParamListPtr_t aContent )
   775     {
   711     {
   776     LOGGER_ENTERFN( "CSConConMLGenerator::AppendParamListL()" );
       
   777     for ( ConML_ParamListPtr_t p = aContent; p && p->data; p = p->next )
   712     for ( ConML_ParamListPtr_t p = aContent; p && p->data; p = p->next )
   778         {
   713         {
   779         AppendParamL( p-> data );
   714         AppendParamL( p-> data );
   780         }
   715         }
   781     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendParamListL()" );
       
   782     }
   716     }
   783 
   717 
   784 // -----------------------------------------------------------------------------
   718 // -----------------------------------------------------------------------------
   785 // AppendInstParamsL
   719 // AppendInstParamsL
   786 // -----------------------------------------------------------------------------
   720 // -----------------------------------------------------------------------------
   787 void CSConConMLGenerator::AppendInstParamsL( ConML_InstParamsPtr_t aContent )
   721 void CSConConMLGenerator::AppendInstParamsL( ConML_InstParamsPtr_t aContent )
   788     {
   722     {
   789     LOGGER_ENTERFN( "CSConConMLGenerator::AppendInstParamsLionsL()" );
       
   790     if ( aContent )
   723     if ( aContent )
   791         {
   724         {
   792         BeginElementL( EConMLInstParams, ETrue );
   725         BeginElementL( EConMLInstParams, ETrue );
   793         AppendParamListL( aContent->param );
   726         AppendParamListL( aContent->param );
   794         EndElementL(); //EConMLInstParams
   727         EndElementL(); //EConMLInstParams
   795         }
   728         }
   796     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendInstParamsL()" );
       
   797     }
   729     }
   798 
   730 
   799 // -----------------------------------------------------------------------------
   731 // -----------------------------------------------------------------------------
   800 // AppendProgressL
   732 // AppendProgressL
   801 // -----------------------------------------------------------------------------
   733 // -----------------------------------------------------------------------------
   802 void CSConConMLGenerator::AppendProgressL( ConML_ProgressPtr_t aContent )
   734 void CSConConMLGenerator::AppendProgressL( ConML_ProgressPtr_t aContent )
   803     {
   735     {
   804     LOGGER_ENTERFN( "CSConConMLGenerator::AppendProgressL()" );
       
   805     if ( aContent )
   736     if ( aContent )
   806         {
   737         {
   807         BeginElementL( EConMLProgress, ETrue );
   738         BeginElementL( EConMLProgress, ETrue );
   808         AppendPCDataL( EConMLValue, aContent->value );
   739         AppendPCDataL( EConMLValue, aContent->value );
   809         EndElementL(); // EconMLProgress
   740         EndElementL(); // EconMLProgress
   810         }
   741         }
   811     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendProgressL()" );
       
   812     }
   742     }
   813     
   743     
   814 // -----------------------------------------------------------------------------
   744 // -----------------------------------------------------------------------------
   815 // AppendResultsL
   745 // AppendResultsL
   816 // -----------------------------------------------------------------------------
   746 // -----------------------------------------------------------------------------
   817 void CSConConMLGenerator::AppendResultsL( ConML_ResultsPtr_t aContent )
   747 void CSConConMLGenerator::AppendResultsL( ConML_ResultsPtr_t aContent )
   818     {
   748     {
   819     LOGGER_ENTERFN( "CSConConMLGenerator::AppendResultsL()" );
       
   820     if ( aContent )
   749     if ( aContent )
   821         {
   750         {
   822         BeginElementL( EConMLResults, ETrue );
   751         BeginElementL( EConMLResults, ETrue );
   823         if ( aContent->complete )
   752         if ( aContent->complete )
   824             {
   753             {
   838             }
   767             }
   839         AppendDeviceInfoL( aContent->deviceInfo );
   768         AppendDeviceInfoL( aContent->deviceInfo );
   840         AppendFilesL( aContent->files );
   769         AppendFilesL( aContent->files );
   841         EndElementL(); //EConMLResults
   770         EndElementL(); //EConMLResults
   842         }
   771         }
   843     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendResultsL()" );
       
   844     }
   772     }
   845 
   773 
   846 // -----------------------------------------------------------------------------
   774 // -----------------------------------------------------------------------------
   847 // AppendDriveL
   775 // AppendDriveL
   848 // -----------------------------------------------------------------------------
   776 // -----------------------------------------------------------------------------
   849 void CSConConMLGenerator::AppendDriveL( ConML_DrivePtr_t aContent )
   777 void CSConConMLGenerator::AppendDriveL( ConML_DrivePtr_t aContent )
   850     {
   778     {
   851     LOGGER_ENTERFN( "CSConConMLGenerator::AppendDriveL()" );
       
   852     if ( aContent )
   779     if ( aContent )
   853         {
   780         {
   854         BeginElementL( EConMLDrive, ETrue );
   781         BeginElementL( EConMLDrive, ETrue );
   855         AppendPCDataL( EConMLName, aContent->name );
   782         AppendPCDataL( EConMLName, aContent->name );
   856         EndElementL(); //EConMLDrive
   783         EndElementL(); //EConMLDrive
   857         }
   784         }
   858     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendDriveL()" );
       
   859     }
   785     }
   860 
   786 
   861 // -----------------------------------------------------------------------------
   787 // -----------------------------------------------------------------------------
   862 // AppendDriveListL
   788 // AppendDriveListL
   863 // -----------------------------------------------------------------------------
   789 // -----------------------------------------------------------------------------
   864 void CSConConMLGenerator::AppendDriveListL( ConML_DriveListPtr_t aContent )
   790 void CSConConMLGenerator::AppendDriveListL( ConML_DriveListPtr_t aContent )
   865     {
   791     {
   866     LOGGER_ENTERFN( "CSConConMLGenerator::AppendDriveListL()" );
       
   867     for ( ConML_DriveListPtr_t p =  aContent; p && p->data; p=p->next )
   792     for ( ConML_DriveListPtr_t p =  aContent; p && p->data; p=p->next )
   868         {
   793         {
   869         AppendDriveL( p->data );
   794         AppendDriveL( p->data );
   870         }
   795         }
   871     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendDriveListL()" );
       
   872     }
   796     }
   873 
   797 
   874 // -----------------------------------------------------------------------------
   798 // -----------------------------------------------------------------------------
   875 // AppendDrivesL
   799 // AppendDrivesL
   876 // -----------------------------------------------------------------------------
   800 // -----------------------------------------------------------------------------
   877 void CSConConMLGenerator::AppendDrivesL( ConML_DrivesPtr_t aContent )
   801 void CSConConMLGenerator::AppendDrivesL( ConML_DrivesPtr_t aContent )
   878     {
   802     {
   879     LOGGER_ENTERFN( "CSConConMLGenerator::AppendDrivesL()" );
       
   880     if ( aContent )
   803     if ( aContent )
   881         {
   804         {
   882         BeginElementL( EConMLDrives, ETrue );
   805         BeginElementL( EConMLDrives, ETrue );
   883         AppendDriveListL( aContent->drive );
   806         AppendDriveListL( aContent->drive );
   884         EndElementL(); // EConMLDrives
   807         EndElementL(); // EConMLDrives
   885         }
   808         }
   886     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendDrivesL()" );
       
   887     }
   809     }
   888 
   810 
   889 // -----------------------------------------------------------------------------
   811 // -----------------------------------------------------------------------------
   890 // AppendDataOwnersL
   812 // AppendDataOwnersL
   891 // -----------------------------------------------------------------------------
   813 // -----------------------------------------------------------------------------
   892 void CSConConMLGenerator::AppendDataOwnersL( ConML_DataOwnersPtr_t aContent )
   814 void CSConConMLGenerator::AppendDataOwnersL( ConML_DataOwnersPtr_t aContent )
   893     {
   815     {
   894     LOGGER_ENTERFN( "CSConConMLGenerator::AppendDataOwnersL()" );
       
   895     if ( aContent )
   816     if ( aContent )
   896         {
   817         {
   897         BeginElementL( EConMLDataOwners, ETrue );
   818         BeginElementL( EConMLDataOwners, ETrue );
   898         AppendSIDListL( aContent->sid );
   819         AppendSIDListL( aContent->sid );
   899         EndElementL(); //EConMLDataOwners
   820         EndElementL(); //EConMLDataOwners
   900         }
   821         }
   901     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendDataOwnersL()" );
       
   902     }
   822     }
   903 
   823 
   904 // -----------------------------------------------------------------------------
   824 // -----------------------------------------------------------------------------
   905 // AppendGetDataOwnerStatusL
   825 // AppendGetDataOwnerStatusL
   906 // -----------------------------------------------------------------------------
   826 // -----------------------------------------------------------------------------
   907 void CSConConMLGenerator::AppendGetDataOwnerStatusL
   827 void CSConConMLGenerator::AppendGetDataOwnerStatusL
   908     ( ConML_GetDataOwnerStatusPtr_t aContent )
   828     ( ConML_GetDataOwnerStatusPtr_t aContent )
   909     {
   829     {
   910     LOGGER_ENTERFN( "CSConConMLGenerator::AppendDataOwnerStatusL()" );
       
   911     if ( aContent)
   830     if ( aContent)
   912         {
   831         {
   913         BeginElementL( EConMLGetDataOwnerStatus, ETrue );
   832         BeginElementL( EConMLGetDataOwnerStatus, ETrue );
   914         AppendDataOwnersL( aContent->dataOwners );
   833         AppendDataOwnersL( aContent->dataOwners );
   915         AppendResultsL( aContent->results );
   834         AppendResultsL( aContent->results );
   916         EndElementL(); // EconMLGetDataOwnerStatus
   835         EndElementL(); // EconMLGetDataOwnerStatus
   917         }
   836         }
   918     LOGGER_ENTERFN( "CSConConMLGenerator::AppendDataOwnerStatusL()" );
       
   919     }
   837     }
   920 
   838 
   921 // -----------------------------------------------------------------------------
   839 // -----------------------------------------------------------------------------
   922 // AppendGetMetadataL
   840 // AppendGetMetadataL
   923 // -----------------------------------------------------------------------------
   841 // -----------------------------------------------------------------------------
   924 void CSConConMLGenerator::AppendGetMetadataL
   842 void CSConConMLGenerator::AppendGetMetadataL
   925     ( ConML_GetMetadataPtr_t aContent )
   843     ( ConML_GetMetadataPtr_t aContent )
   926     {
   844     {
   927     LOGGER_ENTERFN( "CSConConMLGenerator::AppendGetMetadataL()" );
       
   928     if ( aContent)
   845     if ( aContent)
   929         {
   846         {
   930         BeginElementL( EConMLGetMetadata, ETrue );
   847         BeginElementL( EConMLGetMetadata, ETrue );
   931         AppendPCDataL( EConMLFilename, aContent->filename );
   848         AppendPCDataL( EConMLFilename, aContent->filename );
   932         AppendResultsL( aContent->results );
   849         AppendResultsL( aContent->results );
   933         EndElementL(); // EConMLGetMetadata
   850         EndElementL(); // EConMLGetMetadata
   934         }
   851         }
   935     LOGGER_ENTERFN( "CSConConMLGenerator::AppendGetMetadataL()" );
       
   936     }
   852     }
   937 
   853 
   938 // -----------------------------------------------------------------------------
   854 // -----------------------------------------------------------------------------
   939 // AppendPackageInfoL
   855 // AppendPackageInfoL
   940 // -----------------------------------------------------------------------------
   856 // -----------------------------------------------------------------------------
   951 // -----------------------------------------------------------------------------
   867 // -----------------------------------------------------------------------------
   952 // AppendSIDL
   868 // AppendSIDL
   953 // -----------------------------------------------------------------------------
   869 // -----------------------------------------------------------------------------
   954 void CSConConMLGenerator::AppendSIDL( ConML_SIDPtr_t aContent )
   870 void CSConConMLGenerator::AppendSIDL( ConML_SIDPtr_t aContent )
   955     {
   871     {
   956     LOGGER_ENTERFN( "CSConConMLGenerator::AppendSIDL()" );
       
   957     if ( aContent )
   872     if ( aContent )
   958         {
   873         {
   959         BeginElementL( EConMLSID, ETrue );
   874         BeginElementL( EConMLSID, ETrue );
   960         AppendPCDataL( EConMLType, aContent->type );
   875         AppendPCDataL( EConMLType, aContent->type );
   961         AppendPCDataL( EConMLUID, aContent->uid );
   876         AppendPCDataL( EConMLUID, aContent->uid );
   973             {
   888             {
   974             BeginElementL(EConMLMoreData );
   889             BeginElementL(EConMLMoreData );
   975             }
   890             }
   976         EndElementL(); // EconMLSID
   891         EndElementL(); // EconMLSID
   977         }
   892         }
   978     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendSIDL()" );
       
   979     }
   893     }
   980     
   894     
   981 // -----------------------------------------------------------------------------
   895 // -----------------------------------------------------------------------------
   982 // AppendSIDListL
   896 // AppendSIDListL
   983 // -----------------------------------------------------------------------------
   897 // -----------------------------------------------------------------------------
   984 void CSConConMLGenerator::AppendSIDListL( ConML_SIDListPtr_t aContent )
   898 void CSConConMLGenerator::AppendSIDListL( ConML_SIDListPtr_t aContent )
   985     {
   899     {
   986     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendSIDListL()" );
       
   987     for ( ConML_SIDListPtr_t p = aContent; p && p->data; p=p->next )
   900     for ( ConML_SIDListPtr_t p = aContent; p && p->data; p=p->next )
   988         {
   901         {
   989         AppendSIDL( p->data );
   902         AppendSIDL( p->data );
   990         }
   903         }
   991     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendSIDListL()" );
       
   992     }
   904     }
   993 
   905 
   994 // -----------------------------------------------------------------------------
   906 // -----------------------------------------------------------------------------
   995 // AppendDeviceInfoL
   907 // AppendDeviceInfoL
   996 // -----------------------------------------------------------------------------
   908 // -----------------------------------------------------------------------------
   997 void CSConConMLGenerator::AppendDeviceInfoL( ConML_DeviceInfoPtr_t aContent )
   909 void CSConConMLGenerator::AppendDeviceInfoL( ConML_DeviceInfoPtr_t aContent )
   998     {
   910     {
   999     LOGGER_ENTERFN( "CSConConMLGenerator::AppendDeviceInfoL()" );
       
  1000     if ( aContent )
   911     if ( aContent )
  1001         {
   912         {
  1002         BeginElementL( EConMLDeviceInfo, ETrue );
   913         BeginElementL( EConMLDeviceInfo, ETrue );
  1003         AppendPCDataL( EConMLVersion, aContent->version );
   914         AppendPCDataL( EConMLVersion, aContent->version );
  1004         AppendSupportedMethodsL ( aContent->supportedMethods );
   915         AppendSupportedMethodsL ( aContent->supportedMethods );
  1005         AppendPCDataL(EConMLMaxObjectSize, aContent->maxObjectSize );
   916         AppendPCDataL(EConMLMaxObjectSize, aContent->maxObjectSize );
  1006         EndElementL(); // EConMLDeviceInfo
   917         EndElementL(); // EConMLDeviceInfo
  1007         }
   918         }
  1008     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendDeviceInfoL()" );
       
  1009     }
   919     }
  1010 
   920 
  1011 // -----------------------------------------------------------------------------
   921 // -----------------------------------------------------------------------------
  1012 // AppendFilesL
   922 // AppendFilesL
  1013 // -----------------------------------------------------------------------------
   923 // -----------------------------------------------------------------------------
  1014 void CSConConMLGenerator::AppendFilesL( ConML_FilesPtr_t aContent )
   924 void CSConConMLGenerator::AppendFilesL( ConML_FilesPtr_t aContent )
  1015     {
   925     {
  1016     LOGGER_ENTERFN( "CSConConMLGenerator::AppendFilesL()" );
       
  1017     if ( aContent )
   926     if ( aContent )
  1018         {
   927         {
  1019         BeginElementL( EConMLFiles, ETrue );
   928         BeginElementL( EConMLFiles, ETrue );
  1020         AppendFileListL( aContent->file );
   929         AppendFileListL( aContent->file );
  1021         EndElementL(); // EConMLFiles
   930         EndElementL(); // EConMLFiles
  1022         }
   931         }
  1023     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendFilesL()" );
       
  1024     }
   932     }
  1025 
   933 
  1026 // -----------------------------------------------------------------------------
   934 // -----------------------------------------------------------------------------
  1027 // AppendSupportedMethodsL
   935 // AppendSupportedMethodsL
  1028 // -----------------------------------------------------------------------------
   936 // -----------------------------------------------------------------------------
  1029 void CSConConMLGenerator::AppendSupportedMethodsL
   937 void CSConConMLGenerator::AppendSupportedMethodsL
  1030     ( ConML_SupportedMethodsPtr_t aContent )
   938     ( ConML_SupportedMethodsPtr_t aContent )
  1031     {
   939     {
  1032     LOGGER_ENTERFN( "CSConConMLGenerator::AppendSupportedMethodsL()" );
       
  1033     if ( aContent )
   940     if ( aContent )
  1034         {
   941         {
  1035         BeginElementL( EConMLSupportedMethods, ETrue );
   942         BeginElementL( EConMLSupportedMethods, ETrue );
  1036         if  ( aContent->install )
   943         if  ( aContent->install )
  1037             {
   944             {
  1069             {
   976             {
  1070             BeginElementL( EConMLReboot );
   977             BeginElementL( EConMLReboot );
  1071             }
   978             }
  1072         EndElementL(); // EConMLSupportedMethods
   979         EndElementL(); // EConMLSupportedMethods
  1073         }
   980         }
  1074     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendSupportedMethodsL()" );
       
  1075     }
   981     }
  1076 
   982 
  1077 // -----------------------------------------------------------------------------
   983 // -----------------------------------------------------------------------------
  1078 // AppendFileListL
   984 // AppendFileListL
  1079 // -----------------------------------------------------------------------------
   985 // -----------------------------------------------------------------------------
  1080 void CSConConMLGenerator::AppendFileListL( ConML_FileListPtr_t  aContent )
   986 void CSConConMLGenerator::AppendFileListL( ConML_FileListPtr_t  aContent )
  1081     {
   987     {
  1082     LOGGER_ENTERFN( "CSConConMLGenerator::AppendFileListL()" );
       
  1083     if ( aContent )
   988     if ( aContent )
  1084         {
   989         {
  1085         for ( ConML_FileListPtr_t p = aContent; p && p->data; p = p->next )
   990         for ( ConML_FileListPtr_t p = aContent; p && p->data; p = p->next )
  1086             {
   991             {
  1087             AppendFileL(p->data );
   992             AppendFileL(p->data );
  1088             }
   993             }
  1089         }
   994         }
  1090     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendFileListL()" );
       
  1091     }
   995     }
  1092 
   996 
  1093 // -----------------------------------------------------------------------------
   997 // -----------------------------------------------------------------------------
  1094 // AppendFileL
   998 // AppendFileL
  1095 // -----------------------------------------------------------------------------
   999 // -----------------------------------------------------------------------------
  1096 void CSConConMLGenerator::AppendFileL( ConML_FilePtr_t aContent )
  1000 void CSConConMLGenerator::AppendFileL( ConML_FilePtr_t aContent )
  1097     {
  1001     {
  1098     LOGGER_ENTERFN( "CSConConMLGenerator::AppendFileL()" );
       
  1099     if ( aContent )
  1002     if ( aContent )
  1100         {
  1003         {
  1101         BeginElementL( EConMLFile, ETrue );
  1004         BeginElementL( EConMLFile, ETrue );
  1102         AppendPCDataL( EConMLName, aContent->name );
  1005         AppendPCDataL( EConMLName, aContent->name );
  1103         AppendPCDataL( EConMLModified, aContent->modified );
  1006         AppendPCDataL( EConMLModified, aContent->modified );
  1104         AppendPCDataL( EConMLSize, aContent->size );
  1007         AppendPCDataL( EConMLSize, aContent->size );
  1105         AppendPCDataL( EConMLUserPerm, aContent->userPerm );
  1008         AppendPCDataL( EConMLUserPerm, aContent->userPerm );
  1106         EndElementL(); // EConMLFile
  1009         EndElementL(); // EConMLFile
  1107         }
  1010         }
  1108     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendFileL()" );
       
  1109     }
  1011     }
  1110 
  1012 
  1111 // -----------------------------------------------------------------------------
  1013 // -----------------------------------------------------------------------------
  1112 // HandleResult
  1014 // HandleResult
  1113 // -----------------------------------------------------------------------------
  1015 // -----------------------------------------------------------------------------
  1127 
  1029 
  1128         case KErrTooBig:
  1030         case KErrTooBig:
  1129             iWBXMLWorkspace->Rollback();
  1031             iWBXMLWorkspace->Rollback();
  1130             return KWBXMLGeneratorBufferFull;
  1032             return KWBXMLGeneratorBufferFull;
  1131         }
  1033         }
  1132     LOGGER_WRITE_1( "CSConConMLGenerator::HandleResult()\
  1034     LOGGER_WRITE_1( "CSConConMLGenerator::HandleResult() : returned %d", aResult);
  1133      : returned %d", aResult);
       
  1134     return aResult;
  1035     return aResult;
  1135     }
  1036     }
  1136 
  1037 
  1137 // -----------------------------------------------------------------------------
  1038 // -----------------------------------------------------------------------------
  1138 // BeginDocumentL
  1039 // BeginDocumentL
  1165 // BeginElementL
  1066 // BeginElementL
  1166 // -----------------------------------------------------------------------------
  1067 // -----------------------------------------------------------------------------
  1167 void CSConConMLGenerator::BeginElementL( 
  1068 void CSConConMLGenerator::BeginElementL( 
  1168     TUint8 aElement, TBool aHasContent, TBool aHasAttributes )
  1069     TUint8 aElement, TBool aHasContent, TBool aHasAttributes )
  1169     {
  1070     {
  1170     LOGGER_ENTERFN( "CSConConMLGenerator::BeginElementL()" );
       
  1171     IndentL();
  1071     IndentL();
  1172     iXMLWorkspace->WriteL(KXMLTagStart());
  1072     iXMLWorkspace->WriteL(KXMLTagStart());
  1173     iXMLWorkspace->WriteL(TranslateElement(aElement));
  1073     iXMLWorkspace->WriteL(TranslateElement(aElement));
  1174         
  1074         
  1175     if( aHasAttributes )
  1075     if( aHasAttributes )
  1193         iXMLWorkspace->WriteL(KXMLNewLine());
  1093         iXMLWorkspace->WriteL(KXMLNewLine());
  1194         }
  1094         }
  1195     iDontNewLine = EFalse;
  1095     iDontNewLine = EFalse;
  1196 
  1096 
  1197     WriteMUint32L(aElement);
  1097     WriteMUint32L(aElement);
  1198     LOGGER_LEAVEFN( "CSConConMLGenerator::BeginElementL()" );
       
  1199     }
  1098     }
  1200 
  1099 
  1201 // -----------------------------------------------------------------------------
  1100 // -----------------------------------------------------------------------------
  1202 // EndElementL
  1101 // EndElementL
  1203 // -----------------------------------------------------------------------------
  1102 // -----------------------------------------------------------------------------
  1204 void CSConConMLGenerator::EndElementL()
  1103 void CSConConMLGenerator::EndElementL()
  1205     {
  1104     {
  1206     LOGGER_ENTERFN( "CSConConMLGenerator::EndElementL()" );
       
  1207     TUint8 elem = iElemStack[0];
  1105     TUint8 elem = iElemStack[0];
  1208     iElemStack.Remove(0);
  1106     iElemStack.Remove(0);
  1209     if( !iDontIndent )
  1107     if( !iDontIndent )
  1210         {
  1108         {
  1211         IndentL();
  1109         IndentL();
  1215     iXMLWorkspace->WriteL(TranslateElement(elem));
  1113     iXMLWorkspace->WriteL(TranslateElement(elem));
  1216     iXMLWorkspace->WriteL(KXMLTagEnd());
  1114     iXMLWorkspace->WriteL(KXMLTagEnd());
  1217     iXMLWorkspace->WriteL(KXMLNewLine());
  1115     iXMLWorkspace->WriteL(KXMLNewLine());
  1218     
  1116     
  1219     iWBXMLWorkspace->WriteL(END);
  1117     iWBXMLWorkspace->WriteL(END);
  1220     
       
  1221     LOGGER_LEAVEFN( "CSConConMLGenerator::EndElementL()" );
       
  1222     }
  1118     }
  1223 
  1119 
  1224 // -----------------------------------------------------------------------------
  1120 // -----------------------------------------------------------------------------
  1225 // AddElementL
  1121 // AddElementL
  1226 // -----------------------------------------------------------------------------
  1122 // -----------------------------------------------------------------------------
  1227 void CSConConMLGenerator::AddElementL( 
  1123 void CSConConMLGenerator::AddElementL( 
  1228     TUint8 aElement, const TDesC8& aContent, const TWBXMLContentFormat aFormat )
  1124     TUint8 aElement, const TDesC8& aContent, const TWBXMLContentFormat aFormat )
  1229     {
  1125     {
  1230     LOGGER_ENTERFN( "CSConConMLGenerator::AddElementL()" );
       
  1231     iDontNewLine = ETrue;
  1126     iDontNewLine = ETrue;
  1232     BeginElementL(aElement, ETrue);
  1127     BeginElementL(aElement, ETrue);
  1233     if( aFormat == EWBXMLContentFormatOpaque )
  1128     if( aFormat == EWBXMLContentFormatOpaque )
  1234         {
  1129         {
  1235         WriteOpaqueDataL(aContent);
  1130         WriteOpaqueDataL(aContent);
  1238         {
  1133         {
  1239         WriteInlineStringL(aContent);
  1134         WriteInlineStringL(aContent);
  1240         }
  1135         }
  1241     iDontIndent = ETrue;
  1136     iDontIndent = ETrue;
  1242     EndElementL();
  1137     EndElementL();
  1243     LOGGER_LEAVEFN( "CSConConMLGenerator::AddElementL()" );
       
  1244     }
  1138     }
  1245 
  1139 
  1246 // -----------------------------------------------------------------------------
  1140 // -----------------------------------------------------------------------------
  1247 // AppendPCDataL
  1141 // AppendPCDataL
  1248 // -----------------------------------------------------------------------------
  1142 // -----------------------------------------------------------------------------
  1249 void CSConConMLGenerator::AppendPCDataL( TUint8 aElement, pcdataPtr_t aContent )
  1143 void CSConConMLGenerator::AppendPCDataL( TUint8 aElement, pcdataPtr_t aContent )
  1250     {
  1144     {
  1251     LOGGER_ENTERFN( "CSConConMLGenerator::AppendPCDataL()" );
       
  1252     if( !aContent )
  1145     if( !aContent )
  1253         {
  1146         {
  1254         return;
  1147         return;
  1255         }
  1148         }
  1256 
  1149 
  1262         }
  1155         }
  1263     else
  1156     else
  1264         {
  1157         {
  1265         LOGGER_WRITE( "CSConConMLGenerator::AppendPCDataL() : Data type not Opaque - ignoring " );
  1158         LOGGER_WRITE( "CSConConMLGenerator::AppendPCDataL() : Data type not Opaque - ignoring " );
  1266         }
  1159         }
  1267     LOGGER_LEAVEFN( "CSConConMLGenerator::AppendPCDataL()" );
       
  1268     }
  1160     }
  1269     
  1161     
  1270 // -----------------------------------------------------------------------------
  1162 // -----------------------------------------------------------------------------
  1271 // WBXMLDocument
  1163 // WBXMLDocument
  1272 // -----------------------------------------------------------------------------
  1164 // -----------------------------------------------------------------------------
  1273 TPtrC8 CSConConMLGenerator::WBXMLDocument()
  1165 TPtrC8 CSConConMLGenerator::WBXMLDocument()
  1274     {
  1166     {
  1275     LOGGER_ENTERFN( "CSConConMLGenerator::WBXMLDocument()" );
       
  1276     LOGGER_LEAVEFN( "CSConConMLGenerator::WBXMLDocument()" );
       
  1277     return iWBXMLWorkspace->Buffer();
  1167     return iWBXMLWorkspace->Buffer();
  1278     }
  1168     }
  1279     
  1169     
  1280 // -----------------------------------------------------------------------------
  1170 // -----------------------------------------------------------------------------
  1281 // XMLDocument
  1171 // XMLDocument
  1282 // -----------------------------------------------------------------------------
  1172 // -----------------------------------------------------------------------------
  1283 TPtrC8 CSConConMLGenerator::XMLDocument()
  1173 TPtrC8 CSConConMLGenerator::XMLDocument()
  1284     {
  1174     {
  1285     LOGGER_ENTERFN( "CSConConMLGenerator::XMLDocument()" );
       
  1286     LOGGER_LEAVEFN( "CSConConMLGenerator::XMLDocument()" );
       
  1287     return iXMLWorkspace->Buffer();
  1175     return iXMLWorkspace->Buffer();
  1288     }
  1176     }