In-memory Stream class using ByteVector for its storage.
More...
#include <tbytevectorstream.h>
In-memory Stream class using ByteVector for its storage.
TagLib::ByteVectorStream::ByteVectorStream |
( |
const ByteVector & |
data | ) |
|
Construct a File object and opens the file. file should be a be a C-string in the local file system encoding.
virtual TagLib::ByteVectorStream::~ByteVectorStream |
( |
| ) |
|
|
virtual |
void TagLib::ByteVectorStream::clear |
( |
| ) |
|
|
virtual |
Reset the end-of-file and error flags on the file.
Reimplemented from TagLib::IOStream.
void TagLib::ByteVectorStream::insert |
( |
const ByteVector & |
data, |
|
|
unsigned long |
start = 0 , |
|
|
unsigned long |
replace = 0 |
|
) |
| |
|
virtual |
Insert data at position start in the file overwriting replace bytes of the original content.
- Note
- This method is slow since it requires rewriting all of the file after the insertion point.
Implements TagLib::IOStream.
bool TagLib::ByteVectorStream::isOpen |
( |
| ) |
const |
|
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.
long TagLib::ByteVectorStream::length |
( |
| ) |
|
|
virtual |
FileName TagLib::ByteVectorStream::name |
( |
| ) |
const |
|
virtual |
Returns the file name in the local file system encoding.
Implements TagLib::IOStream.
ByteVector TagLib::ByteVectorStream::readBlock |
( |
unsigned long |
length | ) |
|
|
virtual |
Reads a block of size length at the current get pointer.
Implements TagLib::IOStream.
bool TagLib::ByteVectorStream::readOnly |
( |
| ) |
const |
|
virtual |
Returns true if the file is read only (or if the file can not be opened).
Implements TagLib::IOStream.
void TagLib::ByteVectorStream::removeBlock |
( |
unsigned long |
start = 0 , |
|
|
unsigned long |
length = 0 |
|
) |
| |
|
virtual |
Removes a block of the file starting a start and continuing for length bytes.
- Note
- This method is slow since it involves rewriting all of the file after the removed portion.
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.
- See Also
- Position
Implements TagLib::IOStream.
long TagLib::ByteVectorStream::tell |
( |
| ) |
const |
|
virtual |
void TagLib::ByteVectorStream::truncate |
( |
long |
length | ) |
|
|
virtual |
void TagLib::ByteVectorStream::writeBlock |
( |
const ByteVector & |
data | ) |
|
|
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.
- Note
- This should be used instead of using the streaming output operator for a ByteVector. And even this function is significantly slower than doing output with a char[].
Implements TagLib::IOStream.
The documentation for this class was generated from the following file: