diff --git a/id3/id3v2frame.cpp b/id3/id3v2frame.cpp index 255474b..31d15ab 100644 --- a/id3/id3v2frame.cpp +++ b/id3/id3v2frame.cpp @@ -969,70 +969,6 @@ void Id3v2Frame::parseComment(const char *buffer, std::size_t dataSize, TagValue tagValue.assignData(get<0>(substr), get<1>(substr), TagDataType::Text, dataEncoding); } -/*! - * \brief Writes an encoding denoation and the specified string \a value to a \a buffer. - * \param buffer Specifies the buffer. - * \param bufferSize Specifies the size of \a buffer. - * \param value Specifies the string to make. - * \param encoding Specifies the encoding of the string to make. - * \deprecated No longer used. - * \todo Remove in v9. - */ -void Id3v2Frame::makeString(std::unique_ptr &buffer, std::uint32_t &bufferSize, const std::string &value, TagTextEncoding encoding) -{ - makeEncodingAndData(buffer, bufferSize, encoding, value.data(), value.size()); -} - -/*! - * \brief Writes an encoding denoation and the specified \a data to a \a buffer. - * \param buffer Specifies the buffer. - * \param bufferSize Specifies the size of \a buffer. - * \param encoding Specifies the data encoding. - * \param data Specifies the data. - * \param dataSize Specifies size of \a data. - * \deprecated No longer used. - * \todo Remove in v9. - */ -void Id3v2Frame::makeEncodingAndData( - std::unique_ptr &buffer, std::uint32_t &bufferSize, TagTextEncoding encoding, const char *data, std::size_t dataSize) -{ - // calculate buffer size and allocate buffer - if (!data) { - dataSize = 0; - } - if (dataSize > numeric_limits::max() - 5) { - throw InvalidDataException(); - } - char *bufferDataAddress; - switch (encoding) { - case TagTextEncoding::Latin1: - case TagTextEncoding::Utf8: - case TagTextEncoding::Unspecified: // assumption - // allocate buffer - buffer = make_unique(bufferSize = static_cast(1 + dataSize + 1)); - buffer[0] = static_cast(makeTextEncodingByte(encoding)); // set text encoding byte - bufferDataAddress = buffer.get() + 1; - break; - case TagTextEncoding::Utf16LittleEndian: - case TagTextEncoding::Utf16BigEndian: - // allocate buffer - buffer = make_unique(bufferSize = static_cast(1 + 2 + dataSize + 2)); - buffer[0] = static_cast(makeTextEncodingByte(encoding)); // set text encoding byte - CppUtilities::LE::getBytes( - encoding == TagTextEncoding::Utf16LittleEndian ? static_cast(0xFEFF) : static_cast(0xFFFE), - buffer.get() + 1); - bufferDataAddress = buffer.get() + 3; - break; - default: - return; - } - - // write string data - if (dataSize) { - copy(data, data + dataSize, bufferDataAddress); - } -} - /*! * \brief Writes the BOM for the specified \a encoding to the specified \a buffer. * \returns Returns the number of bytes written to the buffer. diff --git a/id3/id3v2frame.h b/id3/id3v2frame.h index beacd6a..d7546ce 100644 --- a/id3/id3v2frame.h +++ b/id3/id3v2frame.h @@ -133,9 +133,6 @@ public: // making helper static std::uint8_t makeTextEncodingByte(TagTextEncoding textEncoding); static std::size_t makeBom(char *buffer, TagTextEncoding encoding); - static void makeString(std::unique_ptr &buffer, std::uint32_t &bufferSize, const std::string &value, TagTextEncoding encoding); - static void makeEncodingAndData( - std::unique_ptr &buffer, std::uint32_t &bufferSize, TagTextEncoding encoding, const char *data, std::size_t m_dataSize); static void makeLegacyPicture( std::unique_ptr &buffer, std::uint32_t &bufferSize, const TagValue &picture, std::uint8_t typeInfo, Diagnostics &diag); static void makePicture(std::unique_ptr &buffer, std::uint32_t &bufferSize, const TagValue &picture, std::uint8_t typeInfo,