tfilestream.h
Go to the documentation of this file.
/***************************************************************************
copyright : (C) 2002 - 2008 by Scott Wheeler
email : wheeler@kde.org
***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 2.1 as published by the Free Software Foundation. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#ifndef TAGLIB_FILESTREAM_H
#define TAGLIB_FILESTREAM_H
#include "tbytevector.h"
#include "tiostream.h"
#include "taglib_export.h"
#include "taglib.h"
namespace TagLib {
class String;
class Tag;
class AudioProperties;
class TAGLIB_EXPORT FileStream : public IOStream
{
public:
FileStream(FileName fileName, bool openReadOnly = false);
FileStream(int fileDescriptor, bool openReadOnly = false);
~FileStream() override;
FileStream(const FileStream &) = delete;
FileStream &operator=(const FileStream &) = 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;
protected:
static unsigned int bufferSize();
private:
class FileStreamPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FileStreamPrivate> d;
};
} // namespace TagLib
#endif
TagLib::AudioProperties
A simple, abstract interface to common audio properties.
Definition audioproperties.h:46
TagLib::ByteVector
A byte vector.
Definition tbytevector.h:46
TagLib::FileStream::FileStream
FileStream(const FileStream &)=delete
TagLib::FileStream::FileStream
FileStream(FileName fileName, bool openReadOnly=false)
TagLib::FileStream::insert
void insert(const ByteVector &data, offset_t start=0, size_t replace=0) override
TagLib::FileStream::FileStream
FileStream(int fileDescriptor, bool openReadOnly=false)
TagLib::FileStream::readBlock
ByteVector readBlock(size_t length) override
TagLib::FileStream::clear
void clear() override
TagLib::FileStream::readOnly
bool readOnly() const override
TagLib::FileStream::length
offset_t length() override
TagLib::FileStream::isOpen
bool isOpen() const override
TagLib::FileStream::seek
void seek(offset_t offset, Position p=Beginning) override
TagLib::FileStream::removeBlock
void removeBlock(offset_t start=0, size_t length=0) override
TagLib::FileStream::writeBlock
void writeBlock(const ByteVector &data) override
TagLib::FileStream::name
FileName name() const override
TagLib::FileStream::bufferSize
static unsigned int bufferSize()
TagLib::FileStream::~FileStream
~FileStream() override
TagLib::FileStream::truncate
void truncate(offset_t length) override
TagLib::FileStream::tell
offset_t tell() const override
TagLib::FileStream::operator=
FileStream & operator=(const FileStream &)=delete
TagLib::IOStream::Position
Position
Definition tiostream.h:70
TagLib::IOStream::Beginning
@ Beginning
Seek from the beginning of the file.
Definition tiostream.h:72
TagLib::IOStream::IOStream
IOStream()
TagLib::String
A wide string class suitable for unicode.
Definition tstring.h:83
TagLib::Tag
A simple, generic interface to common audio metadata fields.
Definition tag.h:49
TagLib
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
TagLib::FileName
const char * FileName
Definition tiostream.h:59
TagLib::offset_t
off_t offset_t
Definition taglib.h:64
taglib.h
taglib_export.h
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition taglib_export.h:40
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition taglib_export.h:55
tbytevector.h
tiostream.h