From 018e969026d92d341036ff8a81185316e4943a7e Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Tue, 4 Aug 2015 15:47:18 +0900 Subject: [PATCH] Add warnings about calling File::save() repeatedly. --- taglib/ape/apefile.h | 3 +++ taglib/asf/asffile.h | 3 +++ taglib/flac/flacfile.h | 3 +++ taglib/mp4/mp4file.h | 3 +++ taglib/mpc/mpcfile.h | 5 +++++ taglib/mpeg/mpegfile.h | 15 +++++++++++++++ taglib/ogg/flac/oggflacfile.h | 3 +++ taglib/ogg/opus/opusfile.h | 8 ++++++++ taglib/ogg/speex/speexfile.h | 10 ++++++++-- taglib/ogg/vorbis/vorbisfile.h | 8 ++++++++ taglib/wavpack/wavpackfile.h | 5 +++++ 11 files changed, 64 insertions(+), 2 deletions(-) diff --git a/taglib/ape/apefile.h b/taglib/ape/apefile.h index 1a64f8b5..1d2e5c67 100644 --- a/taglib/ape/apefile.h +++ b/taglib/ape/apefile.h @@ -146,6 +146,9 @@ namespace TagLib { * * \note According to the official Monkey's Audio SDK, an APE file * can only have either ID3V1 or APE tags, so a parameter is used here. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. At worst it will corrupt the file. */ virtual bool save(); diff --git a/taglib/asf/asffile.h b/taglib/asf/asffile.h index b674da79..f1ae431f 100644 --- a/taglib/asf/asffile.h +++ b/taglib/asf/asffile.h @@ -112,6 +112,9 @@ namespace TagLib { * Save the file. * * This returns true if the save was successful. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. At worst it will corrupt the file. */ virtual bool save(); diff --git a/taglib/flac/flacfile.h b/taglib/flac/flacfile.h index dc0a9601..1c055d33 100644 --- a/taglib/flac/flacfile.h +++ b/taglib/flac/flacfile.h @@ -155,6 +155,9 @@ namespace TagLib { * has no XiphComment, one will be constructed from the ID3-tags. * * This returns true if the save was successful. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. At worst it will corrupt the file. */ virtual bool save(); diff --git a/taglib/mp4/mp4file.h b/taglib/mp4/mp4file.h index 28880f84..791a0192 100644 --- a/taglib/mp4/mp4file.h +++ b/taglib/mp4/mp4file.h @@ -111,6 +111,9 @@ namespace TagLib { * Save the file. * * This returns true if the save was successful. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. At worst it will corrupt the file. */ bool save(); diff --git a/taglib/mpc/mpcfile.h b/taglib/mpc/mpcfile.h index df5d4356..0980a5cd 100644 --- a/taglib/mpc/mpcfile.h +++ b/taglib/mpc/mpcfile.h @@ -139,6 +139,11 @@ namespace TagLib { /*! * Saves the file. + * + * This returns true if the save was successful. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. At worst it will corrupt the file. */ virtual bool save(); diff --git a/taglib/mpeg/mpegfile.h b/taglib/mpeg/mpegfile.h index 17908073..858a6a5c 100644 --- a/taglib/mpeg/mpegfile.h +++ b/taglib/mpeg/mpegfile.h @@ -175,6 +175,9 @@ namespace TagLib { * If you would like more granular control over the content of the tags, * with the concession of generality, use parameterized save call below. * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. At worst it will corrupt the file. + * * \see save(int tags) */ virtual bool save(); @@ -187,6 +190,9 @@ namespace TagLib { * This strips all tags not included in the mask, but does not modify them * in memory, so later calls to save() which make use of these tags will * remain valid. This also strips empty tags. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. At worst it will corrupt the file. */ bool save(int tags); @@ -198,6 +204,9 @@ namespace TagLib { * If \a stripOthers is true this strips all tags not included in the mask, * but does not modify them in memory, so later calls to save() which make * use of these tags will remain valid. This also strips empty tags. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. At worst it will corrupt the file. */ // BIC: combine with the above method bool save(int tags, bool stripOthers); @@ -213,6 +222,9 @@ namespace TagLib { * * The \a id3v2Version parameter specifies the version of the saved * ID3v2 tag. It can be either 4 or 3. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. At worst it will corrupt the file. */ // BIC: combine with the above method bool save(int tags, bool stripOthers, int id3v2Version); @@ -231,6 +243,9 @@ namespace TagLib { * * If \a duplicateTags is true and at least one tag -- ID3v1 or ID3v2 -- * exists this will duplicate its content into the other tag. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. At worst it will corrupt the file. */ // BIC: combine with the above method bool save(int tags, bool stripOthers, int id3v2Version, bool duplicateTags); diff --git a/taglib/ogg/flac/oggflacfile.h b/taglib/ogg/flac/oggflacfile.h index 05762f9b..28b3f67f 100644 --- a/taglib/ogg/flac/oggflacfile.h +++ b/taglib/ogg/flac/oggflacfile.h @@ -127,6 +127,9 @@ namespace TagLib { /*! * Save the file. This will primarily save and update the XiphComment. * Returns true if the save is successful. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. It leads to a segfault. */ virtual bool save(); diff --git a/taglib/ogg/opus/opusfile.h b/taglib/ogg/opus/opusfile.h index 2b86f3f3..0363b584 100644 --- a/taglib/ogg/opus/opusfile.h +++ b/taglib/ogg/opus/opusfile.h @@ -106,6 +106,14 @@ namespace TagLib { */ virtual Properties *audioProperties() const; + /*! + * Save the file. + * + * This returns true if the save was successful. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. It leads to a segfault. + */ virtual bool save(); private: diff --git a/taglib/ogg/speex/speexfile.h b/taglib/ogg/speex/speexfile.h index cc4ae240..de38bfbf 100644 --- a/taglib/ogg/speex/speexfile.h +++ b/taglib/ogg/speex/speexfile.h @@ -106,8 +106,14 @@ namespace TagLib { */ virtual Properties *audioProperties() const; - - + /*! + * Save the file. + * + * This returns true if the save was successful. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. It leads to a segfault. + */ virtual bool save(); private: diff --git a/taglib/ogg/vorbis/vorbisfile.h b/taglib/ogg/vorbis/vorbisfile.h index 9603ee9a..48d9d7ca 100644 --- a/taglib/ogg/vorbis/vorbisfile.h +++ b/taglib/ogg/vorbis/vorbisfile.h @@ -114,6 +114,14 @@ namespace TagLib { */ virtual Properties *audioProperties() const; + /*! + * Save the file. + * + * This returns true if the save was successful. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. It leads to a segfault. + */ virtual bool save(); private: diff --git a/taglib/wavpack/wavpackfile.h b/taglib/wavpack/wavpackfile.h index 2e51bd1d..24511581 100644 --- a/taglib/wavpack/wavpackfile.h +++ b/taglib/wavpack/wavpackfile.h @@ -133,6 +133,11 @@ namespace TagLib { /*! * Saves the file. + * + * This returns true if the save was successful. + * + * \warning In the current implementation, it's dangerous to call save() + * repeatedly. At worst it will corrupt the file. */ virtual bool save();