// Remove all comments from the tag with the given description size_t id3::v2::removeComments(ID3_TagImpl& tag, String desc) { size_t numRemoved = 0; for (ID3_TagImpl::iterator iter = tag.begin(); iter != tag.end(); ++iter) { ID3_Frame* frame = *iter; if (frame == NULL) { continue; } if (frame->GetID() == ID3FID_COMMENT) { // See if the description we have matches the description of the // current comment. If so, remove the comment String tmpDesc = getString(frame, ID3FN_DESCRIPTION); if (tmpDesc == desc) { frame = tag.RemoveFrame(frame); delete frame; numRemoved++; } } } return numRemoved; }
size_t id3::v2::removeFrames(ID3_TagImpl& tag, ID3_FrameID id) { size_t numRemoved = 0; ID3_Frame* frame = NULL; while ((frame = tag.Find(id)) != NULL) { frame = tag.RemoveFrame(frame); delete frame; numRemoved++; } return numRemoved; }
size_t id3::v2::removeArtists(ID3_TagImpl& tag) { size_t numRemoved = 0; ID3_Frame* frame = NULL; while ((frame = hasArtist(tag)) != NULL) { frame = tag.RemoveFrame(frame); delete frame; numRemoved++; } return numRemoved; }