Symbian OS uses object-oriented C + +, but there are some differences from standard C + +. Symbian OS, for example, does not have standard exception handling (Exception) because it does not standardize exception handling when designing Symbian OS. So Symbian designed its own exception handling mechanism: TRAP, leave. The other is the basic type to be spoken today. Symbian basically does not use any standard C + + basic type, and it is well known that different C + + editors have different understanding of the length of int, unsigned int, so tint8,tint16,tint32 is used in Symbian OS.
However, if you do not have a good reason to use a particular length, you should use tint. Many other types also adhere to this principle. For example in the future to speak of TBuf8, TBUF16 can best use for tbuf.
| Type |
Description |
| TInt8, TUint8 |
8-bit integer |
| TInt16, TUint16 |
16-bit integer |
| TInt32, TUint32 |
32-bit integer |
| TInt, Tuint |
(32-bit) integer |
| TReal32, TReal64 |
Real |
| TText8, TText16 |
character, equivalent to unsigned char,
unsigned short int |
| Tbool |
Boolean |
| Tany |
equivalent to void |
Code specification
Symbian OS uses a lot of code specifications that can be used to enhance the readability of symbain code, and some specifications even need to be strictly adhered to, such as the naming of classes:
| Kinds |
Example |
Description |
| T classes |
Tdesc, Tpoint |
This class can be used like a basic type because they are usually small and do not use heap so there is no destructor |
| C classes |
Cconsolebase, Cactive |
This class is the most used class by Symbian, and C represents their inheritance from the CBase class, and they must have destructors because their objects are created in heap |
| R classes |
Rfile, Rtimer |
R represents resources (Resource), they are just a handle to a system resource, they are created on the stack themselves, but the resources they use are created on the heap and need close () after use. |
| M classes |
Meikmenuobserver |
This class is an empty interface that needs to inherit from it when used |
| Static classes |
User, Math |
This class has only static functions, which are generally library functions. |
| Structs |
Seikcontrolinfo |
C-struct |
Variable naming
| category |
example |
description |
| enum |
EMONDAY,ETUESDA Y |
e represents enumerations |
| quantitative |
kmaxfilename |
member Variable |
idevice, IX |
i represents a member variable |
| parameter |
adevice, AX |
a represents the parameter |
| local variable |
device, x< /td> |
local variable does not have a fixed specification |
In addition, the name of the function, but to talk about the concept of leave before you can understand, so here is not introduced. This lesson is very boring, but clear some concepts, the next lesson we take a closer look at the graphical interface of the HelloWorld.