taglib: Remove unused methods

This commit is contained in:
Jonas Kvinge
2021-02-13 00:31:54 +01:00
parent 4285f43316
commit 295db43bca
4 changed files with 4 additions and 82 deletions

View File

@@ -75,10 +75,6 @@ bool isValidFrameID(const ByteVector &frameID) {
// static methods // static methods
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
unsigned int Frame::headerSize() {
return Header::size();
}
unsigned int Frame::headerSize(unsigned int version) { unsigned int Frame::headerSize(unsigned int version) {
return Header::size(version); return Header::size(version);
} }
@@ -271,12 +267,7 @@ String Frame::readStringField(const ByteVector &data, String::Type encoding, siz
} }
String::Type Frame::checkEncoding(const StringList &fields, String::Type encoding) { // static String::Type Frame::checkEncoding(const StringList &fields, String::Type encoding, unsigned int version) const {
return checkEncoding(fields, encoding, 4);
}
String::Type Frame::checkEncoding(const StringList &fields, String::Type encoding, unsigned int version) { // static
if ((encoding == String::UTF8 || encoding == String::UTF16BE) && version != 4) if ((encoding == String::UTF8 || encoding == String::UTF16BE) && version != 4)
return String::UTF16; return String::UTF16;
@@ -507,10 +498,6 @@ class Frame::Header::HeaderPrivate {
// static members (Frame::Header) // static members (Frame::Header)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
unsigned int Frame::Header::size() {
return size(4);
}
unsigned int Frame::Header::size(unsigned int version) { unsigned int Frame::Header::size(unsigned int version) {
switch (version) { switch (version) {
case 0: case 0:

View File

@@ -79,15 +79,6 @@ class TAGLIB_EXPORT Frame {
*/ */
unsigned int size() const; unsigned int size() const;
/*!
* Returns the size of the frame header
*
* \deprecated This is only accurate for ID3v2.3 or ID3v2.4.
* Please use the call below which accepts an ID3v2 version number.
* In the next non-binary compatible release this will be made into a non-static member that checks the internal ID3v2 version.
*/
unsigned int headerSize();
/*! /*!
* Returns the size of the frame header for the given ID3v2 version. * Returns the size of the frame header for the given ID3v2 version.
* *
@@ -210,18 +201,11 @@ class TAGLIB_EXPORT Frame {
*/ */
String readStringField(const ByteVector &data, String::Type encoding, size_t &position); String readStringField(const ByteVector &data, String::Type encoding, size_t &position);
/*!
* Checks a the list of string values to see if they can be used with the specified encoding and returns the recommended encoding.
*/
// BIC: remove and make non-static
static String::Type checkEncoding(const StringList &fields, String::Type encoding);
/*! /*!
* Checks a the list of string values to see if they can be used with the specified encoding and returns the recommended encoding. * Checks a the list of string values to see if they can be used with the specified encoding and returns the recommended encoding.
* This method also checks the ID3v2 version and makes sure the encoding can be used in the specified version. * This method also checks the ID3v2 version and makes sure the encoding can be used in the specified version.
*/ */
// BIC: remove and make non-static String::Type checkEncoding(const StringList &fields, String::Type encoding, unsigned int version) const;
static String::Type checkEncoding(const StringList &fields, String::Type encoding, unsigned int version);
/*! /*!
* Checks a the list of string values to see if they can be used with the specified encoding and returns the recommended encoding. * Checks a the list of string values to see if they can be used with the specified encoding and returns the recommended encoding.
@@ -355,25 +339,12 @@ class TAGLIB_EXPORT Frame::Header {
*/ */
void setVersion(unsigned int version); void setVersion(unsigned int version);
/*!
* Returns the size of the frame header in bytes.
*
* \deprecated Please use the version of this method that accepts a
* version. This is only accurate for ID3v2.3 and ID3v2.4. This will be
* removed in the next binary incompatible release (2.0) and will be
* replaced with a non-static method that checks the frame version.
*/
// BIC: make non-static
static unsigned int size();
/*! /*!
* Returns the size of the frame header in bytes for the ID3v2 version * Returns the size of the frame header in bytes for the ID3v2 version
* that's given. * that's given.
*
* \deprecated Please see the explanation in the version above.
*/ */
// BIC: remove // BIC: remove
static unsigned int size(unsigned int version); static unsigned int size(unsigned int version = 4);
/*! /*!
* Returns true if the flag for tag alter preservation is set. * Returns true if the flag for tag alter preservation is set.

View File

@@ -131,12 +131,6 @@ bool MPEG::File::isSupported(IOStream *stream) {
// public members // public members
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
MPEG::File::File(FileName fileName, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(fileName), d(new FilePrivate()) {
if (isOpen())
read(readProperties);
}
MPEG::File::File(FileName fileName, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(fileName), d(new FilePrivate(frameFactory)) { MPEG::File::File(FileName fileName, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(fileName), d(new FilePrivate(frameFactory)) {
@@ -300,10 +294,6 @@ APE::Tag *MPEG::File::APETag(bool create) {
return d->tag.access<APE::Tag>(APEIndex, create); return d->tag.access<APE::Tag>(APEIndex, create);
} }
bool MPEG::File::strip(int tags) {
return strip(tags, true);
}
bool MPEG::File::strip(int tags, bool freeMemory) { bool MPEG::File::strip(int tags, bool freeMemory) {
if (readOnly()) { if (readOnly()) {

View File

@@ -78,17 +78,6 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
AllTags = 0xffff AllTags = 0xffff
}; };
/*!
* Constructs an MPEG file from \a file. If \a readProperties is true the
* file's audio properties will also be read.
*
* \note In the current implementation, \a propertiesStyle is ignored.
*
* \deprecated This constructor will be dropped in favor of the one below
* in a future version.
*/
explicit File(FileName file, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
/*! /*!
* Constructs an MPEG file from \a file. * Constructs an MPEG file from \a file.
* If \a readProperties is true the file's audio properties will also be read. * If \a readProperties is true the file's audio properties will also be read.
@@ -98,7 +87,6 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
* *
* \note In the current implementation, \a propertiesStyle is ignored. * \note In the current implementation, \a propertiesStyle is ignored.
*/ */
// BIC: merge with the above constructor
explicit File(FileName fileName, ID3v2::FrameFactory *frameFactory, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); explicit File(FileName fileName, ID3v2::FrameFactory *frameFactory, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
/*! /*!
@@ -230,19 +218,6 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
*/ */
APE::Tag *APETag(bool create = false); APE::Tag *APETag(bool create = false);
/*!
* This will strip the tags that match the OR-ed together TagTypes from the file.
* By default it strips all tags.
* It returns true if the tags are successfully stripped.
*
* This is equivalent to strip(tags, true)
*
* \note This will also invalidate pointers to the ID3 and APE tags as their memory will be freed.
*
* \note This will update the file immediately.
*/
bool strip(int tags = AllTags);
/*! /*!
* This will strip the tags that match the OR-ed together TagTypes from the file. * This will strip the tags that match the OR-ed together TagTypes from the file.
* By default it strips all tags. It returns true if the tags are successfully stripped. * By default it strips all tags. It returns true if the tags are successfully stripped.
@@ -251,8 +226,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
* *
* \note This will update the file immediately. * \note This will update the file immediately.
*/ */
// BIC: merge with the method above bool strip(int tags = AllTags, bool freeMemory = true);
bool strip(int tags, bool freeMemory);
/*! /*!
* Returns the position in the file of the first MPEG frame. * Returns the position in the file of the first MPEG frame.