#ifndef _UTILS_H_ #define _UTILS_H_ #include #if defined (WIN32) || defined (LINUX) || defined (IOS) #else #include #include #include #include #include #include #include #include #include #include #endif #include #include #include #include #include #include #include using std::string; //string manipulation methods string& trim(string &str); string& ltrim(string &str); string& rtrim(string &str); std::string join(vector &v, string delim = " "); std::vector &split(const std::string &s, char delim, std::vector &elems); std::vector split(const std::string &s, char delim); //splits a string with "delim" and returns a vector of strings. std::string wordWrap(std::string s, float width, int fontId); int loadRandValues(string s); int filesize(const char * filename); int fileExists(const char * filename); int WRand(); #ifdef LINUX void dumpStack(); #endif /* RAM simple check functions header */ // *** DEFINES *** #if defined (WIN32) || defined (LINUX) || defined (IOS) #define RAM_BLOCK (100 * 1024 * 1024) #else #define RAM_BLOCK (1024 * 1024) #endif // *** FUNCTIONS DECLARATIONS *** u32 ramAvailableLineareMax (void); u32 ramAvailable (void); #ifdef WIN32 #include #define MAKEDIR(name) mkdir(name) #else #include #define MAKEDIR(name) mkdir(name, 0777) #endif #endif