diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-5E7A1041-B0E1-47E3-A3BF-6C9AE221B98F.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-5E7A1041-B0E1-47E3-A3BF-6C9AE221B98F.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,55 @@ + + + + + +Request +for conversions +

Conversions can be done in a single step or in multiple +steps.

Single step

To convert an entire file or +stream in a single step, use CConverterBase2::ConvertL() and CConverterBase2::ConvertObjectL() respectively.

The following code snippet converts the contents of c:\private\12345678\file1 and +places the output in c:\private\12345678\file2.

_LIT(KFromFile, "c:\\private\\12345678\\file1"); +_LIT(KToFile, "c:\\private\\12345678\\file2"); +converter->ConvertL(KFromFile, KToFile, NULL); +

Multiple steps

As the conversion process +can take a long time, you can divide the process into multiple steps. To do +this:

    +
  1. Call CConverterBase2::ConvertAL() (files) +or CConverterBase2::ConvertObjectAL() (streams) to prepare +the converter to convert.

  2. +
  3. Call CConverterBase2::DoConvertL() until +it returns true.

  4. +

The following example converts the contents of c:\private\12345678\file1 and +places the output in c:\private\12345678\file2 in multiple +steps. It assumes that conversion takes place within an active object, CMyActive, +which does a conversion step in the RunL() function and reactivates +the object if conversion is not complete.

void CMyActive::StartConverting() + { + _LIT( KFromFile, "c:\\private\\12345678\\file1" ); + _LIT( KToFile, "c:\\private\\12345678\\file2" ); + converter->ConvertAL( KFromFile, KToFile, NULL ); + User::RequestComplete( iStatus,KErrNone ); + SetActive(); + } +void CMyActive::RunL() + { + if (DoConvertL()) + { + User::RequestComplete( iStatus,KErrNone ); + SetActive(); + } + else + { + // Handle completed conversion + } + } +

NOTE: After using the converter, delete the converter +and the converter list. The converter architecture unloads the converter DLLs +that were loaded.

+
\ No newline at end of file