File class. More...
#include <cmsis-plus/posix-io/file.h>
Inheritance diagram for os::posix::file:Public Types | |
Types & Constants | |
| enum class | type : type_t { unknown = 0 , not_set = 1 << 0 , char_device = 1 << 1 , block_device = 1 << 2 , tty = 1 << 3 , file = 1 << 4 , socket = 1 << 5 } |
| using | type_t = unsigned int |
Public Member Functions | |
Constructors & Destructor | |
| file (file_impl &impl) | |
| virtual | ~file () override |
Public Member Functions | |
| virtual int | close (void) override |
| virtual int | ftruncate (off_t length) |
| virtual int | fsync (void) |
| virtual int | fstatvfs (struct statvfs *buf) |
| class file_system & | get_file_system (void) |
| file_impl & | impl (void) const |
Public Member Functions | |
| virtual ssize_t | read (void *buf, std::size_t nbyte) |
| virtual ssize_t | write (const void *buf, std::size_t nbyte) |
| virtual ssize_t | writev (const iovec *iov, int iovcnt) |
| int | fcntl (int cmd,...) |
| virtual int | vfcntl (int cmd, std::va_list args) |
| int | isatty (void) |
| virtual int | fstat (struct stat *buf) |
| virtual off_t | lseek (off_t offset, int whence) |
| type_t | get_type (void) const |
| file_descriptor_t | file_descriptor (void) const |
| bool | is_opened (void) |
Protected Member Functions | |
Private Member Functions | |
| void | file_descriptor (file_descriptor_t fildes) |
| void | clear_file_descriptor (void) |
| io * | alloc_file_descriptor (void) |
|
inherited |
|
stronginherited |
| Enumerator | |
|---|---|
| unknown | |
| not_set | |
| char_device | |
| block_device | |
| tty | |
| file | |
| socket | |
Definition at line 126 of file io.h.
| os::posix::file::file | ( | file_impl & | impl | ) |
Definition at line 37 of file file.cpp.
References os::trace::printf().
|
overridevirtual |
Definition at line 44 of file file.cpp.
References os::trace::printf().
|
protectedinherited |
Definition at line 189 of file io.cpp.
References os::posix::file_descriptors_manager::allocate(), os::posix::io::clear_file_descriptor(), os::posix::io_impl::do_close(), os::posix::io::impl(), and os::trace::printf().
Referenced by os::posix::socket::accept(), os::posix::socket(), os::posix::device::vopen(), and os::posix::file_system::vopen().
|
inlineprotectedinherited |
Definition at line 446 of file io.h.
References os::posix::no_file_descriptor.
Referenced by os::posix::io::alloc_file_descriptor().
|
overridevirtual |
Reimplemented from os::posix::io.
Reimplemented in os::posix::file_lockable< T, L >.
Definition at line 54 of file file.cpp.
References os::posix::file_system::add_deferred_file(), os::posix::io::close(), get_file_system(), and os::trace::printf().
Referenced by os::posix::file_lockable< T, L >::close().
|
inherited |
Definition at line 363 of file io.cpp.
References os::posix::io::vfcntl().
|
inlineprotectedinherited |
|
inlineinherited |
Definition at line 452 of file io.h.
Referenced by os::posix::file_descriptors_manager::allocate(), os::posix::file_descriptors_manager::assign(), os::posix::device::vopen(), and os::posix::vopen().
|
virtualinherited |
Reimplemented in os::posix::file_lockable< T, L >.
Definition at line 416 of file io.cpp.
References os::posix::io_impl::do_fstat(), os::posix::io::impl(), and os::trace::printf().
Referenced by os::posix::file_lockable< T, L >::fstat().
|
virtual |
Definition at line 104 of file file.cpp.
References get_file_system(), os::trace::printf(), and os::posix::file_system::statvfs().
|
virtual |
Reimplemented in os::posix::file_lockable< T, L >.
Definition at line 91 of file file.cpp.
References os::posix::file_impl::do_fsync(), impl(), and os::trace::printf().
Referenced by os::posix::file_lockable< T, L >::fsync().
|
virtual |
Reimplemented in os::posix::file_lockable< T, L >.
Definition at line 72 of file file.cpp.
References os::posix::file_impl::do_ftruncate(), impl(), and os::trace::printf().
Referenced by os::posix::file_lockable< T, L >::ftruncate().
|
inline |
Definition at line 478 of file file.h.
References os::posix::file_impl::get_file_system(), and impl().
Referenced by close(), and fstatvfs().
|
inlineinherited |
Definition at line 434 of file io.h.
Referenced by os::posix::file_descriptors_manager::socket().
|
inline |
Definition at line 484 of file file.h.
Referenced by fsync(), ftruncate(), and get_file_system().
|
inlineinherited |
Definition at line 458 of file io.h.
References os::posix::io_impl::do_is_opened(), and os::posix::io::impl().
|
inherited |
Definition at line 406 of file io.cpp.
References os::posix::io_impl::do_isatty(), and os::posix::io::impl().
|
virtualinherited |
Reimplemented in os::posix::block_device_lockable< T, L >, and os::posix::file_lockable< T, L >.
Definition at line 447 of file io.cpp.
References os::posix::io_impl::do_lseek(), os::posix::io::impl(), and os::trace::printf().
Referenced by os::posix::block_device_lockable< T, L >::lseek(), and os::posix::file_lockable< T, L >::lseek().
|
virtualinherited |
Reimplemented in os::posix::block_device_lockable< T, L >, and os::posix::file_lockable< T, L >.
Definition at line 217 of file io.cpp.
References os::posix::io_impl::do_read(), os::posix::io::impl(), and os::trace::printf().
Referenced by os::posix::block_device_lockable< T, L >::read(), and os::posix::file_lockable< T, L >::read().
|
virtualinherited |
Reimplemented in os::posix::block_device_lockable< T, L >, and os::posix::file_lockable< T, L >.
Definition at line 380 of file io.cpp.
References os::posix::io_impl::do_vfcntl(), os::posix::io::impl(), and os::trace::printf().
Referenced by os::posix::io::fcntl(), os::posix::block_device_lockable< T, L >::vfcntl(), and os::posix::file_lockable< T, L >::vfcntl().
|
virtualinherited |
Reimplemented in os::posix::block_device_lockable< T, L >, and os::posix::file_lockable< T, L >.
Definition at line 268 of file io.cpp.
References os::posix::io_impl::do_write(), os::posix::io::impl(), and os::trace::printf().
Referenced by os::posix::block_device_lockable< T, L >::write(), and os::posix::file_lockable< T, L >::write().
|
virtualinherited |
Reimplemented in os::posix::block_device_lockable< T, L >, and os::posix::file_lockable< T, L >.
Definition at line 321 of file io.cpp.
References os::posix::io_impl::do_writev(), os::posix::io::impl(), and os::trace::printf().
Referenced by os::posix::block_device_lockable< T, L >::writev(), and os::posix::file_lockable< T, L >::writev().