/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #pragma once #include namespace OpenVulkano { class PlatformFolders { std::filesystem::path dataHome, configHome, stateDir, dataCache, tempDir; std::filesystem::path userHome, desktop, documents, downloads, pictures, publicDir, music, video, savedGames; PlatformFolders(); static PlatformFolders& GetInstance(); public: [[nodiscard]] static const std::filesystem::path& GetDataHomeDir() { return GetInstance().dataHome; } [[nodiscard]] static const std::filesystem::path& GetConfigHomeDir() { return GetInstance().configHome; } [[nodiscard]] static const std::filesystem::path& GetStateDir() { return GetInstance().stateDir; } [[nodiscard]] static const std::filesystem::path& GetCacheDir() { return GetInstance().dataCache; } [[nodiscard]] static const std::filesystem::path& GetTempDir() { return GetInstance().tempDir; } [[nodiscard]] static const std::filesystem::path& GetUserDir() { return GetInstance().userHome; } [[nodiscard]] static const std::filesystem::path& GetDesktopDir() { return GetInstance().desktop; } [[nodiscard]] static const std::filesystem::path& GetDocumentsDir() { return GetInstance().documents; } [[nodiscard]] static const std::filesystem::path& GetDownloadDir() { return GetInstance().downloads; } [[nodiscard]] static const std::filesystem::path& GetPicturesDir() { return GetInstance().pictures; } [[nodiscard]] static const std::filesystem::path& GetPublicShareDir() { return GetInstance().publicDir; } [[nodiscard]] static const std::filesystem::path& GetMusicDir() { return GetInstance().music; } [[nodiscard]] static const std::filesystem::path& GetVideoDir() { return GetInstance().video; } [[nodiscard]] static const std::filesystem::path& GetSaveGamesDir() { return GetInstance().savedGames; } }; }