13#ifndef CMSIS_PLUS_POSIX_IO_IO_H_
14#define CMSIS_PLUS_POSIX_IO_IO_H_
18#if defined(__cplusplus)
22#if defined(OS_USE_OS_APP_CONFIG_H)
23#include <cmsis-plus/os-app-config.h>
37#pragma GCC diagnostic push
39#pragma clang diagnostic ignored "-Wc++98-compat"
40#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
66 open (
const char* path,
int oflag, ...);
69 vopen (
const char* path,
int oflag, std::va_list args);
81#pragma GCC diagnostic push
83#elif defined(__GNUC__)
84#pragma GCC diagnostic ignored "-Wsuggest-final-methods"
98 vopen (
const char* path,
int oflag, std::va_list args);
100#pragma GCC diagnostic push
101#if defined(__clang__)
102#elif defined(__GNUC__)
103#pragma GCC diagnostic ignored "-Wshadow"
107#pragma GCC diagnostic pop
121#pragma GCC diagnostic push
122#if defined(__clang__)
123#elif defined(__GNUC__)
124#pragma GCC diagnostic ignored "-Wshadow"
139#pragma GCC diagnostic pop
160 io (
const io&) =
delete;
163 operator= (
const io&) =
delete;
165 operator= (
io&&) =
delete;
193 read (
void* buf, std::size_t nbyte);
196 write (
const void* buf, std::size_t nbyte);
202 fcntl (
int cmd, ...);
205 vfcntl (
int cmd, std::va_list args);
210#pragma GCC diagnostic push
211#if defined(__clang__)
212#elif defined(__GNUC__)
213#pragma GCC diagnostic ignored "-Wredundant-tags"
217#pragma GCC diagnostic pop
220 lseek (off_t offset,
int whence);
300#pragma GCC diagnostic pop
304#pragma GCC diagnostic push
305#if defined(__clang__)
306#elif defined(__GNUC__)
307#pragma GCC diagnostic ignored "-Wsuggest-final-methods"
308#pragma GCC diagnostic ignored "-Wsuggest-final-types"
333 operator= (
const io_impl&) =
delete;
335 operator= (
io_impl&&) =
delete;
382#pragma GCC diagnostic push
383#if defined(__clang__)
384#elif defined(__GNUC__)
385#pragma GCC diagnostic ignored "-Wredundant-tags"
389#pragma GCC diagnostic pop
423#pragma GCC diagnostic pop
446 file_descriptor_ = fildes;
458 return file_descriptor_;
491#pragma GCC diagnostic pop
File descriptors manager static class.
virtual bool do_is_connected(void)
virtual bool do_is_opened(void)=0
virtual int do_close(void)=0
virtual ssize_t do_writev(const iovec *iov, int iovcnt)
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
virtual ssize_t writev(const iovec *iov, int iovcnt)
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 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