diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-14FAE656-7CDE-56ED-ACB2-7853276C24E9.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-14FAE656-7CDE-56ED-ACB2-7853276C24E9.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,113 @@ + + + + + +Descriptor +Example CodeExamples that explains how to use descriptors. + +
BinaryData: +handling general binary data with descriptors

Download

Click +on the following link to download the example: BinaryData .zip .

Download some additional files +required by the example: CommonFramework.zip.

View the example code: browse . View the additional files: browse.

Description

The example +shows how descriptors can handle general binary data by explicitly using the +8 bit descriptor class variants TBufC8<TInt>, TBuf8<TInt>, TPtr8 etc.

Contrast +this with examples where descriptors contain text. These examples almost always +use the non-explicit forms TBufC<TInt>, TBuf<TInt>, TPtr etc; +these are typedef'd to the 16 bit variant.

Class summary

TBuf8

Security +issues

The example requires no specific capabilities in order +to run - and does not demonstrate any security issues.

+
Buffer: basic +buffer descriptors

Download

Click on the following +link to download the example: Buffer .zip

Download some additional files +required by the example: CommonFramework.zip.

View the example code: browse . View the additional files: browse.

Description

This example +shows the basic idea of buffer descriptors and how they are used.

Class +summary

TBuf TBufC TDesC TPtr TDes

Security issues

The example requires no specific +capabilities in order to run - and does not demonstrate any security issues.

+
InFunct: using +descriptors in function interfaces

Download

Click +on the following link to download the example: InFunct.zip

Download some additional files +required by the example: CommonFramework.zip.

View the example code: browse . View the additional files: browse.

Description

This example +shows how descriptors can be used in function interfaces. Specifically, it +shows the use of:

    +
  • const TDesC& +aString

  • +
  • TDes&

  • +
  • const TDesC8& +aBuffer

  • +
  • TDes8& +aBuffer.

  • +

as function arguments.

Class summary

TBuf TBufC TPtr TPtrC HBufC

Security issues

The +example requires no specific capabilities in order to run - and does not demonstrate +any security issues.

+
HeapBuffer: +heap buffer descriptors

Download

Click on the following +link to download the example: HeapBuffer .zip

Download some additional files +required by the example: CommonFramework.zip.

View the example code: browse . View the additional files: browse.

Description

The example +shows use of the HBufC heap buffer descriptor and:

    +
  • how it can be created +using the HBufC::NewL() static function

  • +
  • how it can be reallocated +using the ReAllocL() function

  • +
  • how its data can be +changed through a TPtr constructed by calling the Des() function

  • +

class summary

HBufC TPtr CleanupStack

Security +issues

The example requires no specific capabilities in order +to run - and does not demonstrate any security issues.

+
Modifier: modifiable +descriptors

Download

Click on the following link +to download the example: Modifier .zip

Download some additional files +required by the example: CommonFramework.zip.

View the example code: + browse . View the additional files: browse.

Description

The example +shows the usage of descriptor functions which can modify the descriptor. These +are the functions defined and implemented by the TDes class: +for example SetLength(), Copy() and Insert().

Class +summary

TDes TBuf TPtr

Security +issues

The example requires no specific capabilities in order +to run - and does not demonstrate any security issues.

+
NonModifier: +non-modifiable descriptors

Download

Click on the +following link to download the example: NonModifier .zip

Download some additional files +required by the example: CommonFramework.zip.

View the example code: + browse . View the additional files: browse.

Description

The example +shows the use of descriptor functions which do not modify the descriptor. +These are the functions defined and implemented by the TDesC class; +for example Length(), Size() and Compare().

Class +summary

TDesC TBufC TPtrC

Security +issues

The example requires no specific capabilities in order +to run - and does not demonstrate any security issues.

+
Pointer: basic +pointer descriptors

Download

Click on the following +link to download the example: Pointer .zip

Download some additional files +required by the example: CommonFramework.zip.

View the example code: + browse . View the additional files: browse.

Description

The example shows +the basic idea of pointer descriptors and how they are used.

Class +summary

TPtr TPtrC TPtrC8 TPtrC16

Security +issues

The example requires no specific capabilities in order +to run - and does not demonstrate any security issues.

+
WriteToFiles: +writes:"Hello World!" to a file

Download

Click on +the following link to download the example: WriteToFiles .zip

Download some additional +files required by the example: CommonFramework.zip.

View the example code: browse . View the additional files: browse.

Description

This writes +the text "Hello World!" to a file. It is used as the basis of all examples +which depend on just the Base and the file server.

Class summary

RFs RFile User TPtrC8

Security issues

The +example writes files to the executable's process private directory: C:\private\0FFFFF00\.

The +second UID in the .mmp file is defined as 0x0FFFFF00 and +this is used as the secure ID on which the name of the private directory is +based.

+
\ No newline at end of file