Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
cover_art_cache.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <string>
9#include <string_view>
10#include <vector>
11
12namespace startup {
13
18 std::vector<unsigned char> bytes;
19 bool fileFound = false;
20 std::string errorMessage;
21 };
22
27 bool success = false;
28 std::string errorMessage;
29 };
30
36 std::string default_cover_art_cache_root();
37
46 std::string build_cover_art_cache_key(std::string_view hostUuid, std::string_view hostAddress, int appId);
47
55 bool cover_art_exists(std::string_view cacheKey, const std::string &cacheRoot = default_cover_art_cache_root());
56
66 std::string_view cacheKey,
67 std::string *errorMessage = nullptr,
68 const std::string &cacheRoot = default_cover_art_cache_root()
69 );
70
78 LoadCoverArtResult load_cover_art(std::string_view cacheKey, const std::string &cacheRoot = default_cover_art_cache_root());
79
88 SaveCoverArtResult save_cover_art(std::string_view cacheKey, const std::vector<unsigned char> &bytes, const std::string &cacheRoot = default_cover_art_cache_root());
89
90} // namespace startup
SaveCoverArtResult save_cover_art(std::string_view cacheKey, const std::vector< unsigned char > &bytes, const std::string &cacheRoot)
Save cover art bytes for a given cache key.
Definition cover_art_cache.cpp:122
std::string build_cover_art_cache_key(std::string_view hostUuid, std::string_view hostAddress, int appId)
Build a stable cache key for one host app's cover art.
Definition cover_art_cache.cpp:75
bool delete_cover_art(std::string_view cacheKey, std::string *errorMessage, const std::string &cacheRoot)
Delete cached cover art for a given key.
Definition cover_art_cache.cpp:90
std::string default_cover_art_cache_root()
Return the default root directory for cached cover art.
Definition cover_art_cache.cpp:71
bool cover_art_exists(std::string_view cacheKey, const std::string &cacheRoot)
Return whether cached cover art exists for a given key.
Definition cover_art_cache.cpp:80
LoadCoverArtResult load_cover_art(std::string_view cacheKey, const std::string &cacheRoot)
Load cached cover art bytes for a given key.
Definition cover_art_cache.cpp:103
Result of loading cached cover art bytes from disk.
Definition cover_art_cache.h:17
std::vector< unsigned char > bytes
Loaded cover art bytes.
Definition cover_art_cache.h:18
std::string errorMessage
Error detail when loading failed.
Definition cover_art_cache.h:20
bool fileFound
True when a cached file existed on disk.
Definition cover_art_cache.h:19
Result of saving cached cover art bytes to disk.
Definition cover_art_cache.h:26
bool success
True when the cover art was saved successfully.
Definition cover_art_cache.h:27
std::string errorMessage
Error detail when saving failed.
Definition cover_art_cache.h:28