Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
project_configuration.h
1#pragma once
2
3#include "sound_bakery/core/core_include.h"
4
5namespace sbk::editor
6{
11 {
12 project_configuration() = default;
13
17 project_configuration(const std::filesystem::path& projectFile);
18
22 project_configuration(const std::filesystem::directory_entry& projectDirectory, const std::string& projectName);
23
24 static constexpr std::string_view projectExtension = "bakery";
25 static constexpr std::string_view projectExtensionWithDot = ".bakery";
26 static constexpr std::string_view outputBankExtension = "bnk";
27 static constexpr std::string_view outputBankExtensionWithDot = ".bnk";
28
29 [[nodiscard]] std::filesystem::path source_folder() const { return m_projectFolder / "Source"; }
30 [[nodiscard]] std::filesystem::path object_folder() const { return m_projectFolder / "Objects"; }
31 [[nodiscard]] std::filesystem::path build_folder() const { return m_projectFolder / "Build"; }
32 [[nodiscard]] std::filesystem::path saved_folder() const { return m_projectFolder / "Saved"; }
33 [[nodiscard]] std::filesystem::path encoded_folder() const { return build_folder() / "Encoded"; }
34 [[nodiscard]] std::filesystem::path log_folder() const { return saved_folder() / "Logs"; }
35
36 [[nodiscard]] std::filesystem::path project_file() const { return m_projectFile; }
37 [[nodiscard]] std::filesystem::path project_folder() const { return m_projectFolder; }
38 [[nodiscard]] std::string_view project_name() const { return m_projectName; }
39
40 [[nodiscard]] std::filesystem::path type_folder(const rttr::type& type) const; //< Converts an object type to a
41 // folder location
42
43 [[nodiscard]] static std::string get_filename_for_id(
44 sbk::core::database_object* databaseObject, std::optional<std::string> extensionOverride = std::nullopt);
45
46 [[nodiscard]] bool is_valid() const; //< Returns true if the project file exists
47
48 private:
49 std::filesystem::path m_projectFile;
50 std::string m_projectName;
51 std::filesystem::path m_projectFolder;
52 };
53} // namespace sbk::editor
Base object type for any object that can exist in the editor/database. Holds an ID and name.
Definition database_object.h:12
Handles file and folder paths for a project.
Definition project_configuration.h:11