00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00029 #include "mystringreverse.h"
00030
00031 LOCAL_D CConsoleBase* console;
00032
00033 LOCAL_C void DoStartL();
00034 LOCAL_C void CallExampleL();
00035
00036 LOCAL_C void DoStartL()
00037 {
00038
00039 CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
00040 CleanupStack::PushL(scheduler);
00041 CActiveScheduler::Install(scheduler);
00042
00043 _LIT(KTextDbllist,"Double Linked List Demo\nEnter the characters of the string\n");
00044 console->Printf(KTextDbllist);
00045
00046 CMyStringReverse* stringreverse = CMyStringReverse::NewL(console);
00047 CleanupStack::PushL(stringreverse);
00048
00049
00050
00051 stringreverse->ReadOption();
00052
00053
00054 CActiveScheduler::Start();
00055
00056
00057 CleanupStack::PopAndDestroy(2, scheduler);
00058 }
00059
00060 GLDEF_C TInt E32Main()
00061 {
00062 __UHEAP_MARK;
00063 CTrapCleanup* cleanup=CTrapCleanup::New();
00064 TRAPD(error, CallExampleL());
00065 delete cleanup;
00066 __ASSERT_ALWAYS(!error, User::Panic(KTxtEPOC32EX, error));
00067 __UHEAP_MARKEND;
00068 return 0;
00069 }
00070
00071 LOCAL_C void CallExampleL()
00072 {
00073 console=Console::NewL(KTxtExampleCode, TSize(KConsFullScreen, KConsFullScreen));
00074 CleanupStack::PushL(console);
00075 TRAPD(error, DoStartL());
00076 if (error)
00077 console->Printf(KFormatFailed, error);
00078 else
00079 console->Printf(KTxtOK);
00080 console->Printf(KTextPressAnyKey);
00081 console->Getch();
00082 CleanupStack::PopAndDestroy();
00083 }