ID3_Frame* ID3_AddYear(ID3_Tag *tag, const char *text, bool bReplace) { ID3_Frame* pFrame = NULL; if (NULL != tag && NULL != text && strlen(text) > 0) { if (bReplace) { ID3_RemoveYears(tag); } if (bReplace || tag->Find(ID3FID_YEAR) == NULL) { pFrame = new ID3_Frame(ID3FID_YEAR); if (NULL != pFrame) { pFrame->Field(ID3FN_TEXT) = text; tag->AttachFrame(pFrame); } } } return pFrame; }
ID3_Frame* ID3_AddYear(ID3_Tag *tag, const char *text, bool replace) { ID3_Frame* frame = NULL; if (NULL != tag && NULL != text && strlen(text) > 0) { if (replace) { ID3_RemoveYears(tag); } if (replace || tag->Find(ID3FID_YEAR) == NULL) { frame = new ID3_Frame(ID3FID_YEAR); if (NULL != frame) { frame->GetField(ID3FN_TEXT)->Set(text); tag->AttachFrame(frame); } } } return frame; }