diff options
author | Alex Zolotarev <deathbaba@gmail.com> | 2010-12-05 19:24:16 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-22 22:33:57 +0300 |
commit | d6e12b7ce4bcbf0ccd1c07eb25de143422913c34 (patch) | |
tree | a7e910c330ce4da9b4f2d8be76067adece2561c4 /platform/platform.hpp |
One Month In Minsk. Made in Belarus.
Diffstat (limited to 'platform/platform.hpp')
-rw-r--r-- | platform/platform.hpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/platform/platform.hpp b/platform/platform.hpp new file mode 100644 index 0000000000..8ed3e1994f --- /dev/null +++ b/platform/platform.hpp @@ -0,0 +1,53 @@ +#pragma once + +#include "../std/string.hpp" +#include "../std/vector.hpp" +#include "../std/utility.hpp" + +#include "../base/start_mem_debug.hpp" + +class Platform +{ +public: + virtual ~Platform() {} + + /// Time in seconds passed from application start + virtual double TimeInSec() = 0; + + /// Full path to read/write project data directory with slash at the end + virtual string WorkingDir() = 0; + /// Full path to read only program resources dir with slash at the end + virtual string ResourcesDir() = 0; + + /// @name File operations + //@{ + typedef vector<string> FilesList; + /// Retrieves files list contained in given directory + /// @param directory directory path with slash at the end + /// @param mask files extension to find, like ".map" etc + /// @return number of files found in outFiles + virtual int GetFilesInDir(string const & directory, string const & mask, FilesList & outFiles) = 0; + /// @return false if file is not exist + virtual bool GetFileSize(string const & file, uint64_t & size) = 0; + /// Renamed to avoid conflict with Windows macroses + virtual bool RenameFileX(string const & original, string const & newName) = 0; + /// Simple check + bool IsFileExists(string const & file) + { + uint64_t dummy; + return GetFileSize(file, dummy); + } + //@} + + virtual int CpuCores() = 0; + + virtual double VisualScale() const = 0; + + virtual string const SkinName() const = 0; + + virtual bool IsMultiSampled() const = 0; +}; + +extern "C" Platform & GetPlatform(); + +#include "../base/stop_mem_debug.hpp" |