28#ifndef CMSIS_PLUS_POSIX_IO_FILE_H_
29#define CMSIS_PLUS_POSIX_IO_FILE_H_
33#if defined(__cplusplus)
37#if defined(OS_USE_OS_APP_CONFIG_H)
38#include <cmsis-plus/os-app-config.h>
50#pragma GCC diagnostic push
53#pragma clang diagnostic ignored "-Wc++98-compat"
107 operator= (
const file&) =
delete;
109 operator= (
file&&) =
delete;
131 close (
void)
override;
338 template<
typename T,
typename L>
391 close (
void)
override;
394 read (
void* buf, std::size_t nbyte)
override;
397 write (
const void* buf, std::size_t nbyte)
override;
400 writev (
const struct iovec* iov,
int iovcnt)
override;
403 vfcntl (
int cmd, std::va_list args)
override;
409 lseek (off_t offset,
int whence)
override;
415 fsync (
void)
override;
487#if defined(OS_TRACE_POSIX_IO_FILE)
488 trace::printf (
"file_implementable::%s()=@%p\n", __func__,
this);
495#if defined(OS_TRACE_POSIX_IO_FILE)
496 trace::printf (
"file_implementable::%s() @%p\n", __func__,
this);
509 template<
typename T,
typename L>
518#if defined(OS_TRACE_POSIX_IO_FILE)
523 template<
typename T,
typename L>
526#if defined(OS_TRACE_POSIX_IO_FILE)
533 template<
typename T,
typename L>
537 std::lock_guard<L> lock
543 template<
typename T,
typename L>
547 std::lock_guard<L> lock
553 template<
typename T,
typename L>
557 std::lock_guard<L> lock
563 template<
typename T,
typename L>
567 std::lock_guard<L> lock
573 template<
typename T,
typename L>
577 std::lock_guard<L> lock
583 template<
typename T,
typename L>
587 std::lock_guard<L> lock
593 template<
typename T,
typename L>
597 std::lock_guard<L> lock
603 template<
typename T,
typename L>
607 std::lock_guard<L> lock
613 template<
typename T,
typename L>
617 std::lock_guard<L> lock
623 template<
typename T,
typename L>
634#pragma GCC diagnostic pop
virtual ~file_impl() override
virtual int do_ftruncate(off_t length)=0
class file_system & file_system(void)
virtual int do_fsync(void)=0
virtual ~file_implementable() override
value_type & impl(void) const
file_implementable(class file_system &fs)
virtual ssize_t read(void *buf, std::size_t nbyte) override
virtual ~file_lockable() override
virtual off_t lseek(off_t offset, int whence) override
virtual int fstat(struct stat *buf) override
value_type & impl(void) const
file_lockable(class file_system &fs, lockable_type &locker)
virtual ssize_t write(const void *buf, std::size_t nbyte) override
virtual int vfcntl(int cmd, std::va_list args) override
virtual int close(void) override
virtual int ftruncate(off_t length) override
virtual int fsync(void) override
virtual ssize_t writev(const struct iovec *iov, int iovcnt) override
file_impl & impl(void) const
virtual int fstatvfs(struct statvfs *buf)
virtual int ftruncate(off_t length)
class file_system & file_system(void)
virtual int close(void) override
virtual off_t lseek(off_t offset, int whence)
virtual int fstat(struct stat *buf)
virtual ssize_t write(const void *buf, std::size_t nbyte)
virtual ssize_t read(void *buf, std::size_t nbyte)
virtual ssize_t writev(const struct iovec *iov, int iovcnt)
virtual int vfcntl(int cmd, std::va_list args)
The core of a double linked list, pointers to next, previous.
int printf(const char *format,...)
Write a formatted string to the trace device.
int stat(const char *path, struct stat *buf)