Duplicate contructors of File subclasses to accept IOStream*

This commit is contained in:
Lukáš Lalinský
2011-04-11 23:31:44 +02:00
parent 8b59bb5957
commit 26c130c387
28 changed files with 239 additions and 0 deletions

View File

@ -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;

View File

@ -91,6 +91,14 @@ namespace TagLib {
File(FileName file, bool readProperties = true,
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.
*/

View File

@ -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++) {

View File

@ -57,6 +57,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.
*/

View File

@ -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;

View File

@ -90,6 +90,19 @@ namespace TagLib {
bool readProperties = true,
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.
*/

View File

@ -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;

View File

@ -58,6 +58,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.
*/

View File

@ -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;

View File

@ -88,6 +88,14 @@ namespace TagLib {
File(FileName file, bool readProperties = true,
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.
*/

View File

@ -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;

View File

@ -71,6 +71,14 @@ namespace TagLib {
File(FileName file, bool readProperties = true,
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.
*/

View File

@ -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
////////////////////////////////////////////////////////////////////////////////

View File

@ -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 &);

View File

@ -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;

View File

@ -63,6 +63,14 @@ namespace TagLib {
File(FileName file, bool readProperties = true,
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.
*/

View File

@ -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;

View File

@ -70,6 +70,14 @@ namespace TagLib {
File(FileName file, bool readProperties = true,
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.
*/

View File

@ -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;

View File

@ -65,6 +65,14 @@ namespace TagLib {
File(FileName file, bool readProperties = true,
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.
*/

View File

@ -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;

View File

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

View File

@ -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;

View File

@ -65,6 +65,14 @@ namespace TagLib {
File(FileName file, bool readProperties = true,
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.
*/

View File

@ -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;

View File

@ -96,6 +96,24 @@ namespace TagLib {
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.
*/
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.
*/

View File

@ -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;

View File

@ -87,6 +87,14 @@ namespace TagLib {
File(FileName file, bool readProperties = true,
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.
*/