I/O stream with data from a file. More...
#include <tfilestream.h>
Public Member Functions | |
FileStream (FileName fileName, bool openReadOnly=false) | |
FileStream (int fileDescriptor, bool openReadOnly=false) | |
~FileStream () override | |
FileStream (const FileStream &)=delete | |
FileStream & | operator= (const FileStream &)=delete |
FileName | name () const override |
ByteVector | readBlock (size_t length) override |
void | writeBlock (const ByteVector &data) override |
void | insert (const ByteVector &data, offset_t start=0, size_t replace=0) override |
void | removeBlock (offset_t start=0, size_t length=0) override |
bool | readOnly () const override |
bool | isOpen () const override |
void | seek (offset_t offset, Position p=Beginning) override |
void | clear () override |
offset_t | tell () const override |
offset_t | length () override |
void | truncate (offset_t length) override |
Public Member Functions inherited from TagLib::IOStream | |
IOStream () | |
virtual | ~IOStream () |
IOStream (const IOStream &)=delete | |
IOStream & | operator= (const IOStream &)=delete |
virtual FileName | name () const =0 |
virtual ByteVector | readBlock (size_t length)=0 |
virtual void | writeBlock (const ByteVector &data)=0 |
virtual void | insert (const ByteVector &data, offset_t start=0, size_t replace=0)=0 |
virtual void | removeBlock (offset_t start=0, size_t length=0)=0 |
virtual bool | readOnly () const =0 |
virtual bool | isOpen () const =0 |
virtual void | seek (offset_t offset, Position p=Beginning)=0 |
virtual void | clear () |
virtual offset_t | tell () const =0 |
virtual offset_t | length ()=0 |
virtual void | truncate (offset_t length)=0 |
Static Protected Member Functions | |
static unsigned int | bufferSize () |
Additional Inherited Members | |
Public Types inherited from TagLib::IOStream | |
enum | Position { Beginning , Current , End } |
I/O stream with data from a file.
TagLib::FileStream::FileStream | ( | FileName | fileName, |
bool | openReadOnly = false |
||
) |
Construct a FileStream object and open the fileName. fileName should be a C-string in the local file system encoding.
TagLib::FileStream::FileStream | ( | int | fileDescriptor, |
bool | openReadOnly = false |
||
) |
Construct a FileStream object using an existing fileDescriptor.
|
override |
Destroys this FileStream instance.
|
delete |
|
staticprotected |
Returns the buffer size that is used for internal buffering.
|
overridevirtual |
Reset the end-of-file and error flags on the file.
Reimplemented from TagLib::IOStream.
|
overridevirtual |
Insert data at position start in the file overwriting replace bytes of the original content.
Implements TagLib::IOStream.
|
overridevirtual |
Since the file can currently only be opened as an argument to the constructor (sort-of by design), this returns if that open succeeded.
Implements TagLib::IOStream.
|
overridevirtual |
Returns the length of the file.
Implements TagLib::IOStream.
|
overridevirtual |
Returns the file name in the local file system encoding.
Implements TagLib::IOStream.
|
delete |
|
overridevirtual |
Reads a block of size length at the current get pointer.
Implements TagLib::IOStream.
|
overridevirtual |
Returns true
if the file is read only (or if the file can not be opened).
Implements TagLib::IOStream.
|
overridevirtual |
Removes a block of the file starting a start and continuing for length bytes.
Implements TagLib::IOStream.
Move the I/O pointer to offset in the file from position p. This defaults to seeking from the beginning of the file.
Implements TagLib::IOStream.
|
overridevirtual |
Returns the current offset within the file.
Implements TagLib::IOStream.
|
overridevirtual |
Truncates the file to a length.
Implements TagLib::IOStream.
|
overridevirtual |
Attempts to write the block data at the current get pointer. If the file is currently only opened read only – i.e. readOnly() returns true
– this attempts to reopen the file in read/write mode.
Implements TagLib::IOStream.