A file class with some useful methods for tag manipulation. More...
#include <tfilestream.h>
Public Member Functions | |
FileStream (FileName file, bool openReadOnly=false) | |
FileStream (int fileDescriptor, bool openReadOnly=false) | |
virtual | ~FileStream () |
FileName | name () const |
ByteVector | readBlock (unsigned long length) |
void | writeBlock (const ByteVector &data) |
void | insert (const ByteVector &data, unsigned long start=0, unsigned long replace=0) |
void | removeBlock (unsigned long start=0, unsigned long length=0) |
bool | readOnly () const |
bool | isOpen () const |
void | seek (long offset, Position p=Beginning) |
void | clear () |
long | tell () const |
long | length () |
void | truncate (long length) |
![]() | |
IOStream () | |
virtual | ~IOStream () |
Static Protected Member Functions | |
static unsigned int | bufferSize () |
Additional Inherited Members | |
![]() | |
enum | Position { Beginning , Current , End } |
A file class with some useful methods for tag manipulation.
This class is a basic file class with some methods that are particularly useful for tag editors. It has methods to take advantage of ByteVector and a binary search method for finding patterns in a file.
TagLib::FileStream::FileStream | ( | FileName | file, |
bool | openReadOnly = false |
||
) |
Construct a File object and opens the file. file should be a be a C-string in the local file system encoding.
TagLib::FileStream::FileStream | ( | int | fileDescriptor, |
bool | openReadOnly = false |
||
) |
Construct a File object and opens the file using file descriptor.
|
virtual |
Destroys this FileStream instance.
|
staticprotected |
Returns the buffer size that is used for internal buffering.
|
virtual |
Reset the end-of-file and error flags on the file.
Reimplemented from TagLib::IOStream.
|
virtual |
Insert data at position start in the file overwriting replace bytes of the original content.
Implements TagLib::IOStream.
|
virtual |
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.
|
virtual |
Returns the length of the file.
Implements TagLib::IOStream.
|
virtual |
Returns the file name in the local file system encoding.
Implements TagLib::IOStream.
|
virtual |
Reads a block of size length at the current get pointer.
Implements TagLib::IOStream.
|
virtual |
Returns true if the file is read only (or if the file can not be opened).
Implements TagLib::IOStream.
|
virtual |
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.
|
virtual |
Returns the current offset within the file.
Implements TagLib::IOStream.
|
virtual |
Truncates the file to a length.
Implements TagLib::IOStream.
|
virtual |
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.