13#ifndef CMSIS_PLUS_POSIX_IO_FILE_H_
14#define CMSIS_PLUS_POSIX_IO_FILE_H_
18#if defined(__cplusplus)
22#if defined(OS_USE_OS_APP_CONFIG_H)
23#include <cmsis-plus/os-app-config.h>
35#pragma GCC diagnostic push
37#pragma clang diagnostic ignored "-Wc++98-compat"
58#pragma GCC diagnostic push
60#elif defined(__GNUC__)
61#pragma GCC diagnostic ignored "-Wsuggest-final-methods"
62#pragma GCC diagnostic ignored "-Wsuggest-final-types"
97 operator= (
const file&) =
delete;
99 operator= (
file&&) =
delete;
121 close (
void)
override;
135#pragma GCC diagnostic push
136#if defined(__clang__)
137#elif defined(__GNUC__)
138#pragma GCC diagnostic ignored "-Wredundant-tags"
144#pragma GCC diagnostic pop
168#pragma GCC diagnostic pop
238#pragma GCC diagnostic push
239#if defined(__clang__)
240#elif defined(__GNUC__)
241#pragma GCC diagnostic ignored "-Wredundant-tags"
247#pragma GCC diagnostic pop
269#pragma GCC diagnostic push
270#if defined(__clang__)
271#elif defined(__GNUC__)
272#pragma GCC diagnostic ignored "-Wsuggest-final-methods"
273#pragma GCC diagnostic ignored "-Wsuggest-final-types"
348#pragma GCC diagnostic pop
352#pragma GCC diagnostic push
353#if defined(__clang__)
354#elif defined(__GNUC__)
355#pragma GCC diagnostic ignored "-Wsuggest-final-methods"
356#pragma GCC diagnostic ignored "-Wsuggest-final-types"
357#pragma GCC diagnostic ignored "-Wpadded"
359 template<
typename T,
typename L>
412 close (
void)
override;
415 read (
void* buf, std::size_t nbyte)
override;
418 write (
const void* buf, std::size_t nbyte)
override;
424 vfcntl (
int cmd, std::va_list args)
override;
426#pragma GCC diagnostic push
427#if defined(__clang__)
428#elif defined(__GNUC__)
429#pragma GCC diagnostic ignored "-Wredundant-tags"
433#pragma GCC diagnostic pop
436 lseek (off_t offset,
int whence)
override;
442 fsync (
void)
override;
472#pragma GCC diagnostic pop
515#if defined(OS_TRACE_POSIX_IO_FILE)
516 trace::printf (
"file_implementable::%s()=@%p\n", __func__,
this);
520#pragma GCC diagnostic push
521#if defined(__clang__)
522#elif defined(__GNUC__)
523#pragma GCC diagnostic ignored "-Wsuggest-final-methods"
528#if defined(OS_TRACE_POSIX_IO_FILE)
529 trace::printf (
"file_implementable::%s() @%p\n", __func__,
this);
532#pragma GCC diagnostic pop
543 template<
typename T,
typename L>
552#if defined(OS_TRACE_POSIX_IO_FILE)
557#pragma GCC diagnostic push
558#if defined(__clang__)
559#elif defined(__GNUC__)
560#pragma GCC diagnostic ignored "-Wsuggest-final-methods"
562 template<
typename T,
typename L>
565#if defined(OS_TRACE_POSIX_IO_FILE)
569#pragma GCC diagnostic pop
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#pragma GCC diagnostic push
624#if defined(__clang__)
625#elif defined(__GNUC__)
626#pragma GCC diagnostic ignored "-Wredundant-tags"
628 template<
typename T,
typename L>
632 std::lock_guard<L> lock
637#pragma GCC diagnostic pop
639 template<
typename T,
typename L>
643 std::lock_guard<L> lock
649 template<
typename T,
typename L>
653 std::lock_guard<L> lock
659 template<
typename T,
typename L>
663 std::lock_guard<L> lock
669 template<
typename T,
typename L>
680#pragma GCC diagnostic pop
virtual ~file_impl() override
virtual int do_ftruncate(off_t length)=0
class file_system & get_file_system(void)
virtual int do_fsync(void)=0
file_implementable(file_system &fs)
virtual ~file_implementable() override
value_type & impl(void) const
virtual ssize_t read(void *buf, std::size_t nbyte) override
virtual ssize_t writev(const iovec *iov, int iovcnt) override
file_lockable(file_system &fs, lockable_type &locker)
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
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
file_impl & impl(void) const
virtual int fstatvfs(struct statvfs *buf)
virtual int ftruncate(off_t length)
class file_system & get_file_system(void)
virtual int close(void) override
virtual ssize_t writev(const iovec *iov, int iovcnt)
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 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)