Rename the functions 'isValidStream' to 'isSupported'.

The name 'isValidStream' is a little misleading because it doesn't check if the stream is really valid. Additionally, 'isSupported' can be naturally overloaded.
This commit is contained in:
Tsuda Kageyu
2017-02-07 22:36:56 +09:00
parent d4d8410c08
commit f76b1e5429
29 changed files with 43 additions and 43 deletions

View File

@ -87,7 +87,7 @@ public:
// static members
////////////////////////////////////////////////////////////////////////////////
bool APE::File::isValidStream(IOStream *stream)
bool APE::File::isSupported(IOStream *stream)
{
// An APE file has an ID "MAC " somewhere. An ID3v2 tag may precede.

View File

@ -218,7 +218,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
File(const File &);

View File

@ -478,7 +478,7 @@ void ASF::File::FilePrivate::CodecListObject::parse(ASF::File *file, unsigned in
// static members
////////////////////////////////////////////////////////////////////////////////
bool ASF::File::isValidStream(IOStream *stream)
bool ASF::File::isSupported(IOStream *stream)
{
// An ASF file has to start with the designated GUID.

View File

@ -122,7 +122,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
void read();

View File

@ -146,36 +146,36 @@ namespace
{
File *file = 0;
if(MPEG::File::isValidStream(stream))
if(MPEG::File::isSupported(stream))
file = new MPEG::File(stream, ID3v2::FrameFactory::instance(), readAudioProperties, audioPropertiesStyle);
else if(Ogg::Vorbis::File::isValidStream(stream))
else if(Ogg::Vorbis::File::isSupported(stream))
file = new Ogg::Vorbis::File(stream, readAudioProperties, audioPropertiesStyle);
else if(Ogg::FLAC::File::isValidStream(stream))
else if(Ogg::FLAC::File::isSupported(stream))
file = new Ogg::FLAC::File(stream, readAudioProperties, audioPropertiesStyle);
else if(FLAC::File::isValidStream(stream))
else if(FLAC::File::isSupported(stream))
file = new FLAC::File(stream, ID3v2::FrameFactory::instance(), readAudioProperties, audioPropertiesStyle);
else if(MPC::File::isValidStream(stream))
else if(MPC::File::isSupported(stream))
file = new MPC::File(stream, readAudioProperties, audioPropertiesStyle);
else if(WavPack::File::isValidStream(stream))
else if(WavPack::File::isSupported(stream))
file = new WavPack::File(stream, readAudioProperties, audioPropertiesStyle);
else if(Ogg::Speex::File::isValidStream(stream))
else if(Ogg::Speex::File::isSupported(stream))
file = new Ogg::Speex::File(stream, readAudioProperties, audioPropertiesStyle);
else if(Ogg::Opus::File::isValidStream(stream))
else if(Ogg::Opus::File::isSupported(stream))
file = new Ogg::Opus::File(stream, readAudioProperties, audioPropertiesStyle);
else if(TrueAudio::File::isValidStream(stream))
else if(TrueAudio::File::isSupported(stream))
file = new TrueAudio::File(stream, readAudioProperties, audioPropertiesStyle);
else if(MP4::File::isValidStream(stream))
else if(MP4::File::isSupported(stream))
file = new MP4::File(stream, readAudioProperties, audioPropertiesStyle);
else if(ASF::File::isValidStream(stream))
else if(ASF::File::isSupported(stream))
file = new ASF::File(stream, readAudioProperties, audioPropertiesStyle);
else if(RIFF::AIFF::File::isValidStream(stream))
else if(RIFF::AIFF::File::isSupported(stream))
file = new RIFF::AIFF::File(stream, readAudioProperties, audioPropertiesStyle);
else if(RIFF::WAV::File::isValidStream(stream))
else if(RIFF::WAV::File::isSupported(stream))
file = new RIFF::WAV::File(stream, readAudioProperties, audioPropertiesStyle);
else if(APE::File::isValidStream(stream))
else if(APE::File::isSupported(stream))
file = new APE::File(stream, readAudioProperties, audioPropertiesStyle);
// isValidStream() only does a quick check, so double check the file here.
// isSupported() only does a quick check, so double check the file here.
if(file) {
if(file->isValid())

View File

@ -99,7 +99,7 @@ public:
// static members
////////////////////////////////////////////////////////////////////////////////
bool FLAC::File::isValidStream(IOStream *stream)
bool FLAC::File::isSupported(IOStream *stream)
{
// A FLAC file has an ID "fLaC" somewhere. An ID3v2 tag may precede.

View File

@ -325,7 +325,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
File(const File &);

View File

@ -75,7 +75,7 @@ public:
// static members
////////////////////////////////////////////////////////////////////////////////
bool MP4::File::isValidStream(IOStream *stream)
bool MP4::File::isSupported(IOStream *stream)
{
// An MP4 file has to have an "ftyp" box first.

View File

@ -127,7 +127,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
void read(bool readProperties);

View File

@ -79,7 +79,7 @@ public:
// static members
////////////////////////////////////////////////////////////////////////////////
bool MPC::File::isValidStream(IOStream *stream)
bool MPC::File::isSupported(IOStream *stream)
{
// A newer MPC file has to start with "MPCK" or "MP+", but older files don't
// have keys to do a quick check.

View File

@ -221,7 +221,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
File(const File &);

View File

@ -95,7 +95,7 @@ namespace
};
}
bool MPEG::File::isValidStream(IOStream *stream)
bool MPEG::File::isSupported(IOStream *stream)
{
if(!stream || !stream->isOpen())
return false;

View File

@ -377,7 +377,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
File(const File &);

View File

@ -70,7 +70,7 @@ public:
// static members
////////////////////////////////////////////////////////////////////////////////
bool Ogg::FLAC::File::isValidStream(IOStream *stream)
bool Ogg::FLAC::File::isSupported(IOStream *stream)
{
// An Ogg FLAC file has IDs "OggS" and "fLaC" somewhere.

View File

@ -149,7 +149,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
File(const File &);

View File

@ -58,7 +58,7 @@ public:
// static members
////////////////////////////////////////////////////////////////////////////////
bool Ogg::Opus::File::isValidStream(IOStream *stream)
bool Ogg::Opus::File::isSupported(IOStream *stream)
{
// An Opus file has IDs "OggS" and "OpusHead" somewhere.

View File

@ -120,7 +120,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
File(const File &);

View File

@ -58,7 +58,7 @@ public:
// static members
////////////////////////////////////////////////////////////////////////////////
bool Ogg::Speex::File::isValidStream(IOStream *stream)
bool Ogg::Speex::File::isSupported(IOStream *stream)
{
// A Speex file has IDs "OggS" and "Speex " somewhere.

View File

@ -120,7 +120,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
File(const File &);

View File

@ -63,7 +63,7 @@ namespace TagLib {
// static members
////////////////////////////////////////////////////////////////////////////////
bool Vorbis::File::isValidStream(IOStream *stream)
bool Vorbis::File::isSupported(IOStream *stream)
{
// An Ogg Vorbis file has IDs "OggS" and "\x01vorbis" somewhere.

View File

@ -127,7 +127,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
File(const File &);

View File

@ -58,7 +58,7 @@ public:
// static members
////////////////////////////////////////////////////////////////////////////////
bool RIFF::AIFF::File::isValidStream(IOStream *stream)
bool RIFF::AIFF::File::isSupported(IOStream *stream)
{
// An AIFF file has to start with "FORM????AIFF" or "FORM????AIFC".

View File

@ -132,7 +132,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
File(const File &);

View File

@ -65,7 +65,7 @@ public:
// static members
////////////////////////////////////////////////////////////////////////////////
bool RIFF::WAV::File::isValidStream(IOStream *stream)
bool RIFF::WAV::File::isSupported(IOStream *stream)
{
// A WAV file has to start with "RIFF????WAVE".

View File

@ -182,7 +182,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
File(const File &);

View File

@ -77,7 +77,7 @@ public:
// static members
////////////////////////////////////////////////////////////////////////////////
bool TrueAudio::File::isValidStream(IOStream *stream)
bool TrueAudio::File::isSupported(IOStream *stream)
{
// A TrueAudio file has to start with "TTA". An ID3v2 tag may precede.

View File

@ -242,7 +242,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
File(const File &);

View File

@ -75,7 +75,7 @@ public:
// static members
////////////////////////////////////////////////////////////////////////////////
bool WavPack::File::isValidStream(IOStream *stream)
bool WavPack::File::isSupported(IOStream *stream)
{
// A WavPack file has to start with "wvpk".

View File

@ -206,7 +206,7 @@ namespace TagLib {
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
static bool isValidStream(IOStream *stream);
static bool isSupported(IOStream *stream);
private:
File(const File &);