X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FUtils%2FFolders.hpp;h=c2c85877c2017b74750eb2aa5d37282f25e65d07;hb=6f9609cebe4bcb87a7722b628b02a1975c56148c;hp=d812d10295db6fcc8b05785002e253d7306af48a;hpb=eae73ddd7a006ee6de9ffb01f3ec5f8e5fdc6d85;p=lugaru.git diff --git a/Source/Utils/Folders.hpp b/Source/Utils/Folders.hpp index d812d10..c2c8587 100644 --- a/Source/Utils/Folders.hpp +++ b/Source/Utils/Folders.hpp @@ -1,6 +1,6 @@ /* Copyright (C) 2003, 2010 - Wolfire Games -Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file) +Copyright (C) 2010-2017 - Lugaru contributors (see AUTHORS file) This file is part of Lugaru. @@ -27,15 +27,17 @@ along with Lugaru. If not, see . #define DATA_DIR "Data" #endif -struct FileNotFoundException: public std::exception +struct FileNotFoundException : public std::exception { std::string errorText; - - FileNotFoundException (const std::string& filename) - : errorText(filename + " could not be found") - {} - const char * what () const throw () { + FileNotFoundException(const std::string& filename) + : errorText(filename + " could not be found") + { + } + + const char* what() const throw() + { return errorText.c_str(); } }; @@ -60,16 +62,21 @@ public: /* Returns full path for a game resource */ static inline std::string getResourcePath(const std::string& filepath) - { return dataDir + '/' + filepath; } + { + return dataDir + '/' + filepath; + } /** Returns full path for user progress save */ static inline std::string getUserSavePath() - { return getUserDataPath() + "/users"; } + { + return getUserDataPath() + "/users"; + } + + static bool makeDirectory(const std::string& path); private: static const char* getHomeDirectory(); static std::string getGenericDirectory(const char* ENVVAR, const std::string& fallback); - static bool makeDirectory(const std::string& path); }; #endif /* _FOLDERS_H_ */