Files
spice2x.github.io/src/spice2x/util/fileutils.h
T
bicarus 311404f56b overlay: toast notifications (#704)
## Link to GitHub Issue or related Pull Request, if one exists
n/a

## Description of change
Adds toast notifications to the overlay.

Toast notifications are transient windows (shown for about 4 seconds).
These are drawn on top of the game even when the overlay is inactive
(i.e., when no window is open), and does not cause any input sink
behavior.

Add toasts for some common user-driven actions that could use a
notification, such as:

* screenshot
* card insert
* PIN macro
* API client connect/disconnect
* virtual printer
* screen resize toggle / scene switch

Add an option to change where the toasts are displayed, or to turn it
off entirely.

Add SDK function for it, and add it to the samples.

## Testing
Tested DDR (shown at bottom right, as is for most games) and RB (shown
top right by default).
2026-05-27 00:45:27 -07:00

41 lines
1.5 KiB
C++

#pragma once
#include <filesystem>
#include <string>
#include <vector>
#include <windows.h>
namespace fileutils {
// file existence
bool file_exists(LPCSTR szPath);
bool file_exists(LPCWSTR szPath);
bool file_exists(const std::string &file_path);
bool file_exists(const std::filesystem::path &file_path);
// file headers
bool verify_header_pe(const std::filesystem::path &file_path);
// versions
bool version_pe(const std::filesystem::path &file_path, char *ver);
// directories
bool dir_exists(const std::filesystem::path &dir_path);
bool dir_create(const std::filesystem::path &dir_path);
bool dir_create_log(const std::string_view &module, const std::filesystem::path &dir_path);
bool dir_create_recursive(const std::filesystem::path &dir_path);
bool dir_create_recursive_log(const std::string_view &module, const std::filesystem::path &dir_path);
// IO
bool text_write(const std::filesystem::path &file_path, std::string text);
std::string text_read(const std::filesystem::path &file_path);
bool bin_write(const std::filesystem::path &path, uint8_t *data, size_t len);
std::vector<uint8_t> *bin_read(const std::filesystem::path &path);
std::filesystem::path get_config_file_path(const std::string module, const std::string filename, bool* file_exists=nullptr);
bool write_config_file(const std::string_view &module, const std::filesystem::path path, std::string text);
std::string basename(std::string_view path);
}