The notes of a Controller Pak, stored in a directory, with the settings note in another.
Definition controllerpak.h:41
std::size_t FreeBytes() const
bool WriteNote(const std::string &name, std::span< const std::uint8_t > bytes) const
Atomically write a complete note with its integrity header and checksum.
std::optional< std::vector< std::uint8_t > > ReadNote(const std::string &name, const SavePayloadValidator &validate={}) const
Validate the note's integrity header and checksum, attempting to delete corrupt saves.
ControllerPak(std::filesystem::path directory, std::filesystem::path settingsDirectory={})
Select note directories without creating or reading them.
std::vector< PakNote > Notes() const
bool DeleteNote(const std::string &name) const
ControllerPak Subdirectory(const std::filesystem::path &directory) const
Store independent notes beneath the Controller Pak directory without using its capacity.
Definition assetimport.h:11
std::optional< std::string > ExportPakImage(const ControllerPak &pak, const std::filesystem::path &file, PakRelease release=PakRelease::Usa)
Write the notes of a pak as the image of a formatted Controller Pak, with the game code and the compa...
constexpr std::size_t PAK_PAGE_BYTES
The bytes of a page of a Controller Pak, the unit a note takes its room in.
Definition controllerpak.h:23
PakRelease
The release of the cartridge whose game code and company code the notes of an image take.
Definition controllerpak.h:104
@ Jpn
Definition controllerpak.h:107
@ Usa
Definition controllerpak.h:105
@ Eur
Definition controllerpak.h:106
std::optional< std::string > ImportPakImage(const ControllerPak &pak, const std::filesystem::path &file)
Copy the notes of any release of the game from the image of a Controller Pak, or from the first pak o...
constexpr std::size_t PAK_IMAGE_BYTES
The bytes of the image of a Controller Pak, as emulators and the tools of a pak store one.
Definition controllerpak.h:101
constexpr std::string_view PAK_SETTINGS_NOTE
The note of the settings of the options menu, stored with the settings of the game.
Definition controllerpak.h:38
std::function< bool(std::span< const std::uint8_t >)> SavePayloadValidator
Validate format-specific fields of an internal save's payload under its exclusive process lock.
Definition savefile.h:19
constexpr std::size_t PAK_PAGES
The pages of a Controller Pak free for notes.
Definition controllerpak.h:26
constexpr std::size_t PAK_NOTES
The notes a Controller Pak has room for.
Definition controllerpak.h:29
A note of a Controller Pak.
Definition controllerpak.h:32
std::string name
Definition controllerpak.h:33
std::size_t bytes
Definition controllerpak.h:34