Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
No Matches
MUSIC_INFO::TagLibVFSStream Class Reference

#include <TagLibVFSStream.h>

Inheritance diagram for MUSIC_INFO::TagLibVFSStream:

Public Member Functions

 TagLibVFSStream (const std::string &strFileName, bool readOnly)
 ~TagLibVFSStream () override
TagLib::FileName name () const override
TagLib::ByteVector readBlock (TagLib::ulong length) override
void writeBlock (const TagLib::ByteVector &data) override
void insert (const TagLib::ByteVector &data, TagLib::ulong start=0, TagLib::ulong replace=0) override
void removeBlock (TagLib::ulong start=0, TagLib::ulong length=0) override
bool readOnly () const override
bool isOpen () const override
void seek (long offset, TagLib::IOStream::Position p=Beginning) override
void clear () override
long tell () const override
long length () override
void truncate (long length) override

Static Protected Member Functions

static TagLib::uint bufferSize ()

Constructor & Destructor Documentation

◆ TagLibVFSStream()

TagLibVFSStream::TagLibVFSStream ( const std::string & strFileName,
bool readOnly )

Construct a File object and opens the file. file should be a be an XBMC Vfile.

◆ ~TagLibVFSStream()

TagLibVFSStream::~TagLibVFSStream ( )

Destroys this ByteVectorStream instance.

Member Function Documentation

◆ bufferSize()

static TagLib::uint MUSIC_INFO::TagLibVFSStream::bufferSize ( )

Returns the buffer size that is used for internal buffering.

◆ clear()

void TagLibVFSStream::clear ( )

Reset the end-of-file and error flags on the file.

◆ insert()

void TagLibVFSStream::insert ( const TagLib::ByteVector & data,
TagLib::ulong start = 0,
TagLib::ulong replace = 0 )

Insert data at position start in the file overwriting replace bytes of the original content.

This method is slow since it requires rewriting all of the file after the insertion point.

◆ isOpen()

bool TagLibVFSStream::isOpen ( ) const

Since the file can currently only be opened as an argument to the constructor (sort-of by design), this returns if that open succeeded.

◆ length()

long TagLibVFSStream::length ( )

Returns the length of the file.

◆ name()

FileName TagLibVFSStream::name ( ) const

Returns the file name in the local file system encoding.

◆ readBlock()

ByteVector TagLibVFSStream::readBlock ( TagLib::ulong length)

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

◆ readOnly()

bool TagLibVFSStream::readOnly ( ) const

Returns true if the file is read only (or if the file can not be opened).

◆ removeBlock()

void TagLibVFSStream::removeBlock ( TagLib::ulong start = 0,
TagLib::ulong length = 0 )

Removes a block of the file starting a start and continuing for length bytes.

This method is slow since it involves rewriting all of the file after the removed portion.

◆ seek()

void TagLibVFSStream::seek ( long offset,
TagLib::IOStream::Position p = Beginning )

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

◆ tell()

long TagLibVFSStream::tell ( ) const

Returns the current offset within the file.

◆ truncate()

void TagLibVFSStream::truncate ( long length)

Truncates the file to a length.

◆ writeBlock()

void TagLibVFSStream::writeBlock ( const TagLib::ByteVector & data)

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.

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[].

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