TagLibChannelFileIO Class Reference

#include <TaglibChannelFileIO.h>

Public Member Functions

 TagLibChannelFileIO (nsCString channelID, sbISeekableChannel *pSeekableChannel)
 
virtual ~TagLibChannelFileIO ()
 
nsresult Initialize ()
 
virtual FileName name () const
 
virtual ByteVector readBlock (TagLib::ulong length)
 
virtual void writeBlock (const ByteVector &data)
 
virtual void insert (const ByteVector &data, TagLib::ulong start=0, TagLib::ulong replace=0)
 
virtual void removeBlock (TagLib::ulong start=0, TagLib::ulong length=0)
 
virtual bool readOnly () const
 
virtual bool isOpen () const
 
virtual bool isReadable ()
 
virtual bool isWritable ()
 
virtual int seek (long offset, File::Position p=File::Beginning)
 
virtual void clear ()
 
virtual long tell () const
 
virtual long length ()
 
virtual File * tempFile ()
 
virtual bool closeTempFile (bool overwrite)
 

Protected Member Functions

virtual void truncate (long length)
 

Detailed Description

Definition at line 74 of file TaglibChannelFileIO.h.

Constructor & Destructor Documentation

TagLibChannelFileIO::TagLibChannelFileIO ( nsCString  channelID,
sbISeekableChannel pSeekableChannel 
)

Definition at line 398 of file TaglibChannelFileIO.cpp.

TagLibChannelFileIO::~TagLibChannelFileIO ( )
virtual

Definition at line 417 of file TaglibChannelFileIO.cpp.

Member Function Documentation

void TagLibChannelFileIO::clear ( )
virtual

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

Definition at line 308 of file TaglibChannelFileIO.cpp.

bool TagLibChannelFileIO::closeTempFile ( bool  overwrite)
virtual

Close any previously allocated temporary files

Parameters
overwriteIf true, will attempt to replace this file

Definition at line 356 of file TaglibChannelFileIO.cpp.

nsresult TagLibChannelFileIO::Initialize ( )

Definition at line 428 of file TaglibChannelFileIO.cpp.

void TagLibChannelFileIO::insert ( const ByteVector &  data,
TagLib::ulong  start = 0,
TagLib::ulong  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.

Definition at line 166 of file TaglibChannelFileIO.cpp.

bool TagLibChannelFileIO::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.

Definition at line 208 of file TaglibChannelFileIO.cpp.

bool TagLibChannelFileIO::isReadable ( )
virtual

Returns true if the file can be opened for reading. If the file does not exist, this will return false.

Deprecated:

Definition at line 230 of file TaglibChannelFileIO.cpp.

bool TagLibChannelFileIO::isWritable ( )
virtual

Returns true if the file can be opened for writing.

Deprecated:

Definition at line 241 of file TaglibChannelFileIO.cpp.

long TagLibChannelFileIO::length ( )
virtual

Returns the length of the file.

Definition at line 344 of file TaglibChannelFileIO.cpp.

Here is the caller graph for this function:

FileName TagLibChannelFileIO::name ( ) const
virtual

Returns the file name in the local file system encoding.

Definition at line 82 of file TaglibChannelFileIO.cpp.

ByteVector TagLibChannelFileIO::readBlock ( TagLib::ulong  length)
virtual

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

Definition at line 98 of file TaglibChannelFileIO.cpp.

Here is the call graph for this function:

bool TagLibChannelFileIO::readOnly ( ) const
virtual

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

Definition at line 195 of file TaglibChannelFileIO.cpp.

void TagLibChannelFileIO::removeBlock ( TagLib::ulong  start = 0,
TagLib::ulong  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.

Definition at line 183 of file TaglibChannelFileIO.cpp.

int TagLibChannelFileIO::seek ( long  offset,
File::Position  p = File::Beginning 
)
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

Definition at line 256 of file TaglibChannelFileIO.cpp.

long TagLibChannelFileIO::tell ( ) const
virtual

Returns the current offset withing the file.

Definition at line 318 of file TaglibChannelFileIO.cpp.

File * TagLibChannelFileIO::tempFile ( )
virtual

Return a temporary file to use, creating it if necessary

Definition at line 349 of file TaglibChannelFileIO.cpp.

void TagLibChannelFileIO::truncate ( long  length)
protectedvirtual

Truncates the file to a length.

Definition at line 374 of file TaglibChannelFileIO.cpp.

void TagLibChannelFileIO::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[].

Definition at line 151 of file TaglibChannelFileIO.cpp.


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