File stream class.
More...
#include <FileStream.h>
|
| ~FileStream () override=default |
|
int64_t | read (void *buffer, size_t length) override |
|
int64_t | write (const void *buffer, size_t length) override |
|
void | close () override |
|
int64_t | peek (void *buffer, size_t length) override |
|
int64_t | trunc (size_t length) override |
|
bool | eof () const |
|
int64_t | getSeek () const |
|
int32_t | setSeek (int64_t offset, int32_t whence) const |
|
int32_t | setSeek (int64_t offset, Seek type) const |
|
int32_t | flush () const |
|
int32_t | getFd () const |
|
virtual | ~InputStream () noexcept=default |
|
virtual | ~OutputStream () noexcept=default |
|
int64_t | write (const std::string_view &buffer) |
|
int64_t | write (const text::StringView &buffer) |
|
template<typename T > |
int64_t | write (std::vector< T > &buffer) |
|
template<typename T , size_t N> |
int64_t | write (std::array< T, N > &buffer) |
|
virtual | ~Closeable ()=default |
|
virtual | ~PeekableStream ()=default |
|
◆ Ptr
◆ ~FileStream()
sese::io::FileStream::~FileStream |
( |
| ) |
|
|
overridedefault |
◆ FileStream()
sese::io::FileStream::FileStream |
( |
| ) |
|
|
privatedefaultnoexcept |
◆ close()
void FileStream::close |
( |
| ) |
|
|
overridevirtual |
◆ create()
FileStream::Ptr FileStream::create |
( |
const std::string & | file_path, |
|
|
const char * | mode ) |
|
staticnoexcept |
◆ createEx()
◆ createWithPath()
Open a file in UNIX-LIKE style
- Parameters
-
path | UNIX-LIKE path |
mode | Open mode |
- Return values
-
References create().
◆ eof()
bool FileStream::eof |
( |
| ) |
const |
|
nodiscard |
This function is used to determine if the end of the file has been reached
- Warning
- This requires an initial read failure to obtain a valid value
- Returns
- Result
References file.
◆ flush()
int32_t FileStream::flush |
( |
| ) |
const |
|
nodiscard |
◆ getFd()
int32_t FileStream::getFd |
( |
| ) |
const |
|
nodiscard |
◆ getSeek()
int64_t FileStream::getSeek |
( |
| ) |
const |
|
nodiscard |
◆ peek()
int64_t FileStream::peek |
( |
void * | buffer, |
|
|
size_t | length ) |
|
overridevirtual |
◆ read()
int64_t FileStream::read |
( |
void * | buffer, |
|
|
size_t | length ) |
|
overridevirtual |
◆ setSeek() [1/2]
int32_t FileStream::setSeek |
( |
int64_t | offset, |
|
|
int32_t | whence ) const |
|
nodiscard |
◆ setSeek() [2/2]
int32_t FileStream::setSeek |
( |
int64_t | offset, |
|
|
Seek | type ) const |
|
nodiscard |
◆ trunc()
int64_t FileStream::trunc |
( |
size_t | length | ) |
|
|
overridevirtual |
◆ write()
int64_t FileStream::write |
( |
const void * | buffer, |
|
|
size_t | length ) |
|
overridevirtual |
◆ B_APPEND
auto sese::io::FileStream::B_APPEND = "ab+" |
|
staticconstexpr |
◆ B_READ
auto sese::io::FileStream::B_READ = "rb" |
|
staticconstexpr |
◆ B_TRUNC
auto sese::io::FileStream::B_TRUNC = "wb+" |
|
staticconstexpr |
◆ B_WRITE_APPEND
auto sese::io::FileStream::B_WRITE_APPEND = "ab" |
|
staticconstexpr |
◆ B_WRITE_TRUNC
auto sese::io::FileStream::B_WRITE_TRUNC = "wb" |
|
staticconstexpr |
◆ file
FILE* sese::io::FileStream::file = nullptr |
|
private |
◆ T_APPEND
auto sese::io::FileStream::T_APPEND = "at+" |
|
staticconstexpr |
◆ T_READ
auto sese::io::FileStream::T_READ = "rt" |
|
staticconstexpr |
◆ T_TRUNC
auto sese::io::FileStream::T_TRUNC = "wt+" |
|
staticconstexpr |
◆ T_WRITE_APPEND
auto sese::io::FileStream::T_WRITE_APPEND = "at" |
|
staticconstexpr |
◆ T_WRITE_TRUNC
auto sese::io::FileStream::T_WRITE_TRUNC = "wt" |
|
staticconstexpr |
The documentation for this class was generated from the following files: