00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00037 #ifndef __LRT_SYSTEM__
00038 #define __LRT_SYSTEM__
00039
00040
00041 #ifdef __SYMBIAN32__
00042 class CConsoleBase;
00043 class CLineEdit;
00044 class CTrapCleanup;
00045 #endif
00046
00047 namespace lrt {
00048
00049
00050 class String;
00051 template<class T> class Array;
00052
00057 class Time
00058 {
00059 public:
00061 static Time getCurrentTime();
00062
00064 Time() : sec(0), msec(0) {}
00065
00067 Time(int sec, int msec) : sec(sec), msec(msec) {}
00068
00073 Time(const String&);
00074
00077 Time operator-(const Time& t);
00078
00082 int toInt();
00083
00087 String toString();
00088
00089
00091 int sec;
00093 int msec;
00094
00095 private:
00096
00097 static String months[];
00098
00099 int getMonthNum(const String& monthName);
00100 };
00101
00102
00105 class System
00106 {
00107 public:
00109
00110 enum BreakType { CTRL_C,
00111 TERMINATE
00112 };
00114 typedef void (*BreakFunction)(BreakType);
00115
00117 static void setAppName(const String& appName);
00122 static void setInteractive(bool);
00124 static bool isInteractive();
00125
00129 static void message(const String& str);
00130
00132 static void exit();
00134 static void exit(int);
00136 static void exit(int, const String &);
00139 static void exit(int, const char*);
00149 static void setOnBreak(BreakFunction func, bool catchKill);
00150
00152 static void print(const char *cStr);
00154 static void print(const String &str);
00156 static void println();
00158 static void println(const String &str);
00160 static char read();
00164 static String readLine(const String &query);
00165
00167 static void setPos(int x, int y);
00168
00171 static bool isLittleEndian();
00177 static void fillMemory(void* ptr, int length, char value);
00183 static void copyMemory(const void* src, void* dest, int length);
00184
00185 #ifdef __SYMBIAN32__
00186 static CTrapCleanup *cleanup;
00187 #endif
00188 public:
00189 static BreakFunction lastBreakFunction;
00190 private:
00191 static bool init;
00192 static bool interactive;
00193 static String* appName;
00194 #ifdef __SYMBIAN32__
00195 static CConsoleBase *console;
00196 static CLineEdit *edit;
00197 static void printInternal(const char *cStr, bool isLong, bool addLine);
00198 #endif
00199 static void initialize();
00200 static void finalize();
00201
00202 System() {}
00203 ~System() {}
00204 };
00205
00208 template<class T> int stdCompare(const T& elem1, const T& elem2);
00209 int stdCompare(char elem1, char elem2);
00210
00211 }
00212
00213 #include "rtsystem.templ.cpp"
00214
00215 #endif