00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <iostream>
00023
00024 #include "case.h"
00025 #include "uimanager.h"
00026
00028 namespace Utils {
00029
00031 enum MessageType { MESSAGE_CRITICAL=0, MESSAGE_WARNING };
00032
00034 extern bool g_DebugOn;
00035
00037 namespace FS {
00038
00042 ustring cwd();
00043
00048 void move(const ustring &from, const ustring &to);
00049
00054 bool dirExists(const ustring &path);
00055
00059 void makeDir(const ustring &path);
00060
00064 void removeDir(const ustring &path);
00065
00066 }
00067
00073 void alert(const ustring &text, const MessageType &type=MESSAGE_CRITICAL);
00074
00082 void scriptToLimits(const ustring &str, UI::Limit &start, UI::Limit &end);
00083
00088 Color keyToColor(char ch);
00089
00094 void debugMessage(const ustring &msg);
00095
00101 bool pointInRect(const Point &p, const Rect &rect);
00102
00107 Point calculateShakePoint(int highestRadius);
00108
00114 int randomRange(int min, int max);
00115
00120 Point getMouseLocation(Uint8 *modState=NULL);
00121
00127 SDL_Surface* createSurface(int width, int height);
00128
00133 ustring ucharToStr(uchar ch);
00134
00139 ustring itoa(int num);
00140
00146 StringVector explodeString(const ustring &delimiter, const ustring &str);
00147
00153 StringVector explodeString(uchar delimiter, const ustring &str);
00154
00160 int amountInString(const ustring &sub, const ustring &str);
00161
00162 };