SDL provides an abstract interface for reading and writing data streams.
More...
It offers implementations for files, memory, etc, and the app can provide their own implementations, too.
IOStream is not related to the standard C++ iostream class, other than both are abstract interfaces to read/write data.
◆ IOStatus
- Since
- This enum is available since SDL 3.2.0.
◆ IOStreamInterface
◆ IOStreamShared
◆ IOStreamWeak
◆ IOWhence
These map to the same "whence" concept that fseek
or lseek
use in the standard C runtime.
- Since
- This enum is available since SDL 3.2.0.
◆ LoadFile()
The data is allocated with a zero byte at the end (null terminated) for convenience. This extra byte is not included in the value reported via datasize
.
- Parameters
-
file | the path to read all available data from. |
- Returns
- the data.
- Exceptions
-
- Thread safety:
- This function is not thread safe.
- Since
- This function is available since SDL 3.2.0.
- See also
- IOStreamRef.LoadFile
-
SaveFile
◆ LoadFileAs()
The data is allocated with a zero byte at the end (null terminated) for convenience. This extra byte is not included in the value reported via datasize
.
- Parameters
-
file | the path to read all available data from. |
- Returns
- the data.
- Exceptions
-
- Thread safety:
- This function is not thread safe.
- Since
- This function is available since SDL 3.2.0.
- See also
- IOStreamRef.LoadFile
-
SaveFile
◆ SaveFile()
- Parameters
-
file | the path to write all available data into. |
data | the data to be written. If datasize is 0, may be nullptr or a invalid pointer. |
- Exceptions
-
- Thread safety:
- This function is not thread safe.
- Since
- This function is available since SDL 3.2.0.
- See also
- IOStreamRef.SaveFile
-
LoadFile
◆ IO_SEEK_CUR
◆ IO_SEEK_END
◆ IO_SEEK_SET
◆ IO_STATUS_ERROR
◆ IO_STATUS_NOT_READY
constexpr IOStatus SDL::IO_STATUS_NOT_READY |
|
constexpr |
Initial value:=
SDL_IO_STATUS_NOT_READY
◆ IO_STATUS_READONLY
constexpr IOStatus SDL::IO_STATUS_READONLY |
|
constexpr |
◆ IO_STATUS_READY
◆ IO_STATUS_WRITEONLY
constexpr IOStatus SDL::IO_STATUS_WRITEONLY |
|
constexpr |
Initial value:=
SDL_IO_STATUS_WRITEONLY