TagLib API Documentation
Public Member Functions | List of all members
TagLib::ByteVectorStream Class Reference

In-memory Stream class using ByteVector for its storage. More...

#include <tbytevectorstream.h>

Inheritance diagram for TagLib::ByteVectorStream:
[legend]
Collaboration diagram for TagLib::ByteVectorStream:
[legend]

Public Member Functions

 ByteVectorStream (const ByteVector &data)
 
 ~ByteVectorStream () override
 
 ByteVectorStream (const ByteVectorStream &)=delete
 
ByteVectorStreamoperator= (const ByteVectorStream &)=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
 
ByteVectordata ()
 
- Public Member Functions inherited from TagLib::IOStream
 IOStream ()
 
virtual ~IOStream ()
 
 IOStream (const IOStream &)=delete
 
IOStreamoperator= (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
 

Additional Inherited Members

- Public Types inherited from TagLib::IOStream
enum  Position { Beginning , Current , End }
 

Detailed Description

In-memory Stream class using ByteVector for its storage.

Constructor & Destructor Documentation

◆ ByteVectorStream() [1/2]

TagLib::ByteVectorStream::ByteVectorStream ( const ByteVector data)

Construct a ByteVectorStream from the bytes in data.

◆ ~ByteVectorStream()

TagLib::ByteVectorStream::~ByteVectorStream ( )
override

Destroys this ByteVectorStream instance.

◆ ByteVectorStream() [2/2]

TagLib::ByteVectorStream::ByteVectorStream ( const ByteVectorStream )
delete

Member Function Documentation

◆ clear()

void TagLib::ByteVectorStream::clear ( )
overridevirtual

Does nothing.

Reimplemented from TagLib::IOStream.

◆ data()

ByteVector * TagLib::ByteVectorStream::data ( )

◆ insert()

void TagLib::ByteVectorStream::insert ( const ByteVector data,
offset_t  start = 0,
size_t  replace = 0 
)
overridevirtual

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.

◆ isOpen()

bool TagLib::ByteVectorStream::isOpen ( ) const
overridevirtual

Returns true.

Implements TagLib::IOStream.

◆ length()

offset_t TagLib::ByteVectorStream::length ( )
overridevirtual

Returns the length of the file.

Implements TagLib::IOStream.

◆ name()

FileName TagLib::ByteVectorStream::name ( ) const
overridevirtual

Returns an empty string.

Implements TagLib::IOStream.

◆ operator=()

ByteVectorStream & TagLib::ByteVectorStream::operator= ( const ByteVectorStream )
delete

◆ readBlock()

ByteVector TagLib::ByteVectorStream::readBlock ( size_t  length)
overridevirtual

Reads a block of size length at the current get pointer.

Implements TagLib::IOStream.

◆ readOnly()

bool TagLib::ByteVectorStream::readOnly ( ) const
overridevirtual

Returns false.

Implements TagLib::IOStream.

◆ removeBlock()

void TagLib::ByteVectorStream::removeBlock ( offset_t  start = 0,
size_t  length = 0 
)
overridevirtual

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.

◆ seek()

void TagLib::ByteVectorStream::seek ( offset_t  offset,
Position  p = Beginning 
)
overridevirtual

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.

◆ tell()

offset_t TagLib::ByteVectorStream::tell ( ) const
overridevirtual

Returns the current offset within the file.

Implements TagLib::IOStream.

◆ truncate()

void TagLib::ByteVectorStream::truncate ( offset_t  length)
overridevirtual

Truncates the file to a length.

Implements TagLib::IOStream.

◆ writeBlock()

void TagLib::ByteVectorStream::writeBlock ( const ByteVector data)
overridevirtual

Writes the block data at the current get pointer.

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: