Chapter 3. Symbian OS Development Basics

This chapter explains some of the essential topics needed to write C++ on Symbian OS. To discuss every Symbian C++ concept would take an entire book, so we only discuss the concepts that you need to understand the examples and discussion in the following chapters of this book.

Fundamental Data Types on Symbian OS

Symbian OS defines a set of fundamental types which, for compiler independence, are used instead of the native built-in C++ types. These are provided as a set of typedefs as shown in Table 3.1, and can be found in the Symbian header file e32def.h.

The fundamental Symbian OS types should always be used instead of the native types (that is, use TInt instead of int and so on). However, there is one exception, which is that you should always use void when a function or method has no return type, instead of TAny.

The following example defines an 8-bit signed integer x and assigns the value 123:

TInt8 x = 123;

The following example defines a 64-bit signed integer y and assigns a value to it:

TInt64 y = MAKE_TINT64(0x1234567, 0x89ABCDEF);

The following example defines two 32-bit unsigned integers, a and b, and assigns them with the low word and high word of y respectively:

TUint32 a = I64LOW(y);
TUint32 b = I64HIGH(y);

Table 3.1. Fundamental Data Types on Symbian OS

Data types

Description

C++ built-in types

TInt

Signed integer. It is guaranteed to be at least 32 bits in all implementations

signed int

TUint

Unsigned integer. It is guaranteed to be at least ...

Get Quick Recipes on Symbian OS: Mastering C++ Smartphone Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.