00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __BASTD_H
00018 #define __BASTD_H
00019
00020 #include <e32cons.h>
00021 #include <f32file.h>
00022 #include <barsc.h>
00023 #include <barsread.h>
00024
00025
00026
00027 LOCAL_D CConsoleBase* console;
00028 LOCAL_D RFs fsSession;
00029 LOCAL_C void doExampleL();
00030
00031
00032 LOCAL_C void callExampleL();
00033
00034 GLDEF_C TInt E32Main()
00035 {
00036 _LIT(KBaflEx,"BAFLEX");
00037 __UHEAP_MARK;
00038 if (fsSession.Connect()!=KErrNone)
00039 return KErrGeneral;
00040 CTrapCleanup* cleanup=CTrapCleanup::New();
00041 TRAPD(error,callExampleL());
00042 fsSession.Close();
00043 __ASSERT_ALWAYS(!error,User::Panic(KBaflEx,error));
00044 delete cleanup;
00045 __UHEAP_MARKEND;
00046 return 0;
00047 }
00048
00049 LOCAL_C void callExampleL()
00050 {
00051 _LIT(KExampleCode,"SDK Example Code");
00052 _LIT(KFailedLeave,"failed: leave code=%d");
00053 _LIT(KOk,"ok");
00054 _LIT(KPressAnyKey," [press any key]");
00055
00056 console=Console::NewL(KExampleCode,TSize(KConsFullScreen,KConsFullScreen));
00057 CleanupStack::PushL(console);
00058 TRAPD(error,doExampleL());
00059 if (error)
00060 console->Printf(KFailedLeave, error);
00061 else
00062 console->Printf(KOk);
00063 console->Printf(KPressAnyKey);
00064 console->Getch();
00065 CleanupStack::PopAndDestroy();
00066 }
00067
00068 #endif