28#ifndef CMSIS_PLUS_POSIX_IO_IO_H_
29#define CMSIS_PLUS_POSIX_IO_IO_H_
33#if defined(__cplusplus)
37#if defined(OS_USE_OS_APP_CONFIG_H)
38#include <cmsis-plus/os-app-config.h>
52#pragma GCC diagnostic push
55#pragma clang diagnostic ignored "-Wc++98-compat"
56#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
82 open (
const char* path,
int oflag, ...);
85 vopen (
const char* path,
int oflag, std::va_list args);
109 vopen (
const char* path,
int oflag, std::va_list args);
111#pragma GCC diagnostic push
112#pragma GCC diagnostic ignored "-Wshadow"
115#pragma GCC diagnostic pop
129#pragma GCC diagnostic push
130#pragma GCC diagnostic ignored "-Wshadow"
144#pragma GCC diagnostic pop
165 io (
const io&) =
delete;
168 operator= (
const io&) =
delete;
170 operator= (
io&&) =
delete;
198 read (
void* buf, std::size_t nbyte);
201 write (
const void* buf, std::size_t nbyte);
207 fcntl (
int cmd, ...);
210 vfcntl (
int cmd, std::va_list args);
219 lseek (off_t offset,
int whence);
325 operator= (
const io_impl&) =
delete;
327 operator= (
io_impl&&) =
delete;
431 file_descriptor_ = fildes;
443 return file_descriptor_;
476#pragma GCC diagnostic pop
File descriptors manager static class.
virtual bool do_is_connected(void)
virtual bool do_is_opened(void)=0
virtual ssize_t do_writev(const struct iovec *iov, int iovcnt)
virtual int do_close(void)=0
virtual int do_vfcntl(int cmd, std::va_list args)
virtual int do_isatty(void)
virtual ssize_t do_write(const void *buf, std::size_t nbyte)=0
virtual void do_deallocate(void)
virtual ssize_t do_read(void *buf, std::size_t nbyte)=0
virtual int do_fstat(struct stat *buf)
virtual off_t do_lseek(off_t offset, int whence)=0
file_descriptor_t file_descriptor(void) const
virtual off_t lseek(off_t offset, int whence)
io * alloc_file_descriptor(void)
io_impl & impl(void) const
virtual int fstat(struct stat *buf)
virtual ssize_t write(const void *buf, std::size_t nbyte)
void clear_file_descriptor(void)
virtual ssize_t read(void *buf, std::size_t nbyte)
type_t get_type(void) const
virtual ssize_t writev(const struct iovec *iov, int iovcnt)
virtual int vfcntl(int cmd, std::va_list args)
int socket(int domain, int type, int protocol)
io * open(const char *path, int oflag,...)
io * vopen(const char *path, int oflag, std::va_list args)
int stat(const char *path, struct stat *buf)
constexpr file_descriptor_t no_file_descriptor