Nokia N97 SDK
Example Applications Guide

String Utilities Library Example

1. About this Example
2. Prerequisites
3. Design and Implementation


1. About this Example

For those who have worked on Symbian, string manipulation on Symbian is bit tricky. Even though Symbian has rich set of Apis for formatting/manipulating strings with both UNICODE (16 bit variants) and narrow character sets (8-bits), using those Apis will be bit complex for those who have familiarized Standard C string manipulations.

When one writes hybrid applications on Symbian using native Symbian Apis as well as Open C Apis, user may need to convert the SYMBIAN descriptors to standard C character strings and vice versa. Especially, in case of writing hybrid applications on open C, user will be facing this conversion problem more frequently. It is really difficult to do these conversions without the thorough knowledge of SYMBIAN descriptors.

OpenCStringUtilitiesEx is a library, which makes Open C’s developers life easy. OpenCStringUtilitiesEx is a library, which exports several string- utility Apis for descriptor to character string conversions and vice versa. With the help of this library, user will be able to write a hybrid application on Open C, with out knowing much about SYMBIAN descriptors.


1.1 Apis demonstrated


1.2 Building the Application

The OpenCStringUtilitiesEx Library application consists of two modules, which should be built in the following order:
  1. Library - which builds the generic OpenCStringUtilitiesEx library [ i.e. OpenCStringUtilitiesLibEx ].
  2. exe - which builds an EXE that demonstrates the usage of this library. [ i.e. OpenCStringUtilitiesExeEx ].

The definition for the whole application can be found in the bld.inf file in the group subdirectory of the applications main directory.


2. Prerequisites

This example requires a familiarity with the C programming language, and access to the OE standard library documentation. As, this example uses OE Standard library, the reader is recommended to read the following topics from the OE SDK documentation before proceeding:


3. Design and Implementation

3.1 Capabilities

The program capabilities are defined in:

stringutils.mmp file (DLL - library): CAPABILITY NONE stringutils_example.mmp file (EXE - application): CAPABILITY NONE.

3.2 Module hierarchy

This application has 2 modules as below:

This example will create a DLL which exports set of generic Apis for the user using which one can do SYMBIAN descriptor to character string conversions and vice versa.

To give an rough idea on how to use these Apis, an EXE is provided that calls the Apis of OpenCStringUtilitiesLibEx and illustrates the use of the Apis.

3.3 Implementation details of Library

This DLL (OpenCMessageQueueLibraryEx) exports the following Apis:

Apart from these, it supports following Apis, which are aliased with its corresponding TBufC counterparts as shown below,

Internally, these api use wide character Apis of libc like:

3.4 Implementation details of EXE

OpenCStringUtilitiesExeEx is C Application that uses String-utils library. This application uses main() as an entry point for the application. The application is simple console based application. This has use cases for using String-utils library (OpenCStringUtilitiesLibEx.dll) Apis.

It has its own icon and can be launched from the UI both in the emulator and in the device.


© Nokia 2009

Back to top