diff --git a/include/Utils/Console/Console.h b/include/Utils/Console/Console.h index 613031d..4f75b83 100644 --- a/include/Utils/Console/Console.h +++ b/include/Utils/Console/Console.h @@ -1,159 +1,162 @@ -#ifndef CONSOLE_H_INCLUDED -#define CONSOLE_H_INCLUDED - -/* -This code contains console/log to work with - -Use global variable Console like that: - -*Console<<"something"< -#include - -#ifdef TARGET_WIN32 -#include -#endif -#ifdef TARGET_LINUX -#include -#endif -#ifdef TARGET_ANDROID -#include -#include - -#include "boost/thread.hpp" -#endif - - -#include "include/Render/RenderMisc.h" - - -namespace SE -{ - -extern const std::string CONST_CONSOLE_TEX_NAME; - - - -class TSimpleConsole -{ -protected: - std::string History; - - std::string TextSavedInTriangleList; - - std::shared_ptr HistoryTriangeList; - - - -public: - std::string ConsoleInput; - cardinal ConsoleCursor; - std::vector InputHistory; - cardinal InputHistoryCursor; - - TSimpleConsole() : History(""), TextSavedInTriangleList(""), ConsoleCursor(0), InputHistoryCursor(0) { } - - virtual ~TSimpleConsole() { } - - void Clear() { History = ""; } - - void CutHistory(); - - virtual std::string GetHistory(); - -#ifndef UTILS_ENGINE - virtual void Draw(); -#endif -}; - - -#ifdef TARGET_WIN32 - -class TFileConsole : public TSimpleConsole -{ -protected: - std::string filename; - std::ofstream f; -public: - TFileConsole(); - - TFileConsole(const std::string& Afilename); - - ~TFileConsole(); - - TFileConsole& operator<<(const std::string& s); - - void PrintImmediate(const std::string& s); -}; - -#endif - - -#ifdef TARGET_LINUX - -class TFileConsole : public TSimpleConsole -{ -protected: - std::string filename; - std::ofstream f; -public: - TFileConsole(); - - TFileConsole(const std::string& Afilename); - - ~TFileConsole(); - - TFileConsole& operator<<(const std::string& s); - - void PrintImmediate(const std::string& s); -}; - -#endif - - -#ifdef TARGET_ANDROID - -class TJavaConsole : public TSimpleConsole -{ -protected: - boost::mutex ConsoleMutex; - std::string AppDir; - std::string LogFilename; -public: - - TJavaConsole(); - - TJavaConsole& operator<<(const std::string& s); - - void PrintImmediate(const std::string& s); -}; - -#endif - - -#ifdef TARGET_IOS - -class TIosConsole : public TSimpleConsole -{ -protected: -public: - TIosConsole(); - - //TFileConsole(const std::string& Afilename); - - ~TIosConsole(); - - TIosConsole& operator<<(const std::string& s); - - void PrintImmediate(const std::string& s); -}; - - -#endif - -} //namespace SE - -#endif - +#ifndef CONSOLE_H_INCLUDED +#define CONSOLE_H_INCLUDED + +/* +This code contains console/log to work with + +Use global variable Console like that: + +*Console<<"something"< +#include + +#ifdef TARGET_WIN32 +#include +#endif +#ifdef TARGET_LINUX +#include +#endif +#ifdef TARGET_ANDROID +#include +#include + +#include "boost/thread.hpp" +#endif + +#include "include/Utils/DataTypes/DataTypes.h" + +#ifndef UTILS_ENGINE +#include "include/Render/RenderMisc.h" +#endif + +namespace SE +{ + +extern const std::string CONST_CONSOLE_TEX_NAME; + + + +class TSimpleConsole +{ +protected: + std::string History; + + std::string TextSavedInTriangleList; + +#ifndef UTILS_ENGINE + std::shared_ptr HistoryTriangeList; +#endif + + +public: + std::string ConsoleInput; + cardinal ConsoleCursor; + std::vector InputHistory; + cardinal InputHistoryCursor; + + TSimpleConsole() : History(""), TextSavedInTriangleList(""), ConsoleCursor(0), InputHistoryCursor(0) { } + + virtual ~TSimpleConsole() { } + + void Clear() { History = ""; } + + void CutHistory(); + + virtual std::string GetHistory(); + +#ifndef UTILS_ENGINE + virtual void Draw(); +#endif +}; + + +#ifdef TARGET_WIN32 + +class TFileConsole : public TSimpleConsole +{ +protected: + std::string filename; + std::ofstream f; +public: + TFileConsole(); + + TFileConsole(const std::string& Afilename); + + ~TFileConsole(); + + TFileConsole& operator<<(const std::string& s); + + void PrintImmediate(const std::string& s); +}; + +#endif + + +#ifdef TARGET_LINUX + +class TFileConsole : public TSimpleConsole +{ +protected: + std::string filename; + std::ofstream f; +public: + TFileConsole(); + + TFileConsole(const std::string& Afilename); + + ~TFileConsole(); + + TFileConsole& operator<<(const std::string& s); + + void PrintImmediate(const std::string& s); +}; + +#endif + + +#ifdef TARGET_ANDROID + +class TJavaConsole : public TSimpleConsole +{ +protected: + boost::mutex ConsoleMutex; + std::string AppDir; + std::string LogFilename; +public: + + TJavaConsole(); + + TJavaConsole& operator<<(const std::string& s); + + void PrintImmediate(const std::string& s); +}; + +#endif + + +#ifdef TARGET_IOS + +class TIosConsole : public TSimpleConsole +{ +protected: +public: + TIosConsole(); + + //TFileConsole(const std::string& Afilename); + + ~TIosConsole(); + + TIosConsole& operator<<(const std::string& s); + + void PrintImmediate(const std::string& s); +}; + + +#endif + +} //namespace SE + +#endif + diff --git a/include/Utils/FileUtils/FileUtils.h b/include/Utils/FileUtils/FileUtils.h index 2699654..7b865a3 100644 --- a/include/Utils/FileUtils/FileUtils.h +++ b/include/Utils/FileUtils/FileUtils.h @@ -1,323 +1,325 @@ -#ifndef FILE_UTILS_H_INCLUDED -#define FILE_UTILS_H_INCLUDED - -/* -This code contains API to ease file access - -WINDOWS AND ANDROID -*/ - -#include "include/Utils/DataTypes/DataTypes.h" -#include "include/Utils/Console/Console.h" -#include "boost/shared_array.hpp" - -#ifdef TARGET_WIN32 -#include "include/Utils/WinApi/WinApi.h" -#endif - -#ifdef TARGET_ANDROID -#include "include/Utils/JniApi/JniApi.h" -#endif - -#ifdef TARGET_IOS -#include "include/Utils/IosApi/IosApi.h" -#endif - -namespace SE -{ - -namespace ST -{ - - extern std::string PathToResources; - -} - -bool findString(char* in, char* list); -//utility for opengl extensions parsing. Not safe - - -bool IsFileExistsInUserData(const std::string& filename); - -std::string GetFilePathUserData(const std::string& filename); - - - -//utitily to process texture uploading -inline char* GetFileName(const char* filename) -{ - char* fname = (char*)filename + strlen(filename); - - while ((*fname != '\\')&&(*fname != '/')&&(fname >= filename )) - --fname; - - ++fname; - - return fname; -} - -inline std::string GetFileName(const std::string& filename) -{ - std::string::const_iterator i = filename.end() - 1; - - while ((i > filename.begin() )&&(*i != '\\')&&(*i != '/')) - --i; - - if (*i == '\\' || *i == '/') - { - i++; - } - - return std::string(i, filename.cend()); -} - -//utitily to process texture uploading -inline char* GetFileExt(const char* filename) -{ - char* fext = (char*)filename + strlen(filename); - - while (*fext != '.') - --fext; - - return fext; -} - -inline std::string GetFileExt(const std::string& filename) -{ - std::string::const_iterator i = filename.end() - 1; - - while (*i != '.') - --i; - - return std::string(i, filename.cend()); - -} - -inline std::string GetFileNameWithoutExt(const std::string& filename) -{ - std::string result = GetFileName(filename); - - std::string::const_iterator i = result.end() - 1; - - while (*i != '.') - --i; - - return std::string(result.cbegin(), i); -} - -std::string GetFilePath(const std::string& filename); - - - -#ifdef TARGET_WIN32 - -void GetFileList(const std::string& searchkey, std::vector &list); - -std::string AutocompleteExtension(const std::string& fileName); - -template -boost::shared_array CreateMemFromFile(const std::string& fileName, cardinal& intCount) -{ - cardinal SIZEOF_TYPENAME = sizeof(TYPENAME); - - FILE * pFile; - - long fSize; - - size_t result; - - TYPENAME* fileData; - - - if (fopen_s(&pFile, fileName.c_str(), "rb" ) != 0) - { - throw ErrorToLog("File not loaded: " + fileName); - } - - // obtain file size: - fseek (pFile , 0 , SEEK_END); - fSize = ftell (pFile); - rewind (pFile); - - fileData = new TYPENAME [fSize % SIZEOF_TYPENAME == 0 ? fSize/SIZEOF_TYPENAME : fSize/SIZEOF_TYPENAME + 1]; - - result = fread (&fileData[0], 1, fSize, pFile); - - if (result != fSize) - { - throw ErrorToLog("File not loaded: " + fileName); - } - - // terminate - fclose (pFile); - - intCount = fSize; - - return boost::shared_array(fileData); - -} -#endif - -#ifdef TARGET_LINUX - -template -boost::shared_array CreateMemFromFile(const std::string& fileName, cardinal& intCount) -{ - cardinal SIZEOF_TYPENAME = sizeof(TYPENAME); - - FILE * pFile; - - long fSize; - - size_t result; - - TYPENAME* fileData; - - - if (fopen(&pFile, fileName.c_str(), "rb" ) != 0) - { - throw ErrorToLog("File not loaded: " + fileName); - } - - // obtain file size: - fseek (pFile , 0 , SEEK_END); - fSize = ftell (pFile); - rewind (pFile); - - fileData = new TYPENAME [fSize % SIZEOF_TYPENAME == 0 ? fSize/SIZEOF_TYPENAME : fSize/SIZEOF_TYPENAME + 1]; - - result = fread (&fileData[0], 1, fSize, pFile); - - if (result != fSize) - { - throw ErrorToLog("File not loaded: " + fileName); - } - - // terminate - fclose (pFile); - - intCount = fSize; - - return boost::shared_array(fileData); - -} -#endif - -#ifdef TARGET_ANDROID - -template -boost::shared_array CreateMemFromFile(const std::string& fileName, cardinal& intCount) -{ - if (std::string(fileName.begin(), fileName.begin() + 5) == "/data") - { - *Console<<"File is in userdata - "+fileName; - - cardinal SIZEOF_TYPENAME = sizeof(TYPENAME); - - FILE * pFile; - - long fSize; - - size_t result; - - TYPENAME* fileData; - - std::string realFileName = fileName; - - pFile = fopen ( realFileName.c_str(), "rb" ); - if (pFile == NULL) - { - throw ErrorToLog("File not loaded: " + fileName); - } - - // obtain file size: - fseek (pFile , 0 , SEEK_END); - fSize = ftell (pFile); - rewind (pFile); - - fileData = new TYPENAME [fSize % SIZEOF_TYPENAME == 0 ? fSize/SIZEOF_TYPENAME : fSize/SIZEOF_TYPENAME + 1]; - - result = fread (&fileData[0], 1, fSize, pFile); - - if (result != fSize) - { - throw ErrorToLog("File not loaded: " + fileName); - } - - // terminate - fclose (pFile); - - intCount = fSize; - - return boost::shared_array(fileData); - } - - *Console<<"File is in resources - "+fileName; - - return JniCreateMemFromFile(fileName, intCount); -} - - -#endif - -#ifdef TARGET_IOS - -template -boost::shared_array CreateMemFromFile(const std::string& fileName, cardinal& intCount) -{ - cardinal SIZEOF_TYPENAME = sizeof(TYPENAME); - - FILE * pFile; - - long fSize; - - size_t result; - - TYPENAME* fileData; - - std::string realFileName = IosGetFileReadPath(fileName); - - pFile = fopen ( realFileName.c_str(), "rb" ); - if (pFile == NULL) - { - throw ErrorToLog("File not loaded: " + fileName); - } - - // obtain file size: - fseek (pFile , 0 , SEEK_END); - fSize = ftell (pFile); - rewind (pFile); - - fileData = new TYPENAME [fSize % SIZEOF_TYPENAME == 0 ? fSize/SIZEOF_TYPENAME : fSize/SIZEOF_TYPENAME + 1]; - - result = fread (&fileData[0], 1, fSize, pFile); - - if (result != fSize) - { - throw ErrorToLog("File not loaded: " + fileName); - } - - // terminate - fclose (pFile); - - intCount = fSize; - - return boost::shared_array(fileData); - -} - - -#endif - -#ifdef TARGET_IOS - -//Special for IOS, because Foundation.h conflicts with sq_plus.h - -// Obviously, this returns ST::PathToResources - -std::string GetPathToResources(); -#endif - -} //namespace SE - +#ifndef FILE_UTILS_H_INCLUDED +#define FILE_UTILS_H_INCLUDED + +/* +This code contains API to ease file access + +WINDOWS AND ANDROID +*/ + +#include "include/Utils/DataTypes/DataTypes.h" +#include "include/Utils/ErrorTypes/ErrorTypes.h" +#include "include/Utils/Console/Console.h" +#include "boost/shared_array.hpp" + +#ifdef TARGET_WIN32 +#include "include/Utils/WinApi/WinApi.h" +#endif + +#ifdef TARGET_ANDROID +#include "include/Utils/JniApi/JniApi.h" +#endif + +#ifdef TARGET_IOS +#include "include/Utils/IosApi/IosApi.h" +#endif + +namespace SE +{ + +namespace ST +{ + + extern std::string PathToResources; + +} + +bool findString(char* in, char* list); +//utility for opengl extensions parsing. Not safe + + +bool IsFileExistsInUserData(const std::string& filename); + +std::string GetFilePathUserData(const std::string& filename); + + + +//utitily to process texture uploading +inline char* GetFileName(const char* filename) +{ + char* fname = (char*)filename + strlen(filename); + + while ((*fname != '\\')&&(*fname != '/')&&(fname >= filename )) + --fname; + + ++fname; + + return fname; +} + +inline std::string GetFileName(const std::string& filename) +{ + std::string::const_iterator i = filename.end() - 1; + + while ((i > filename.begin() )&&(*i != '\\')&&(*i != '/')) + --i; + + if (*i == '\\' || *i == '/') + { + i++; + } + + return std::string(i, filename.cend()); +} + +//utitily to process texture uploading +inline char* GetFileExt(const char* filename) +{ + char* fext = (char*)filename + strlen(filename); + + while (*fext != '.') + --fext; + + return fext; +} + +inline std::string GetFileExt(const std::string& filename) +{ + std::string::const_iterator i = filename.end() - 1; + + while (*i != '.') + --i; + + return std::string(i, filename.cend()); + +} + +inline std::string GetFileNameWithoutExt(const std::string& filename) +{ + std::string result = GetFileName(filename); + + std::string::const_iterator i = result.end() - 1; + + while (*i != '.') + --i; + + return std::string(result.cbegin(), i); +} + +std::string GetFilePath(const std::string& filename); + + + +#ifdef TARGET_WIN32 + +void GetFileList(const std::string& searchkey, std::vector &list); + +std::string AutocompleteExtension(const std::string& fileName); + +template +boost::shared_array CreateMemFromFile(const std::string& fileName, cardinal& intCount) +{ + cardinal SIZEOF_TYPENAME = sizeof(TYPENAME); + + FILE * pFile; + + long fSize; + + size_t result; + + TYPENAME* fileData; + + + if (fopen_s(&pFile, fileName.c_str(), "rb" ) != 0) + { + throw ErrorToLog("File not loaded: " + fileName); + } + + // obtain file size: + fseek (pFile , 0 , SEEK_END); + fSize = ftell (pFile); + rewind (pFile); + + fileData = new TYPENAME [fSize % SIZEOF_TYPENAME == 0 ? fSize/SIZEOF_TYPENAME : fSize/SIZEOF_TYPENAME + 1]; + + result = fread (&fileData[0], 1, fSize, pFile); + + if (result != fSize) + { + throw ErrorToLog("File not loaded: " + fileName); + } + + // terminate + fclose (pFile); + + intCount = fSize; + + return boost::shared_array(fileData); + +} +#endif + +#ifdef TARGET_LINUX + +template +boost::shared_array CreateMemFromFile(const std::string& fileName, cardinal& intCount) +{ + cardinal SIZEOF_TYPENAME = sizeof(TYPENAME); + + FILE * pFile; + + long fSize; + + size_t result; + + TYPENAME* fileData; + + pFile = fopen(fileName.c_str(), "rb" ); + + if (!pFile) + { + throw ErrorToLog("File not loaded: " + fileName); + } + + // obtain file size: + fseek (pFile , 0 , SEEK_END); + fSize = ftell (pFile); + rewind (pFile); + + fileData = new TYPENAME [fSize % SIZEOF_TYPENAME == 0 ? fSize/SIZEOF_TYPENAME : fSize/SIZEOF_TYPENAME + 1]; + + result = fread (&fileData[0], 1, fSize, pFile); + + if (result != fSize) + { + throw ErrorToLog("File not loaded: " + fileName); + } + + // terminate + fclose (pFile); + + intCount = fSize; + + return boost::shared_array(fileData); + +} +#endif + +#ifdef TARGET_ANDROID + +template +boost::shared_array CreateMemFromFile(const std::string& fileName, cardinal& intCount) +{ + if (std::string(fileName.begin(), fileName.begin() + 5) == "/data") + { + *Console<<"File is in userdata - "+fileName; + + cardinal SIZEOF_TYPENAME = sizeof(TYPENAME); + + FILE * pFile; + + long fSize; + + size_t result; + + TYPENAME* fileData; + + std::string realFileName = fileName; + + pFile = fopen ( realFileName.c_str(), "rb" ); + if (pFile == NULL) + { + throw ErrorToLog("File not loaded: " + fileName); + } + + // obtain file size: + fseek (pFile , 0 , SEEK_END); + fSize = ftell (pFile); + rewind (pFile); + + fileData = new TYPENAME [fSize % SIZEOF_TYPENAME == 0 ? fSize/SIZEOF_TYPENAME : fSize/SIZEOF_TYPENAME + 1]; + + result = fread (&fileData[0], 1, fSize, pFile); + + if (result != fSize) + { + throw ErrorToLog("File not loaded: " + fileName); + } + + // terminate + fclose (pFile); + + intCount = fSize; + + return boost::shared_array(fileData); + } + + *Console<<"File is in resources - "+fileName; + + return JniCreateMemFromFile(fileName, intCount); +} + + +#endif + +#ifdef TARGET_IOS + +template +boost::shared_array CreateMemFromFile(const std::string& fileName, cardinal& intCount) +{ + cardinal SIZEOF_TYPENAME = sizeof(TYPENAME); + + FILE * pFile; + + long fSize; + + size_t result; + + TYPENAME* fileData; + + std::string realFileName = IosGetFileReadPath(fileName); + + pFile = fopen ( realFileName.c_str(), "rb" ); + if (pFile == NULL) + { + throw ErrorToLog("File not loaded: " + fileName); + } + + // obtain file size: + fseek (pFile , 0 , SEEK_END); + fSize = ftell (pFile); + rewind (pFile); + + fileData = new TYPENAME [fSize % SIZEOF_TYPENAME == 0 ? fSize/SIZEOF_TYPENAME : fSize/SIZEOF_TYPENAME + 1]; + + result = fread (&fileData[0], 1, fSize, pFile); + + if (result != fSize) + { + throw ErrorToLog("File not loaded: " + fileName); + } + + // terminate + fclose (pFile); + + intCount = fSize; + + return boost::shared_array(fileData); + +} + + +#endif + +#ifdef TARGET_IOS + +//Special for IOS, because Foundation.h conflicts with sq_plus.h + +// Obviously, this returns ST::PathToResources + +std::string GetPathToResources(); +#endif + +} //namespace SE + #endif \ No newline at end of file diff --git a/include/Utils/SerializeInterface/SerializeInterface.h b/include/Utils/SerializeInterface/SerializeInterface.h index 493232b..04b8910 100644 --- a/include/Utils/SerializeInterface/SerializeInterface.h +++ b/include/Utils/SerializeInterface/SerializeInterface.h @@ -1,62 +1,63 @@ -#ifndef SERIALIZE_INTERFACE_H_INCLUDED -#define SERIALIZE_INTERFACE_H_INCLUDED - -#include "include/Utils/DataTypes/DataTypes.h" -#include "include/Utils/ErrorTypes/ErrorTypes.h" -#include "boost/property_tree/ptree.hpp" -#include "boost/property_tree/xml_parser.hpp" -#include "boost/shared_array.hpp" - -#include "boost/foreach.hpp" -#include - -namespace SE -{ - -std::shared_ptr StringToPropertyTree(std::string xmlCode, std::map replaceMap = std::map()); - -std::shared_ptr FileToPropertyTree(boost::shared_array xmlFileArr, cardinal xmlFileSize, std::map replaceMap = std::map()); - -std::shared_ptr FileToPropertyTree(const std::string& fileName, std::map replaceMap = std::map()); - - -class TSerializeInterface -{ -public: - virtual void Serialize(boost::property_tree::ptree& propertyTree) - { - } - -}; - - -template -class TMapParser : public TSerializeInterface -{ -public: - std::map Map; - - virtual void Serialize(boost::property_tree::ptree& propertyTree) - { - - BOOST_FOREACH(boost::property_tree::ptree::value_type& subTree, propertyTree) - { - TKEY key = subTree.second.get(".key"); - TVALUE value = subTree.second.get(".value"); - - Map[key] = value; - } - } -}; - -template -std::map SerializeToMap(boost::property_tree::ptree& propertyTree) -{ - TMapParser mapParser; - mapParser.Serialize(propertyTree); - return mapParser.Map; -} - -} //namespace SE - +#ifndef SERIALIZE_INTERFACE_H_INCLUDED +#define SERIALIZE_INTERFACE_H_INCLUDED + +#include "include/Utils/DataTypes/DataTypes.h" +#include "include/Utils/ErrorTypes/ErrorTypes.h" +#include "boost/property_tree/ptree.hpp" +#include "boost/property_tree/xml_parser.hpp" +#include "boost/shared_array.hpp" + +#include "boost/foreach.hpp" +#include +#include + +namespace SE +{ + +std::shared_ptr StringToPropertyTree(std::string xmlCode, std::map replaceMap = std::map()); + +std::shared_ptr FileToPropertyTree(boost::shared_array xmlFileArr, cardinal xmlFileSize, std::map replaceMap = std::map()); + +std::shared_ptr FileToPropertyTree(const std::string& fileName, std::map replaceMap = std::map()); + + +class TSerializeInterface +{ +public: + virtual void Serialize(boost::property_tree::ptree& propertyTree) + { + } + +}; + + +template +class TMapParser : public TSerializeInterface +{ +public: + std::map Map; + + virtual void Serialize(boost::property_tree::ptree& propertyTree) + { + + BOOST_FOREACH(boost::property_tree::ptree::value_type& subTree, propertyTree) + { + TKEY key = subTree.second.get(".key"); + TVALUE value = subTree.second.get(".value"); + + Map[key] = value; + } + } +}; + +template +std::map SerializeToMap(boost::property_tree::ptree& propertyTree) +{ + TMapParser mapParser; + mapParser.Serialize(propertyTree); + return mapParser.Map; +} + +} //namespace SE + #endif \ No newline at end of file diff --git a/include/Utils/Utils.h b/include/Utils/Utils.h index 255459c..b6ad9d8 100644 --- a/include/Utils/Utils.h +++ b/include/Utils/Utils.h @@ -1,45 +1,45 @@ -#ifndef UTILS_H_INCLUDED -#define UTILS_H_INCLUDED -/* -This code combines additional routines (such as console/log, exceptions, math utils, file utils) for engine to use -*/ - -#include -#include -#include -#include -#include "boost/shared_array.hpp" -#include "boost/property_tree/ptree.hpp" -#include "boost/foreach.hpp" - -#include "boost/asio.hpp" -#include "boost/date_time/posix_time/posix_time.hpp" -#include "boost/signal.hpp" - - -#include "include/Utils/Console/Console.h" -#include "include/Utils/ErrorTypes/ErrorTypes.h" -#include "../GlobalConst.h" -#include "include/Utils/FileUtils/FileUtils.h" -#include "include/Utils/SerializeInterface/SerializeInterface.h" - -#include "include/Utils/BindableVar.h" -#include "include/Utils/SimpleTimer.h" -#include "include/Utils/ThreadUtils.h" -#include "include/Utils/Network/Network.h" -#include "include/Utils/Network/Server.h" - -#ifdef TARGET_WIN32 -#include "WinApi/WinApi.h" -#endif - -#ifdef TARGET_ANDROID -#include "JniApi/JniApi.h" -#endif - -#ifdef TARGET_IOS -#include "IosApi/IosApi.h" -#endif - - +#ifndef UTILS_H_INCLUDED +#define UTILS_H_INCLUDED +/* +This code combines additional routines (such as console/log, exceptions, math utils, file utils) for engine to use +*/ + +#include +#include +#include +#include +#include "boost/shared_array.hpp" +#include "boost/property_tree/ptree.hpp" +#include "boost/foreach.hpp" + +#include "boost/asio.hpp" +#include "boost/date_time/posix_time/posix_time.hpp" +#include "boost/signal.hpp" + + +#include "include/Utils/Console/Console.h" +#include "include/Utils/ErrorTypes/ErrorTypes.h" +#include "../GlobalConst.h" +#include "include/Utils/FileUtils/FileUtils.h" +#include "include/Utils/SerializeInterface/SerializeInterface.h" + +#include "include/Utils/BindableVar.h" +#include "include/Utils/SimpleTimer.h" +#include "include/Utils/ThreadUtils.h" +#include "include/Utils/Network/Network.h" +#include "include/Utils/Network/Server.h" + +#ifdef TARGET_WIN32 +#include "WinApi/WinApi.h" +#endif + +#ifdef TARGET_ANDROID +#include "JniApi/JniApi.h" +#endif + +#ifdef TARGET_IOS +#include "IosApi/IosApi.h" +#endif + + #endif \ No newline at end of file