|
void | _close () override |
|
Buffer | _read (std::streamoff beginOffset, std::streamsize countBytesToRead) override |
|
Buffer | _read (std::streamsize countBytesToRead) override |
|
bool | _seek (std::streamoff offsetFromBegin) override |
|
void | close () override |
|
| FileProxy (qi::AnyObject obj) |
|
bool | isOpen () const override |
|
bool | isRemote () const override |
|
ProgressNotifierPtr | operationProgress () const override |
|
Buffer | read (std::streamoff beginOffset, std::streamsize countBytesToRead) override |
|
Buffer | read (std::streamsize countBytesToRead) override |
|
bool | seek (std::streamoff offsetFromBegin) override |
|
std::streamsize | size () const override |
|
| ~FileProxy ()=default |
|
virtual | ~File ()=default |
|
|
static const std::streamsize | MAX_READ_SIZE = 1000000 |
| Maximum count of bytes that you can read by reading functions call. More...
|
|
| File ()=default |
|
Definition at line 6 of file file_proxy.cpp.
◆ FileProxy()
qi::FileProxy::FileProxy |
( |
qi::AnyObject |
obj | ) |
|
|
inlineexplicit |
◆ ~FileProxy()
qi::FileProxy::~FileProxy |
( |
| ) |
|
|
default |
◆ _close()
void qi::FileProxy::_close |
( |
| ) |
|
|
inlineoverride |
◆ _read() [1/2]
Buffer qi::FileProxy::_read |
( |
std::streamoff |
beginOffset, |
|
|
std::streamsize |
countBytesToRead |
|
) |
| |
|
inlineoverride |
◆ _read() [2/2]
Buffer qi::FileProxy::_read |
( |
std::streamsize |
countBytesToRead | ) |
|
|
inlineoverride |
◆ _seek()
bool qi::FileProxy::_seek |
( |
std::streamoff |
offsetFromBegin | ) |
|
|
inlineoverride |
◆ close()
void qi::FileProxy::close |
( |
| ) |
|
|
inlineoverridevirtual |
Close the file. Once this function is called, calling most other operation will throw a std::runtime_error. The size(), isOpen() and isRemote() calls will return work as expected.
Implements qi::File.
Definition at line 31 of file file_proxy.cpp.
◆ isOpen()
bool qi::FileProxy::isOpen |
( |
| ) |
const |
|
inlineoverridevirtual |
- Returns
- true if the file is currently open for reading, false otherwise.
Implements qi::File.
Definition at line 41 of file file_proxy.cpp.
◆ isRemote()
bool qi::FileProxy::isRemote |
( |
| ) |
const |
|
inlineoverridevirtual |
- Returns
- true if the file is located on a remote filesystem, false otherwise.
Implements qi::File.
Definition at line 46 of file file_proxy.cpp.
◆ operationProgress()
Provide the progress notifier used by the operations manipulating this file. The notifier is associated with this file. Therefore, no concurrent operation should be used by this notifier object, as it is not safe to have concurrent operations running on the same file.
Implements qi::File.
Definition at line 51 of file file_proxy.cpp.
◆ read() [1/2]
Buffer qi::FileProxy::read |
( |
std::streamoff |
beginOffset, |
|
|
std::streamsize |
countBytesToRead |
|
) |
| |
|
inlineoverridevirtual |
Read a specified count of bytes starting from a specified byte position in the file.
- Warning
- If you try to read more than _MAX_READ_SIZE bytes, this call will throw a std::runtime_error.
- Parameters
-
beginOffset | Position in the file to start reading from. |
countBytesToRead | Count of bytes to read from the file starting at the current position of the file cursor. |
- Returns
- A buffer of data read from the file, empty if:
- there is no data in the specified byte range to read
- if the file have been closed;
- if the start position is outside the available range of data in the file. If there is less data to read in the file than the required count, if we try reading past the end of the file for example, then the buffer will only contain the available data, nothing more
Implements qi::File.
Definition at line 21 of file file_proxy.cpp.
◆ read() [2/2]
Buffer qi::FileProxy::read |
( |
std::streamsize |
countBytesToRead | ) |
|
|
inlineoverridevirtual |
Read a specified count of bytes starting from the current cursor position.
- Warning
- If you try to read more than _MAX_READ_SIZE bytes, this call will throw a std::runtime_error.
- Parameters
-
countBytesToRead | Count of bytes to read from the file, starting from the current position of the file cursor. |
- Returns
- A buffer of data read from the file, empty if there is no data in the specified byte range to read or if the file have been closed. If there is less data to read in the file than the required count, if we try reading past the end of the file for example, then the buffer will only contain the available data, nothing more.
Implements qi::File.
Definition at line 16 of file file_proxy.cpp.
◆ seek()
bool qi::FileProxy::seek |
( |
std::streamoff |
offsetFromBegin | ) |
|
|
inlineoverridevirtual |
Move the read cursor to the specified position in the file.
- Parameters
-
offsetFromBegin | New position of the read cursor in the file. If it is out of the range of data in the file, the cursor will not be changed at all. |
- Returns
- true if the position is in the range of data available in the file, false otherwise, in which case the cursor have not been changed.
Implements qi::File.
Definition at line 26 of file file_proxy.cpp.
◆ size()
std::streamsize qi::FileProxy::size |
( |
| ) |
const |
|
inlineoverridevirtual |
- Returns
- Total count of bytes contained in the file or 0 if the file is closed.
Implements qi::File.
Definition at line 36 of file file_proxy.cpp.
The documentation for this class was generated from the following file: