9 void OsError::get_message()
56 return io_map(io.get(), eOsProtectRead);
61 const char *data =
static_cast<const char*
>(
map());
62 return std::string_view{data,
size()};
static Io file(const char *path)
const char * name() const
std::string_view text() const
const char * what() const
OsError(os_error_t error)
CT_NODISCARD CT_OS_API size_t os_error_get_string(os_error_t error, STA_WRITES(size) char *buffer, size_t size)
convert an os error code to a string writes to a buffer rather than allocating. if size is 0,...
CT_MEMORY_API arena_t * get_global_arena(void)
get the global memory arena
CT_NODISCARD CT_IO_API io_t * io_file(const char *path, os_access_t mode, arena_t *arena)
create an IO object from a file
CT_NODISCARD CT_IO_API os_error_t io_error(const io_t *io)
get the last error from the io object
CT_NODISCARD CT_IO_API size_t io_size(io_t *io)
get the total size of an io objects contents
CT_NODISCARD CT_IO_API const char * io_name(const io_t *io)
get the name of an io object
CT_NODISCARD CT_IO_API void * io_map(io_t *io, os_protect_t protect)
map an io object into memory maps an io objects entire contents into memory.