Public Member Functions | List of all members
qi::FileProxy Class Reference
Inheritance diagram for qi::FileProxy:
Inheritance graph
[legend]

Public Member Functions

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
 
- Public Member Functions inherited from qi::File
virtual ~File ()=default
 

Additional Inherited Members

- Static Public Attributes inherited from qi::File
static const std::streamsize MAX_READ_SIZE = 1000000
 Maximum count of bytes that you can read by reading functions call. More...
 
- Protected Member Functions inherited from qi::File
 File ()=default
 

Detailed Description

Definition at line 6 of file file_proxy.cpp.

Constructor & Destructor Documentation

◆ FileProxy()

qi::FileProxy::FileProxy ( qi::AnyObject  obj)
inlineexplicit

Definition at line 9 of file file_proxy.cpp.

◆ ~FileProxy()

qi::FileProxy::~FileProxy ( )
default

Member Function Documentation

◆ _close()

void qi::FileProxy::_close ( )
inlineoverride

Definition at line 72 of file file_proxy.cpp.

◆ _read() [1/2]

Buffer qi::FileProxy::_read ( std::streamoff  beginOffset,
std::streamsize  countBytesToRead 
)
inlineoverride

Definition at line 62 of file file_proxy.cpp.

◆ _read() [2/2]

Buffer qi::FileProxy::_read ( std::streamsize  countBytesToRead)
inlineoverride

Definition at line 57 of file file_proxy.cpp.

◆ _seek()

bool qi::FileProxy::_seek ( std::streamoff  offsetFromBegin)
inlineoverride

Definition at line 67 of file file_proxy.cpp.

◆ 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()

ProgressNotifierPtr qi::FileProxy::operationProgress ( ) const
inlineoverridevirtual

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
beginOffsetPosition in the file to start reading from.
countBytesToReadCount 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
countBytesToReadCount 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
offsetFromBeginNew 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:


naoqi_libqicore
Author(s): Aldebaran
autogenerated on Wed Sep 14 2022 02:22:41