aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukáš Lalinský <lalinsky@gmail.com>2011-04-11 23:31:44 +0200
committerLukáš Lalinský <lalinsky@gmail.com>2011-04-11 23:31:44 +0200
commit26c130c3879a1eb2c07c784a91464911c42e5bab (patch)
tree864d046375c43a8e8fd110dd73c8592e742743ba
parent8b59bb595779721f884fedf4e16965031b223413 (diff)
Duplicate contructors of File subclasses to accept IOStream*
-rw-r--r--taglib/ape/apefile.cpp7
-rw-r--r--taglib/ape/apefile.h8
-rw-r--r--taglib/asf/asffile.cpp7
-rw-r--r--taglib/asf/asffile.h10
-rw-r--r--taglib/flac/flacfile.cpp9
-rw-r--r--taglib/flac/flacfile.h13
-rw-r--r--taglib/mp4/mp4file.cpp7
-rw-r--r--taglib/mp4/mp4file.h10
-rw-r--r--taglib/mpc/mpcfile.cpp7
-rw-r--r--taglib/mpc/mpcfile.h8
-rw-r--r--taglib/ogg/flac/oggflacfile.cpp7
-rw-r--r--taglib/ogg/flac/oggflacfile.h8
-rw-r--r--taglib/ogg/oggfile.cpp5
-rw-r--r--taglib/ogg/oggfile.h11
-rw-r--r--taglib/ogg/speex/speexfile.cpp7
-rw-r--r--taglib/ogg/speex/speexfile.h8
-rw-r--r--taglib/ogg/vorbis/vorbisfile.cpp7
-rw-r--r--taglib/ogg/vorbis/vorbisfile.h8
-rw-r--r--taglib/riff/aiff/aifffile.cpp8
-rw-r--r--taglib/riff/aiff/aifffile.h8
-rw-r--r--taglib/riff/rifffile.cpp9
-rw-r--r--taglib/riff/rifffile.h1
-rw-r--r--taglib/riff/wav/wavfile.cpp8
-rw-r--r--taglib/riff/wav/wavfile.h8
-rw-r--r--taglib/trueaudio/trueaudiofile.cpp17
-rw-r--r--taglib/trueaudio/trueaudiofile.h18
-rw-r--r--taglib/wavpack/wavpackfile.cpp7
-rw-r--r--taglib/wavpack/wavpackfile.h8
28 files changed, 239 insertions, 0 deletions
diff --git a/taglib/ape/apefile.cpp b/taglib/ape/apefile.cpp
index 5d914756..2973a476 100644
--- a/taglib/ape/apefile.cpp
+++ b/taglib/ape/apefile.cpp
@@ -92,6 +92,13 @@ APE::File::File(FileName file, bool readProperties,
read(readProperties, propertiesStyle);
}
+APE::File::File(IOStream *stream, bool readProperties,
+ Properties::ReadStyle propertiesStyle) : TagLib::File(stream)
+{
+ d = new FilePrivate;
+ read(readProperties, propertiesStyle);
+}
+
APE::File::~File()
{
delete d;
diff --git a/taglib/ape/apefile.h b/taglib/ape/apefile.h
index a4bc80d9..2f22fdde 100644
--- a/taglib/ape/apefile.h
+++ b/taglib/ape/apefile.h
@@ -92,6 +92,14 @@ namespace TagLib {
Properties::ReadStyle propertiesStyle = Properties::Average);
/*!
+ * Contructs an WavPack file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored.
+ */
+ File(IOStream *stream, bool readProperties = true,
+ Properties::ReadStyle propertiesStyle = Properties::Average);
+
+ /*!
* Destroys this instance of the File.
*/
virtual ~File();
diff --git a/taglib/asf/asffile.cpp b/taglib/asf/asffile.cpp
index 734898d4..cb71b580 100644
--- a/taglib/asf/asffile.cpp
+++ b/taglib/asf/asffile.cpp
@@ -369,6 +369,13 @@ ASF::File::File(FileName file, bool readProperties, Properties::ReadStyle proper
read(readProperties, propertiesStyle);
}
+ASF::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle)
+ : TagLib::File(stream)
+{
+ d = new FilePrivate;
+ read(readProperties, propertiesStyle);
+}
+
ASF::File::~File()
{
for(unsigned int i = 0; i < d->objects.size(); i++) {
diff --git a/taglib/asf/asffile.h b/taglib/asf/asffile.h
index 45e603dc..f0acd728 100644
--- a/taglib/asf/asffile.h
+++ b/taglib/asf/asffile.h
@@ -58,6 +58,16 @@ namespace TagLib {
File(FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average);
/*!
+ * Contructs an ASF file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored.
+ *
+ * \note In the current implementation, both \a readProperties and
+ * \a propertiesStyle are ignored.
+ */
+ File(IOStream *stream, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average);
+
+ /*!
* Destroys this instance of the File.
*/
virtual ~File();
diff --git a/taglib/flac/flacfile.cpp b/taglib/flac/flacfile.cpp
index f882ae7b..058fa786 100644
--- a/taglib/flac/flacfile.cpp
+++ b/taglib/flac/flacfile.cpp
@@ -119,6 +119,15 @@ FLAC::File::File(FileName file, ID3v2::FrameFactory *frameFactory,
read(readProperties, propertiesStyle);
}
+FLAC::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
+ bool readProperties, Properties::ReadStyle propertiesStyle) :
+ TagLib::File(stream)
+{
+ d = new FilePrivate;
+ d->ID3v2FrameFactory = frameFactory;
+ read(readProperties, propertiesStyle);
+}
+
FLAC::File::~File()
{
delete d;
diff --git a/taglib/flac/flacfile.h b/taglib/flac/flacfile.h
index 64e67bc0..e9251fed 100644
--- a/taglib/flac/flacfile.h
+++ b/taglib/flac/flacfile.h
@@ -91,6 +91,19 @@ namespace TagLib {
Properties::ReadStyle propertiesStyle = Properties::Average);
/*!
+ * Contructs a FLAC file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored.
+ *
+ * If this file contains and ID3v2 tag the frames will be created using
+ * \a frameFactory.
+ */
+ // BIC: merge with the above constructor
+ File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
+ bool readProperties = true,
+ Properties::ReadStyle propertiesStyle = Properties::Average);
+
+ /*!
* Destroys this instance of the File.
*/
virtual ~File();
diff --git a/taglib/mp4/mp4file.cpp b/taglib/mp4/mp4file.cpp
index 2d59a8e5..d6ef4ebd 100644
--- a/taglib/mp4/mp4file.cpp
+++ b/taglib/mp4/mp4file.cpp
@@ -72,6 +72,13 @@ MP4::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle a
read(readProperties, audioPropertiesStyle);
}
+MP4::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle audioPropertiesStyle)
+ : TagLib::File(stream)
+{
+ d = new FilePrivate;
+ read(readProperties, audioPropertiesStyle);
+}
+
MP4::File::~File()
{
delete d;
diff --git a/taglib/mp4/mp4file.h b/taglib/mp4/mp4file.h
index 5c28d774..c3613f76 100644
--- a/taglib/mp4/mp4file.h
+++ b/taglib/mp4/mp4file.h
@@ -59,6 +59,16 @@ namespace TagLib {
File(FileName file, bool readProperties = true, Properties::ReadStyle audioPropertiesStyle = Properties::Average);
/*!
+ * Contructs a MP4 file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored.
+ *
+ * \note In the current implementation, both \a readProperties and
+ * \a propertiesStyle are ignored.
+ */
+ File(IOStream *stream, bool readProperties = true, Properties::ReadStyle audioPropertiesStyle = Properties::Average);
+
+ /*!
* Destroys this instance of the File.
*/
virtual ~File();
diff --git a/taglib/mpc/mpcfile.cpp b/taglib/mpc/mpcfile.cpp
index 9e9d6b88..216c1b3b 100644
--- a/taglib/mpc/mpcfile.cpp
+++ b/taglib/mpc/mpcfile.cpp
@@ -96,6 +96,13 @@ MPC::File::File(FileName file, bool readProperties,
read(readProperties, propertiesStyle);
}
+MPC::File::File(IOStream *stream, bool readProperties,
+ Properties::ReadStyle propertiesStyle) : TagLib::File(stream)
+{
+ d = new FilePrivate;
+ read(readProperties, propertiesStyle);
+}
+
MPC::File::~File()
{
delete d;
diff --git a/taglib/mpc/mpcfile.h b/taglib/mpc/mpcfile.h
index 6adc0ffb..93471cf1 100644
--- a/taglib/mpc/mpcfile.h
+++ b/taglib/mpc/mpcfile.h
@@ -89,6 +89,14 @@ namespace TagLib {
Properties::ReadStyle propertiesStyle = Properties::Average);
/*!
+ * Contructs an MPC file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored.
+ */
+ File(IOStream *stream, bool readProperties = true,
+ Properties::ReadStyle propertiesStyle = Properties::Average);
+
+ /*!
* Destroys this instance of the File.
*/
virtual ~File();
diff --git a/taglib/ogg/flac/oggflacfile.cpp b/taglib/ogg/flac/oggflacfile.cpp
index 22d7b81f..3addbffa 100644
--- a/taglib/ogg/flac/oggflacfile.cpp
+++ b/taglib/ogg/flac/oggflacfile.cpp
@@ -75,6 +75,13 @@ Ogg::FLAC::File::File(FileName file, bool readProperties,
read(readProperties, propertiesStyle);
}
+Ogg::FLAC::File::File(IOStream *stream, bool readProperties,
+ Properties::ReadStyle propertiesStyle) : Ogg::File(stream)
+{
+ d = new FilePrivate;
+ read(readProperties, propertiesStyle);
+}
+
Ogg::FLAC::File::~File()
{
delete d;
diff --git a/taglib/ogg/flac/oggflacfile.h b/taglib/ogg/flac/oggflacfile.h
index 5882a696..d4373795 100644
--- a/taglib/ogg/flac/oggflacfile.h
+++ b/taglib/ogg/flac/oggflacfile.h
@@ -72,6 +72,14 @@ namespace TagLib {
Properties::ReadStyle propertiesStyle = Properties::Average);
/*!
+ * Contructs an Ogg/FLAC file from \a file. If \a readProperties is true
+ * the file's audio properties will also be read using \a propertiesStyle.
+ * If false, \a propertiesStyle is ignored.
+ */
+ File(IOStream *stream, bool readProperties = true,
+ Properties::ReadStyle propertiesStyle = Properties::Average);
+
+ /*!
* Destroys this instance of the File.
*/
virtual ~File();
diff --git a/taglib/ogg/oggfile.cpp b/taglib/ogg/oggfile.cpp
index f29ba14a..01bb5c9d 100644
--- a/taglib/ogg/oggfile.cpp
+++ b/taglib/ogg/oggfile.cpp
@@ -213,6 +213,11 @@ Ogg::File::File(FileName file) : TagLib::File(file)
d = new FilePrivate;
}
+Ogg::File::File(IOStream *stream) : TagLib::File(stream)
+{
+ d = new FilePrivate;
+}
+
////////////////////////////////////////////////////////////////////////////////
// private members
////////////////////////////////////////////////////////////////////////////////
diff --git a/taglib/ogg/oggfile.h b/taglib/ogg/oggfile.h
index da1fcb69..1ecf2b9b 100644
--- a/taglib/ogg/oggfile.h
+++ b/taglib/ogg/oggfile.h
@@ -92,6 +92,17 @@ namespace TagLib {
*/
File(FileName file);
+ /*!
+ * Contructs an Ogg file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored.
+ *
+ * \note This constructor is protected since Ogg::File shouldn't be
+ * instantiated directly but rather should be used through the codec
+ * specific subclasses.
+ */
+ File(IOStream *stream);
+
private:
File(const File &);
File &operator=(const File &);
diff --git a/taglib/ogg/speex/speexfile.cpp b/taglib/ogg/speex/speexfile.cpp
index 604ac7c6..3a4940a2 100644
--- a/taglib/ogg/speex/speexfile.cpp
+++ b/taglib/ogg/speex/speexfile.cpp
@@ -65,6 +65,13 @@ Speex::File::File(FileName file, bool readProperties,
read(readProperties, propertiesStyle);
}
+Speex::File::File(IOStream *stream, bool readProperties,
+ Properties::ReadStyle propertiesStyle) : Ogg::File(stream)
+{
+ d = new FilePrivate;
+ read(readProperties, propertiesStyle);
+}
+
Speex::File::~File()
{
delete d;
diff --git a/taglib/ogg/speex/speexfile.h b/taglib/ogg/speex/speexfile.h
index 508b7aaa..c14cf2aa 100644
--- a/taglib/ogg/speex/speexfile.h
+++ b/taglib/ogg/speex/speexfile.h
@@ -64,6 +64,14 @@ namespace TagLib {
Properties::ReadStyle propertiesStyle = Properties::Average);
/*!
+ * Contructs a Speex file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored.
+ */
+ File(IOStream *stream, bool readProperties = true,
+ Properties::ReadStyle propertiesStyle = Properties::Average);
+
+ /*!
* Destroys this instance of the File.
*/
virtual ~File();
diff --git a/taglib/ogg/vorbis/vorbisfile.cpp b/taglib/ogg/vorbis/vorbisfile.cpp
index 1098ec38..60056f83 100644
--- a/taglib/ogg/vorbis/vorbisfile.cpp
+++ b/taglib/ogg/vorbis/vorbisfile.cpp
@@ -68,6 +68,13 @@ Vorbis::File::File(FileName file, bool readProperties,
read(readProperties, propertiesStyle);
}
+Vorbis::File::File(IOStream *stream, bool readProperties,
+ Properties::ReadStyle propertiesStyle) : Ogg::File(stream)
+{
+ d = new FilePrivate;
+ read(readProperties, propertiesStyle);
+}
+
Vorbis::File::~File()
{
delete d;
diff --git a/taglib/ogg/vorbis/vorbisfile.h b/taglib/ogg/vorbis/vorbisfile.h
index 3e33c113..299d9c2d 100644
--- a/taglib/ogg/vorbis/vorbisfile.h
+++ b/taglib/ogg/vorbis/vorbisfile.h
@@ -71,6 +71,14 @@ namespace TagLib {
Properties::ReadStyle propertiesStyle = Properties::Average);
/*!
+ * Contructs a Vorbis file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored.
+ */
+ File(IOStream *stream, bool readProperties = true,
+ Properties::ReadStyle propertiesStyle = Properties::Average);
+
+ /*!
* Destroys this instance of the File.
*/
virtual ~File();
diff --git a/taglib/riff/aiff/aifffile.cpp b/taglib/riff/aiff/aifffile.cpp
index 425bfa02..9f6be7ff 100644
--- a/taglib/riff/aiff/aifffile.cpp
+++ b/taglib/riff/aiff/aifffile.cpp
@@ -65,6 +65,14 @@ RIFF::AIFF::File::File(FileName file, bool readProperties,
read(readProperties, propertiesStyle);
}
+RIFF::AIFF::File::File(IOStream *stream, bool readProperties,
+ Properties::ReadStyle propertiesStyle) : RIFF::File(stream, BigEndian)
+{
+ d = new FilePrivate;
+ if(isOpen())
+ read(readProperties, propertiesStyle);
+}
+
RIFF::AIFF::File::~File()
{
delete d;
diff --git a/taglib/riff/aiff/aifffile.h b/taglib/riff/aiff/aifffile.h
index b9b0809f..cac42934 100644
--- a/taglib/riff/aiff/aifffile.h
+++ b/taglib/riff/aiff/aifffile.h
@@ -66,6 +66,14 @@ namespace TagLib {
Properties::ReadStyle propertiesStyle = Properties::Average);
/*!
+ * Contructs an AIFF file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored.
+ */
+ File(IOStream *stream, bool readProperties = true,
+ Properties::ReadStyle propertiesStyle = Properties::Average);
+
+ /*!
* Destroys this instance of the File.
*/
virtual ~File();
diff --git a/taglib/riff/rifffile.cpp b/taglib/riff/rifffile.cpp
index 8d23bcd6..984568d1 100644
--- a/taglib/riff/rifffile.cpp
+++ b/taglib/riff/rifffile.cpp
@@ -79,6 +79,15 @@ RIFF::File::File(FileName file, Endianness endianness) : TagLib::File(file)
read();
}
+RIFF::File::File(IOStream *stream, Endianness endianness) : TagLib::File(stream)
+{
+ d = new FilePrivate;
+ d->endianness = endianness;
+
+ if(isOpen())
+ read();
+}
+
TagLib::uint RIFF::File::riffSize() const
{
return d->size;
diff --git a/taglib/riff/rifffile.h b/taglib/riff/rifffile.h
index 99282564..e418dbb6 100644
--- a/taglib/riff/rifffile.h
+++ b/taglib/riff/rifffile.h
@@ -56,6 +56,7 @@ namespace TagLib {
enum Endianness { BigEndian, LittleEndian };
File(FileName file, Endianness endianness);
+ File(IOStream *stream, Endianness endianness);
/*!
* \return The size of the main RIFF chunk.
diff --git a/taglib/riff/wav/wavfile.cpp b/taglib/riff/wav/wavfile.cpp
index 9ec3b510..70d9a35c 100644
--- a/taglib/riff/wav/wavfile.cpp
+++ b/taglib/riff/wav/wavfile.cpp
@@ -65,6 +65,14 @@ RIFF::WAV::File::File(FileName file, bool readProperties,
read(readProperties, propertiesStyle);
}
+RIFF::WAV::File::File(IOStream *stream, bool readProperties,
+ Properties::ReadStyle propertiesStyle) : RIFF::File(stream, LittleEndian)
+{
+ d = new FilePrivate;
+ if(isOpen())
+ read(readProperties, propertiesStyle);
+}
+
RIFF::WAV::File::~File()
{
delete d;
diff --git a/taglib/riff/wav/wavfile.h b/taglib/riff/wav/wavfile.h
index b44668c3..341932b9 100644
--- a/taglib/riff/wav/wavfile.h
+++ b/taglib/riff/wav/wavfile.h
@@ -66,6 +66,14 @@ namespace TagLib {
Properties::ReadStyle propertiesStyle = Properties::Average);
/*!
+ * Contructs an WAV file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored.
+ */
+ File(IOStream *stream, bool readProperties = true,
+ Properties::ReadStyle propertiesStyle = Properties::Average);
+
+ /*!
* Destroys this instance of the File.
*/
virtual ~File();
diff --git a/taglib/trueaudio/trueaudiofile.cpp b/taglib/trueaudio/trueaudiofile.cpp
index 0f362da9..b584b7fd 100644
--- a/taglib/trueaudio/trueaudiofile.cpp
+++ b/taglib/trueaudio/trueaudiofile.cpp
@@ -99,6 +99,23 @@ TrueAudio::File::File(FileName file, ID3v2::FrameFactory *frameFactory,
read(readProperties, propertiesStyle);
}
+TrueAudio::File::File(IOStream *stream, bool readProperties,
+ Properties::ReadStyle propertiesStyle) : TagLib::File(stream)
+{
+ d = new FilePrivate;
+ if(isOpen())
+ read(readProperties, propertiesStyle);
+}
+
+TrueAudio::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
+ bool readProperties, Properties::ReadStyle propertiesStyle) :
+ TagLib::File(stream)
+{
+ d = new FilePrivate(frameFactory);
+ if(isOpen())
+ read(readProperties, propertiesStyle);
+}
+
TrueAudio::File::~File()
{
delete d;
diff --git a/taglib/trueaudio/trueaudiofile.h b/taglib/trueaudio/trueaudiofile.h
index 32cbf4b1..9c866233 100644
--- a/taglib/trueaudio/trueaudiofile.h
+++ b/taglib/trueaudio/trueaudiofile.h
@@ -97,6 +97,24 @@ namespace TagLib {
Properties::ReadStyle propertiesStyle = Properties::Average);
/*!
+ * Contructs an TrueAudio file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored.
+ */
+ File(IOStream *stream, bool readProperties = true,
+ Properties::ReadStyle propertiesStyle = Properties::Average);
+
+ /*!
+ * Contructs an TrueAudio file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored. The frames will be created using
+ * \a frameFactory.
+ */
+ File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
+ bool readProperties = true,
+ Properties::ReadStyle propertiesStyle = Properties::Average);
+
+ /*!
* Destroys this instance of the File.
*/
virtual ~File();
diff --git a/taglib/wavpack/wavpackfile.cpp b/taglib/wavpack/wavpackfile.cpp
index 999a5445..19e4c77d 100644
--- a/taglib/wavpack/wavpackfile.cpp
+++ b/taglib/wavpack/wavpackfile.cpp
@@ -88,6 +88,13 @@ WavPack::File::File(FileName file, bool readProperties,
read(readProperties, propertiesStyle);
}
+WavPack::File::File(IOStream *stream, bool readProperties,
+ Properties::ReadStyle propertiesStyle) : TagLib::File(stream)
+{
+ d = new FilePrivate;
+ read(readProperties, propertiesStyle);
+}
+
WavPack::File::~File()
{
delete d;
diff --git a/taglib/wavpack/wavpackfile.h b/taglib/wavpack/wavpackfile.h
index 3415a329..5173c136 100644
--- a/taglib/wavpack/wavpackfile.h
+++ b/taglib/wavpack/wavpackfile.h
@@ -88,6 +88,14 @@ namespace TagLib {
Properties::ReadStyle propertiesStyle = Properties::Average);
/*!
+ * Contructs an WavPack file from \a file. If \a readProperties is true the
+ * file's audio properties will also be read using \a propertiesStyle. If
+ * false, \a propertiesStyle is ignored.
+ */
+ File(IOStream *stream, bool readProperties = true,
+ Properties::ReadStyle propertiesStyle = Properties::Average);
+
+ /*!
* Destroys this instance of the File.
*/
virtual ~File();