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

## 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.

References data().

Referenced by ByteVectorStream(), and operator=().

## ~ByteVectorStream()

TagLib::ByteVectorStream::~ByteVectorStream | ( |  | ) |

override

Destroys this ByteVectorStream instance.

## ByteVectorStream() [2/2]

TagLib::ByteVectorStream::ByteVectorStream | ( | const ByteVectorStream & |  | ) |

delete

References ByteVectorStream().

## Member Function Documentation

## clear()

void TagLib::ByteVectorStream::clear | ( |  | ) |

override virtual

Does nothing.

Reimplemented from TagLib::IOStream.

## data()

ByteVector * TagLib::ByteVectorStream::data | ( |  | ) |

References TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE.

Referenced by ByteVectorStream(), insert(), and writeBlock().

## insert()

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

override 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.

References data().

## isOpen()

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

override virtual

Returns `true`.

Implements TagLib::IOStream.

## length()

offset_t TagLib::ByteVectorStream::length | ( |  | ) |

override virtual

Returns the length of the file.

Implements TagLib::IOStream.

Referenced by readBlock(), removeBlock(), and truncate().

## name()

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

override virtual

Returns an empty string.

Implements TagLib::IOStream.

## operator=()

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

delete

References ByteVectorStream().

## readBlock()

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

override virtual

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

Implements TagLib::IOStream.

References length().

## readOnly()

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

override virtual

Returns `false`.

Implements TagLib::IOStream.

## removeBlock()

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

override 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.

References length().

## seek()

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

override virtual

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.

References TagLib::IOStream::Beginning.

## tell()

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

override virtual

Returns the current offset within the file.

Implements TagLib::IOStream.

## truncate()

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

override virtual

Truncates the file to a length.

Implements TagLib::IOStream.

References length().

## writeBlock()

void TagLib::ByteVectorStream::writeBlock | ( | const ByteVector & | data | ) |

override virtual

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.

References data().

The documentation for this class was generated from the following file:

- tbytevectorstream.h