![]() |
|
An abstract class that provides operations on a sequence of bytes. More...
#include <tiostream.h>
Public Types | |
enum | Position { Beginning, Current, End } |
Public Member Functions | |
IOStream () | |
virtual | ~IOStream () |
virtual FileName | name () const =0 |
virtual ByteVector | readBlock (ulong length)=0 |
virtual void | writeBlock (const ByteVector &data)=0 |
virtual void | insert (const ByteVector &data, ulong start=0, ulong replace=0)=0 |
virtual void | removeBlock (ulong start=0, ulong length=0)=0 |
virtual bool | readOnly () const =0 |
virtual bool | isOpen () const =0 |
virtual void | seek (long offset, Position p=Beginning)=0 |
virtual void | clear () |
virtual long | tell () const =0 |
virtual long | length ()=0 |
virtual void | truncate (long length)=0 |
An abstract class that provides operations on a sequence of bytes.
virtual TagLib::IOStream::~IOStream | ( | ) | [virtual] |
Destroys this IOStream instance.
virtual void TagLib::IOStream::clear | ( | ) | [virtual] |
Reset the end-of-stream and error flags on the stream.
Reimplemented in TagLib::FileStream, and TagLib::ByteVectorStream.
virtual void TagLib::IOStream::insert | ( | const ByteVector & | data, |
ulong | start = 0 , |
||
ulong | replace = 0 |
||
) | [pure virtual] |
Insert data at position start in the file overwriting replace bytes of the original content.
Implemented in TagLib::FileStream, and TagLib::ByteVectorStream.
virtual bool TagLib::IOStream::isOpen | ( | ) | const [pure 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.
Implemented in TagLib::FileStream, and TagLib::ByteVectorStream.
virtual long TagLib::IOStream::length | ( | ) | [pure virtual] |
Returns the length of the stream.
Implemented in TagLib::FileStream, and TagLib::ByteVectorStream.
virtual FileName TagLib::IOStream::name | ( | ) | const [pure virtual] |
Returns the stream name in the local file system encoding.
Implemented in TagLib::FileStream, and TagLib::ByteVectorStream.
virtual ByteVector TagLib::IOStream::readBlock | ( | ulong | length | ) | [pure virtual] |
Reads a block of size length at the current get pointer.
Implemented in TagLib::FileStream, and TagLib::ByteVectorStream.
virtual bool TagLib::IOStream::readOnly | ( | ) | const [pure virtual] |
Returns true if the file is read only (or if the file can not be opened).
Implemented in TagLib::FileStream, and TagLib::ByteVectorStream.
virtual void TagLib::IOStream::removeBlock | ( | ulong | start = 0 , |
ulong | length = 0 |
||
) | [pure virtual] |
Removes a block of the file starting a start and continuing for length bytes.
Implemented in TagLib::FileStream, and TagLib::ByteVectorStream.
virtual void TagLib::IOStream::seek | ( | long | offset, |
Position | p = Beginning |
||
) | [pure virtual] |
Move the I/O pointer to offset in the stream from position p. This defaults to seeking from the beginning of the stream.
Implemented in TagLib::FileStream, and TagLib::ByteVectorStream.
virtual long TagLib::IOStream::tell | ( | ) | const [pure virtual] |
Returns the current offset within the stream.
Implemented in TagLib::FileStream, and TagLib::ByteVectorStream.
virtual void TagLib::IOStream::truncate | ( | long | length | ) | [pure virtual] |
Truncates the stream to a length.
Implemented in TagLib::FileStream, and TagLib::ByteVectorStream.
virtual void TagLib::IOStream::writeBlock | ( | const ByteVector & | data | ) | [pure 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.
Implemented in TagLib::FileStream, and TagLib::ByteVectorStream.