TachyonUI 1.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
gui_resources.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <cstddef>
6#include <cstdint>
7#include <span>
8#include <string>
9#include <string_view>
10
11namespace tachyon
12{
15
19 enum class PathCaseCheck : uint8_t
20 {
24 };
25
29
37 std::string FindPathCaseMismatch(std::string_view path);
38
42 bool CheckPathCase(std::string_view path);
43
49 std::span<const std::byte> FindBuiltInResource(std::string_view path);
50
55 Result<std::string> ReadResource(std::string_view path);
56
58}
A value, or the Error saying why there is none.
Definition gui_result.h:36
Result< std::string > ReadResource(std::string_view path)
A resource's contents: the file at path when it exists, else its built-in copy (which is logged,...
std::span< const std::byte > FindBuiltInResource(std::string_view path)
The copy of a resource compiled into the library: the default themes (dark.css, light....
bool CheckPathCase(std::string_view path)
Applies the PathCaseCheck mode to a resource file about to be opened: false only in Fail mode when pa...
PathCaseCheck GetPathCaseCheck()
void SetPathCaseCheck(PathCaseCheck mode)
Sets how resource paths are checked; see PathCaseCheck. Thread safe.
std::string FindPathCaseMismatch(std::string_view path)
The spelling on disk of the file or folder at path when it exists under a name that differs from path...
PathCaseCheck
What the library does when a resource file it opens is named in a case other than the one it has on d...
Definition gui_resources.h:20
@ Warn
Log an error naming both spellings, and open the file. The default in debug builds.
Definition gui_resources.h:22
@ Fail
Log the error and refuse the file, as Linux would. The test suites use this.
Definition gui_resources.h:23
@ Off
Don't compare; opening a file costs nothing extra. The default in release builds.
Definition gui_resources.h:21
Definition gui_logging.h:24