1#ifndef SDL3PP_IOSTREAM_H_
2#define SDL3PP_IOSTREAM_H_
4#include <SDL3/SDL_iostream.h>
5#include "SDL3pp_properties.h"
6#include "SDL3pp_stdinc.h"
50 constexpr explicit operator bool()
const {
return !!
value; }
75 SDL_IO_STATUS_NOT_READY;
78 SDL_IO_STATUS_READONLY;
81 SDL_IO_STATUS_WRITEONLY;
146 : m_resource(resource)
393 std::swap(m_resource, other.m_resource);
404 m_resource =
nullptr;
412 constexpr bool operator==(std::nullptr_t _)
const {
return !m_resource; }
415 constexpr explicit operator bool()
const {
return !!m_resource; }
562 std::string
Read(
size_t size = -1)
565 auto curSize = SDL_GetIOSize(
get());
566 if ((curSize < 0 || pos < 0)) {
567 if (size ==
size_t(-1))
return {};
568 }
else if (curSize - pos <= 0) {
570 }
else if (curSize - pos < size) {
571 size = curSize - pos;
573 std::string result(size, 0);
574 auto actualSize =
Read(result);
575 if (actualSize < size) result.resize(actualSize);
640 size_t print(std::string_view fmt,
auto... args)
642 return Write(std::vformat(fmt, std::make_format_args(args...)));
652 size_t println(std::string_view fmt,
auto... args)
655 std::vformat(fmt, std::make_format_args(args...)) +
"\n";
656 return Write(result);
679 size_t printf(SDL_PRINTF_FORMAT_STRING
const char* fmt, ...)
710 size_t vprintf(SDL_PRINTF_FORMAT_STRING
const char* fmt, va_list ap);
770 auto data =
static_cast<T*
>(SDL_LoadFile_IO(
get(), &datasize,
false));
1092 if (
Uint8 value; SDL_ReadU8(
get(), &value))
return value;
1112 if (
Sint8 value; SDL_ReadS8(
get(), &value))
return value;
1136 if (
Uint16 value; SDL_ReadU16LE(
get(), &value))
return value;
1160 if (
Sint16 value; SDL_ReadS16LE(
get(), &value))
return value;
1184 if (
Uint16 value; SDL_ReadU16BE(
get(), &value))
return value;
1208 if (
Sint16 value; SDL_ReadS16BE(
get(), &value))
return value;
1232 if (
Uint32 value; SDL_ReadU32LE(
get(), &value))
return value;
1256 if (
Sint32 value; SDL_ReadS32LE(
get(), &value))
return value;
1280 if (
Uint32 value; SDL_ReadU32BE(
get(), &value))
return value;
1304 if (
Sint32 value; SDL_ReadS32BE(
get(), &value))
return value;
1328 if (
Uint64 value; SDL_ReadU64LE(
get(), &value))
return value;
1352 if (
Sint64 value; SDL_ReadS64LE(
get(), &value))
return value;
1376 if (
Uint64 value; SDL_ReadU64BE(
get(), &value))
return value;
1400 if (
Sint64 value; SDL_ReadS64BE(
get(), &value))
return value;
1736 return IOStream(SDL_IOFromFile(file, mode));
1744namespace prop::IOStream {
1746constexpr auto WINDOWS_HANDLE_POINTER =
1747 SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER;
1749constexpr auto STDIO_FILE_POINTER = SDL_PROP_IOSTREAM_STDIO_FILE_POINTER;
1751constexpr auto FILE_DESCRIPTOR_NUMBER =
1752 SDL_PROP_IOSTREAM_FILE_DESCRIPTOR_NUMBER;
1754constexpr auto ANDROID_AASSET_POINTER =
1755 SDL_PROP_IOSTREAM_ANDROID_AASSET_POINTER;
1757constexpr auto MEMORY_POINTER = SDL_PROP_IOSTREAM_MEMORY_POINTER;
1759constexpr auto MEMORY_SIZE_NUMBER = SDL_PROP_IOSTREAM_MEMORY_SIZE_NUMBER;
1761constexpr auto DYNAMIC_MEMORY_POINTER =
1762 SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER;
1764constexpr auto DYNAMIC_CHUNKSIZE_NUMBER =
1765 SDL_PROP_IOSTREAM_DYNAMIC_CHUNKSIZE_NUMBER;
1981 return {
CheckError(SDL_GetIOProperties(context))};
2009 return SDL_GetIOStatus(context);
2064 return SDL_SeekIO(context, offset, whence);
2188 SDL_PRINTF_FORMAT_STRING
const char* fmt,
2195 result = SDL_IOvprintf(context, fmt, ap);
2220 SDL_PRINTF_FORMAT_STRING
const char* fmt,
2223 return SDL_IOvprintf(context, fmt, ap);
2277 size_t datasize = 0;
2278 auto data =
static_cast<char*
>(SDL_LoadFile_IO(src, &datasize, closeio));
2302 size_t datasize = 0;
2303 auto data =
static_cast<char*
>(SDL_LoadFile(file, &datasize));
2333 size_t datasize = 0;
2334 auto data =
static_cast<T*
>(SDL_LoadFile(file, &datasize));
The read/write operation structure.
Definition: SDL3pp_iostream.h:131
Sint8 ReadS8()
Use this function to read a signed byte from an IOStream.
std::optional< Sint8 > TryReadS8()
Use this function to read a byte from an IOStreamRef.
Definition: SDL3pp_iostream.h:1110
std::optional< Sint16 > TryReadS16LE()
Use this function to read 16 bits of little-endian data from an IOStreamRef and return in native form...
Definition: SDL3pp_iostream.h:1158
std::optional< Uint64 > TryReadU64BE()
Use this function to read 64 bits of big-endian data from an IOStreamRef and return in native format.
Definition: SDL3pp_iostream.h:1374
std::optional< Uint16 > TryReadU16BE()
Use this function to read 16 bits of big-endian data from an IOStreamRef and return in native format.
Definition: SDL3pp_iostream.h:1182
~IOStream()
Destructor.
Definition: SDL3pp_iostream.h:388
std::optional< Sint32 > TryReadS32LE()
Use this function to read 32 bits of little-endian data from an IOStreamRef and return in native form...
Definition: SDL3pp_iostream.h:1254
std::optional< Uint16 > TryReadU16LE()
Use this function to read 16 bits of little-endian data from an IOStreamRef and return in native form...
Definition: SDL3pp_iostream.h:1134
constexpr IOStreamRaw get() const
Retrieves underlying IOStreamRaw.
Definition: SDL3pp_iostream.h:398
OwnArray< T > LoadFileAs()
Load all the data from an SDL data stream.
Definition: SDL3pp_iostream.h:767
std::optional< Sint16 > TryReadS16BE()
Use this function to read 16 bits of big-endian data from an IOStreamRef and return in native format.
Definition: SDL3pp_iostream.h:1206
size_t printf(SDL_PRINTF_FORMAT_STRING const char *fmt,...)
Print to an IOStream data stream.
Definition: SDL3pp_iostream.h:679
constexpr bool operator==(std::nullptr_t _) const
Comparison.
Definition: SDL3pp_iostream.h:412
constexpr IOStream(const IOStreamRaw resource)
Constructs from IOStreamParam.
Definition: SDL3pp_iostream.h:145
Uint8 ReadU8()
Use this function to read a byte from an IOStream.
std::optional< Uint64 > TryReadU64LE()
Use this function to read 64 bits of little-endian data from an IOStreamRef and return in native form...
Definition: SDL3pp_iostream.h:1326
constexpr IOStream()=default
Default ctor.
IOStream & operator=(IOStream other)
Assignment operator.
Definition: SDL3pp_iostream.h:391
size_t print(std::string_view fmt, auto... args)
Prints formatted string.
Definition: SDL3pp_iostream.h:640
std::optional< Uint32 > TryReadU32LE()
Use this function to read 32 bits of little-endian data from an IOStreamRef and return in native form...
Definition: SDL3pp_iostream.h:1230
std::optional< Uint8 > TryReadU8()
Use this function to read a byte from an IOStreamRef.
Definition: SDL3pp_iostream.h:1090
std::optional< Uint32 > TryReadU32BE()
Use this function to read 32 bits of big-endian data from an IOStreamRef and return in native format.
Definition: SDL3pp_iostream.h:1278
constexpr IOStreamRaw release()
Retrieves underlying IOStreamRaw and clear this.
Definition: SDL3pp_iostream.h:401
std::optional< Sint32 > TryReadS32BE()
Use this function to read 32 bits of big-endian data from an IOStreamRef and return in native format.
Definition: SDL3pp_iostream.h:1302
std::optional< Sint64 > TryReadS64BE()
Use this function to read 64 bits of big-endian data from an IOStreamRef and return in native format.
Definition: SDL3pp_iostream.h:1398
constexpr auto operator<=>(const IOStream &other) const =default
Comparison.
constexpr IOStream(const IOStream &other)=delete
Copy constructor.
size_t println(std::string_view fmt, auto... args)
Prints formatted string.
Definition: SDL3pp_iostream.h:652
constexpr IOStream(IOStream &&other)
Move constructor.
Definition: SDL3pp_iostream.h:154
std::optional< Sint64 > TryReadS64LE()
Use this function to read 64 bits of little-endian data from an IOStreamRef and return in native form...
Definition: SDL3pp_iostream.h:1350
std::string Read(size_t size=-1)
Read from a data source.
Definition: SDL3pp_iostream.h:562
Base class for SDL memory allocated array wrap.
Definition: SDL3pp_ownPtr.h:44
Source byte stream.
Definition: SDL3pp_strings.h:239
constexpr size_t size_bytes() const
Retrieves contained size in bytes.
Definition: SDL3pp_strings.h:303
constexpr const char * data() const
Retrieves contained data.
Definition: SDL3pp_strings.h:306
Helpers to use C++ strings parameters.
Definition: SDL3pp_strings.h:43
Target byte stream.
Definition: SDL3pp_strings.h:325
constexpr char * data() const
Retrieves contained data.
Definition: SDL3pp_strings.h:411
constexpr size_t size_bytes() const
Retrieves contained size in bytes.
Definition: SDL3pp_strings.h:408
constexpr void CheckError(bool result)
Check and throw if returned value from SDL is an error.
Definition: SDL3pp_error.h:198
Sint64 GetSize() const
Use this function to get the size of the data stream in an IOStream.
Definition: SDL3pp_iostream.h:2033
IOStream IOFromMem(TargetBytes mem)
Use this function to prepare a read-write memory buffer for use with IOStream.
Definition: SDL3pp_iostream.h:1807
size_t IOprintf(IOStreamParam context, SDL_PRINTF_FORMAT_STRING const char *fmt,...)
Print to an IOStream data stream.
Definition: SDL3pp_iostream.h:2187
Uint8 ReadU8(IOStreamParam src)
Use this function to read a byte from an IOStream.
Definition: SDL3pp_iostream.h:2399
void WriteU32LE(Uint32 value)
Use this function to write 32 bits in native format to an IOStream as little-endian data.
Definition: SDL3pp_iostream.h:2936
void WriteS32BE(Sint32 value)
Use this function to write 32 bits in native format to an IOStream as big-endian data.
Definition: SDL3pp_iostream.h:3012
void WriteS32LE(Sint32 value)
Use this function to write 32 bits in native format to an IOStream as little-endian data.
Definition: SDL3pp_iostream.h:2962
void WriteS16BE(IOStreamParam dst, Sint16 value)
Use this function to write 16 bits in native format to an IOStream as big-endian data.
Definition: SDL3pp_iostream.h:2905
void WriteU64BE(Uint64 value)
Use this function to write 64 bits in native format to an IOStream as big-endian data.
Definition: SDL3pp_iostream.h:3089
Sint64 ReadS64BE(IOStreamParam src)
Use this function to read 64 bits of big-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2768
IOStream OpenIO(const IOStreamInterface &iface, void *userdata)
Create a custom IOStream.
Definition: SDL3pp_iostream.h:1924
IOStatus GetIOStatus(IOStreamParam context)
Query the stream status of an IOStream.
Definition: SDL3pp_iostream.h:2007
Uint16 ReadU16BE()
Use this function to read 16 bits of big-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2514
SDL_IOStream * IOStreamRaw
Alias to raw representation for IOStream.
Definition: SDL3pp_iostream.h:27
void SaveFile(SourceBytes data)
Save all the data into an SDL data stream.
Definition: SDL3pp_iostream.h:2378
Sint16 ReadS16BE(IOStreamParam src)
Use this function to read 16 bits of big-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2536
void WriteS32LE(IOStreamParam dst, Sint32 value)
Use this function to write 32 bits in native format to an IOStream as little-endian data.
Definition: SDL3pp_iostream.h:2957
void WriteU32BE(Uint32 value)
Use this function to write 32 bits in native format to an IOStream as big-endian data.
Definition: SDL3pp_iostream.h:2987
Sint32 ReadS32BE()
Use this function to read 32 bits of big-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2659
void WriteS16LE(Sint16 value)
Use this function to write 16 bits in native format to an IOStream as little-endian data.
Definition: SDL3pp_iostream.h:2860
void WriteS8(Sint8 value)
Use this function to write a signed byte to an IOStream.
Definition: SDL3pp_iostream.h:2811
Uint32 ReadU32LE(IOStreamParam src)
Use this function to read 32 bits of little-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2565
size_t ReadIO(IOStreamParam context, TargetBytes buf)
Read from a data source.
Definition: SDL3pp_iostream.h:2117
void Flush()
Flush any buffered data in the stream.
Definition: SDL3pp_iostream.h:2251
void WriteU32LE(IOStreamParam dst, Uint32 value)
Use this function to write 32 bits in native format to an IOStream as little-endian data.
Definition: SDL3pp_iostream.h:2931
IOStream IOFromConstMem(SourceBytes mem)
Use this function to prepare a read-only memory buffer for use with IOStream.
Definition: SDL3pp_iostream.h:1855
SDL_IOWhence IOWhence
Possible whence values for IOStream seeking.
Definition: SDL3pp_iostream.h:91
Sint8 ReadS8(IOStreamParam src)
Use this function to read a signed byte from an IOStream.
Definition: SDL3pp_iostream.h:2422
size_t vprintf(SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap)
Print to an IOStream data stream.
Definition: SDL3pp_iostream.h:2226
Uint16 ReadU16LE()
Use this function to read 16 bits of little-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2456
Sint16 ReadS16LE(IOStreamParam src)
Use this function to read 16 bits of little-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2478
Uint32 ReadU32LE()
Use this function to read 32 bits of little-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2572
IOStream IOFromDynamicMem()
Use this function to create an IOStream that is backed by dynamically allocated memory.
Definition: SDL3pp_iostream.h:1893
void Close()
Close and free an allocated IOStream structure.
Definition: SDL3pp_iostream.h:1966
OwnArray< T > LoadFileAs(StringParam file)
Load all the data from a file path.
Definition: SDL3pp_iostream.h:2331
void WriteS64BE(Sint64 value)
Use this function to write 64 bits in native format to an IOStream as big-endian data.
Definition: SDL3pp_iostream.h:3114
size_t IOvprintf(IOStreamParam context, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap)
Print to an IOStream data stream.
Definition: SDL3pp_iostream.h:2219
Sint64 TellIO(IOStreamParam context)
Determine the current read/write offset in an IOStream data stream.
Definition: SDL3pp_iostream.h:2090
Uint64 ReadU64LE(IOStreamParam src)
Use this function to read 64 bits of little-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2681
constexpr IOStatus IO_STATUS_ERROR
Read or write I/O error.
Definition: SDL3pp_iostream.h:69
void WriteS16BE(Sint16 value)
Use this function to write 16 bits in native format to an IOStream as big-endian data.
Definition: SDL3pp_iostream.h:2910
static IOStream Open(const IOStreamInterface &iface, void *userdata)
Create a custom IOStream.
Definition: SDL3pp_iostream.h:1929
Sint32 ReadS32LE(IOStreamParam src)
Use this function to read 32 bits of little-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2594
Uint32 ReadU32BE(IOStreamParam src)
Use this function to read 32 bits of big-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2623
Uint32 ReadU32BE()
Use this function to read 32 bits of big-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2630
IOStream IOFromFile(StringParam file, StringParam mode)
Use this function to create a new IOStream structure for reading from and/or writing to a named file.
Definition: SDL3pp_iostream.h:1734
constexpr IOStatus IO_STATUS_EOF
End of file.
Definition: SDL3pp_iostream.h:72
Sint64 ReadS64LE(IOStreamParam src)
Use this function to read 64 bits of little-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2710
Uint16 ReadU16BE(IOStreamParam src)
Use this function to read 16 bits of big-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2507
void WriteU8(IOStreamParam dst, Uint8 value)
Use this function to write a byte to an IOStream.
Definition: SDL3pp_iostream.h:2788
Sint64 GetIOSize(IOStreamParam context)
Use this function to get the size of the data stream in an IOStream.
Definition: SDL3pp_iostream.h:2028
void WriteU32BE(IOStreamParam dst, Uint32 value)
Use this function to write 32 bits in native format to an IOStream as big-endian data.
Definition: SDL3pp_iostream.h:2982
Sint64 Seek(Sint64 offset, IOWhence whence)
Seek within an IOStream data stream.
Definition: SDL3pp_iostream.h:2067
void WriteS32BE(IOStreamParam dst, Sint32 value)
Use this function to write 32 bits in native format to an IOStream as big-endian data.
Definition: SDL3pp_iostream.h:3007
Sint64 SeekIO(IOStreamParam context, Sint64 offset, IOWhence whence)
Seek within an IOStream data stream.
Definition: SDL3pp_iostream.h:2062
size_t Write(SourceBytes buf)
Write to an IOStream data stream.
Definition: SDL3pp_iostream.h:2161
void WriteU16LE(IOStreamParam dst, Uint16 value)
Use this function to write 16 bits in native format to an IOStream as little-endian data.
Definition: SDL3pp_iostream.h:2829
Sint64 Tell() const
Determine the current read/write offset in an IOStream data stream.
Definition: SDL3pp_iostream.h:2092
void WriteU16BE(Uint16 value)
Use this function to write 16 bits in native format to an IOStream as big-endian data.
Definition: SDL3pp_iostream.h:2885
Sint32 ReadS32LE()
Use this function to read 32 bits of little-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2601
Sint16 ReadS16BE()
Use this function to read 16 bits of big-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2543
constexpr IOStatus IO_STATUS_WRITEONLY
Tried to read a write-only buffer.
Definition: SDL3pp_iostream.h:80
PropertiesRef GetIOProperties(IOStreamParam context)
Get the properties associated with an IOStream.
Definition: SDL3pp_iostream.h:1979
Sint64 ReadS64BE()
Use this function to read 64 bits of big-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2775
static IOStream FromDynamicMem()
Use this function to create an IOStream that is backed by dynamically allocated memory.
Definition: SDL3pp_iostream.h:1895
static IOStream FromConstMem(SourceBytes mem)
Use this function to prepare a read-only memory buffer for use with IOStream.
Definition: SDL3pp_iostream.h:1860
StringResult LoadFile()
Load all the data from an SDL data stream.
Definition: SDL3pp_iostream.h:2307
void WriteU16LE(Uint16 value)
Use this function to write 16 bits in native format to an IOStream as little-endian data.
Definition: SDL3pp_iostream.h:2834
Uint64 ReadU64LE()
Use this function to read 64 bits of little-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2688
constexpr IOWhence IO_SEEK_CUR
Seek relative to current read point.
Definition: SDL3pp_iostream.h:96
SDL_IOStreamInterface IOStreamInterface
The function pointers that drive an IOStream.
Definition: SDL3pp_iostream.h:116
void WriteU8(Uint8 value)
Use this function to write a byte to an IOStream.
Definition: SDL3pp_iostream.h:2793
Uint64 ReadU64BE()
Use this function to read 64 bits of big-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2746
SDL_IOStatus IOStatus
IOStream status, set by a read or write operation.
Definition: SDL3pp_iostream.h:64
void WriteS8(IOStreamParam dst, Sint8 value)
Use this function to write a signed byte to an IOStream.
Definition: SDL3pp_iostream.h:2806
void WriteS16LE(IOStreamParam dst, Sint16 value)
Use this function to write 16 bits in native format to an IOStream as little-endian data.
Definition: SDL3pp_iostream.h:2855
Sint64 ReadS64LE()
Use this function to read 64 bits of little-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2717
void FlushIO(IOStreamParam context)
Flush any buffered data in the stream.
Definition: SDL3pp_iostream.h:2249
Uint64 ReadU64BE(IOStreamParam src)
Use this function to read 64 bits of big-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2739
Sint32 ReadS32BE(IOStreamParam src)
Use this function to read 32 bits of big-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2652
void SaveFile(IOStreamParam src, SourceBytes data, bool closeio=false)
Save all the data into an SDL data stream.
Definition: SDL3pp_iostream.h:2354
constexpr IOStatus IO_STATUS_READONLY
Tried to write a read-only buffer.
Definition: SDL3pp_iostream.h:77
void WriteU64LE(Uint64 value)
Use this function to write 64 bits in native format to an IOStream as little-endian data.
Definition: SDL3pp_iostream.h:3038
StringResult LoadFile(IOStreamParam src, bool closeio=true)
Load all the data from an SDL data stream.
Definition: SDL3pp_iostream.h:2275
constexpr IOStatus IO_STATUS_READY
Everything is ready (no errors and not EOF).
Definition: SDL3pp_iostream.h:66
constexpr IOStatus IO_STATUS_NOT_READY
Non blocking I/O, not ready.
Definition: SDL3pp_iostream.h:74
static IOStream FromFile(StringParam file, StringParam mode)
Use this function to create a new IOStream structure for reading from and/or writing to a named file.
Definition: SDL3pp_iostream.h:1739
void CloseIO(IOStreamRaw context)
Close and free an allocated IOStream structure.
Definition: SDL3pp_iostream.h:1964
void WriteS64LE(Sint64 value)
Use this function to write 64 bits in native format to an IOStream as little-endian data.
Definition: SDL3pp_iostream.h:3064
Sint16 ReadS16LE()
Use this function to read 16 bits of little-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2485
IOStatus GetStatus() const
Query the stream status of an IOStream.
Definition: SDL3pp_iostream.h:2012
void WriteU64BE(IOStreamParam dst, Uint64 value)
Use this function to write 64 bits in native format to an IOStream as big-endian data.
Definition: SDL3pp_iostream.h:3084
size_t WriteIO(IOStreamParam context, SourceBytes buf)
Write to an IOStream data stream.
Definition: SDL3pp_iostream.h:2156
static IOStream FromMem(TargetBytes mem)
Use this function to prepare a read-write memory buffer for use with IOStream.
Definition: SDL3pp_iostream.h:1812
Uint16 ReadU16LE(IOStreamParam src)
Use this function to read 16 bits of little-endian data from an IOStream and return in native format.
Definition: SDL3pp_iostream.h:2449
void WriteU64LE(IOStreamParam dst, Uint64 value)
Use this function to write 64 bits in native format to an IOStream as little-endian data.
Definition: SDL3pp_iostream.h:3033
void WriteS64LE(IOStreamParam dst, Sint64 value)
Use this function to write 64 bits in native format to an IOStream as little-endian data.
Definition: SDL3pp_iostream.h:3059
void WriteS64BE(IOStreamParam dst, Sint64 value)
Use this function to write 64 bits in native format to an IOStream as big-endian data.
Definition: SDL3pp_iostream.h:3109
constexpr IOWhence IO_SEEK_SET
Seek from the beginning of data.
Definition: SDL3pp_iostream.h:93
constexpr IOWhence IO_SEEK_END
Seek relative to the end of data.
Definition: SDL3pp_iostream.h:99
PropertiesRef GetProperties() const
Get the properties associated with an IOStream.
Definition: SDL3pp_iostream.h:1984
void WriteU16BE(IOStreamParam dst, Uint16 value)
Use this function to write 16 bits in native format to an IOStream as big-endian data.
Definition: SDL3pp_iostream.h:2880
Uint16 Uint16
An unsigned 16-bit integer type.
Definition: SDL3pp_stdinc.h:294
Sint8 Sint8
A signed 8-bit integer type.
Definition: SDL3pp_stdinc.h:243
Sint64 Sint64
A signed 64-bit integer type.
Definition: SDL3pp_stdinc.h:347
Sint32 Sint32
A signed 32-bit integer type.
Definition: SDL3pp_stdinc.h:311
Uint32 Uint32
An unsigned 32-bit integer type.
Definition: SDL3pp_stdinc.h:328
Uint64 Uint64
An unsigned 64-bit integer type.
Definition: SDL3pp_stdinc.h:366
Uint8 Uint8
An unsigned 8-bit integer type.
Definition: SDL3pp_stdinc.h:260
Sint16 Sint16
A signed 16-bit integer type.
Definition: SDL3pp_stdinc.h:277
Main include header for the SDL3pp library.
Safely wrap IOStream for non owning parameters.
Definition: SDL3pp_iostream.h:34
constexpr auto operator<=>(const IOStreamParam &other) const =default
Comparison.
constexpr IOStreamParam(IOStreamRaw value)
Constructs from IOStreamRaw.
Definition: SDL3pp_iostream.h:38
IOStreamRaw value
parameter's IOStreamRaw
Definition: SDL3pp_iostream.h:35
constexpr IOStreamParam(std::nullptr_t _=nullptr)
Constructs null/invalid.
Definition: SDL3pp_iostream.h:44
Semi-safe reference for IOStream.
Definition: SDL3pp_iostream.h:1629
IOStreamRef(IOStreamParam resource)
Constructs from IOStreamParam.
Definition: SDL3pp_iostream.h:1637
IOStreamRef(const IOStreamRef &other)
Copy constructor.
Definition: SDL3pp_iostream.h:1643
~IOStreamRef()
Destructor.
Definition: SDL3pp_iostream.h:1649
Semi-safe reference for Properties.
Definition: SDL3pp_properties.h:701
A simple std::string-like interface for SDL allocated strings.
Definition: SDL3pp_strings.h:153