Copy Link
Add to Bookmark
Report

4x01 Symbian C++ Reference - Part 1

eZine's profile picture
Published in 
phearless
 · 9 months ago

                                 
...................
...::: phearless zine #4 :::...

...............>---[ Symbian C++ Reference - Part 1 ]---<................

..........................>---[ by argv ]---<............................
argv.cpp[at]gmail[dot]com

Sadrzaj:

[0] Intro/Outro
[1] Basics
[2] Prefixes
[3] Sufixes
[4] Classes
[5] Types

////////////////////////////////////////////////////////////////////////////
--==<[ 0. Intro/Outro
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

C++ za Symbian nije toliko drukciji po funkcionalnosti, ali se dosta razlikuje
po sintaksi i nacinu koristenja odredjenih funkcija. Posto je ovo relativno
veliko podrucje, odlucio sam razbiti ga u nekoliko chaptera (vjerovatno 3).
Za ovaj broj zinea ubacio sam samo osnove dok ce ostala 2 chaptera doci sa
brojem 5.

////////////////////////////////////////////////////////////////////////////
--==<[ 1. Basics
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Prvo slovo neke klase uvijek mora pocinjati sa velikim slovom. npr:

class TNekaKlasa

Rijeci koje oznacavaju varijablu ili ime funkcije takodjer pocinju sa velikim
slovom, dok parametri funkcije pocinju s malim. npr:

void NekaFunkcija();
TInt mojaLokalnaVarijabla;
CVarijabla* iNekiMember;

////////////////////////////////////////////////////////////////////////////
--==<[ 2. Prefixes
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

neki od prefixa koji se koriste su:

TInt iTimer; -> i = instance
void NekaFunkcija(TBool aPrimjerBool, const TDesC& aName); -> a = argument
enum TImena {EIvo, EIvica, EIvana}; -> E = enumeracija
const TInt KMaxFilenameLength = 256; -> K = konstantno (const)
#define KMaxFilenameLength 256 -> #define za const

////////////////////////////////////////////////////////////////////////////
--==<[ 3. Sufixes
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

neki od sufixa koji se koriste su:

void ConstructL(); -> L oznacava da se funkcija smije prekinuti nakon sto zavrsi.

CAplikacija* NewLC(); -> C oznacava da funkcija vraca pointer na CleanupStack
i zatim izlazi.

TInt IzvrsiLD(TInt aResourceId); -> D oznacava da ce referirani objekt biti
izbrisan nakon izvrsenja funkcije.

////////////////////////////////////////////////////////////////////////////
--==<[ 4. Classes
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Klase imaju 4 moguca prefixa, to su:

C(Class) - ove klase potjecu iz CBase headera (e32base.h) i mogu koristiti
Stack i StackCleanup metode.
primjer: LOCAL_C void CNekaKlasa()

R(Resource) - ove klase sluze za kontrolu svih vanjskih resursa koje vasa
aplikacija koristi (slike, ikone...)
primjer: RESOURCE NekiResource

T(Type) - ove klase koriste 'built-in tipove' i nije im potreban pointer ili
handle za pristup.
primjer: LOCAL_C void TDriveInfo()

M(Mixed) - ove klase mogu sadrzavati sve ostale klase i tako mozda smanjiti
kolicinu posla, ali ovo je jos experimental i ne preporucujem.

////////////////////////////////////////////////////////////////////////////
--==<[ 5. Types
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Osnovni Tipovi su:

TIntX i TUintX (X = 8,16,32 bit) (TIntX = SIGNED, TUintX = UNSIGNED)
TReal32 i TReal64 (TReal32 = float, TReal64 = double)
TTextX (X = 8,16 bit) za signed integere
TAny* (TAny* == void*) (void MojaFunkcija(TAny* aPointerNaParametar);
TBool (TBool == True(1) or False(0))

--
Greetz

Blackhat

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT