Tabula Sonora 0.1.0
A native C++20 implementation of the Roland Sound Canvas VA synth voice
Loading...
Searching...
No Matches
rom_locator.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <filesystem>
4#include <string>
5#include <vector>
6
7namespace ts {
8
12inline constexpr const char* rom_path_variable = "TS_SCCORE_DLL";
13
17 std::filesystem::path path;
18
20 std::vector<std::string> searched;
21
22 [[nodiscard]] bool found() const noexcept { return !path.empty(); }
23};
24
34[[nodiscard]] RomLocation locate_rom(const std::string& explicit_path);
35
37[[nodiscard]] std::string rom_not_found_message(const RomLocation& location);
38
39} // namespace ts
Definition control_decode.hpp:7
constexpr const char * rom_path_variable
The environment variable that pins the ROM path.
Definition rom_locator.hpp:12
std::string rom_not_found_message(const RomLocation &location)
The message to print when nothing was found.
RomLocation locate_rom(const std::string &explicit_path)
Finds the ROM, preferring what the caller asked for over what the environment pins.
Where a front end looked for the ROM, and what it found.
Definition rom_locator.hpp:15
std::vector< std::string > searched
Human-readable account of where it came from, for the error message when it is empty.
Definition rom_locator.hpp:20
std::filesystem::path path
The resolved path, empty if nothing was found.
Definition rom_locator.hpp:17
bool found() const noexcept
Definition rom_locator.hpp:22