Files
CraftyBoss 18cdf141cb Implement CARD API based on kabufuda (#53)
Original repository: https://github.com/AxioDL/kabufuda
Cleaned up & converted to `aurora::card`, with SDL3 file I/O.

---------

Co-authored-by: Phillip Stephens <antidote.crk@gmail.com>
Co-authored-by: Jack Andersen <jackoalan@gmail.com>
Co-authored-by: Lioncash <mathew1800@gmail.com>
Co-authored-by: Luke Street <luke@street.dev>
2026-03-10 19:49:34 -06:00

32 lines
682 B
C++

#pragma once
#include <cstddef>
#include <string>
#include <SDL3/SDL_iostream.h>
namespace aurora::card {
class FileIO {
std::string m_path;
SDL_IOStream* m_stream = nullptr;
bool isReady() const;
public:
FileIO() = default;
explicit FileIO(std::string_view filename, bool truncate = false);
~FileIO();
FileIO(FileIO&& other) noexcept;
FileIO& operator=(FileIO&& other) noexcept;
FileIO(const FileIO& other) = delete;
FileIO& operator=(const FileIO& other) = delete;
bool fileRead(void* buf, size_t length, off_t offset);
bool fileWrite(const void* buf, size_t length, off_t offset);
explicit operator bool() const;
};
} // namespace aurora::card