Remove deprecated functions of Id3v2Frame
This commit is contained in:
parent
df9d869911
commit
0af4044a50
|
@ -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);
|
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<char[]> &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<char[]> &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<std::uint32_t>::max() - 5) {
|
|
||||||
throw InvalidDataException();
|
|
||||||
}
|
|
||||||
char *bufferDataAddress;
|
|
||||||
switch (encoding) {
|
|
||||||
case TagTextEncoding::Latin1:
|
|
||||||
case TagTextEncoding::Utf8:
|
|
||||||
case TagTextEncoding::Unspecified: // assumption
|
|
||||||
// allocate buffer
|
|
||||||
buffer = make_unique<char[]>(bufferSize = static_cast<std::uint32_t>(1 + dataSize + 1));
|
|
||||||
buffer[0] = static_cast<char>(makeTextEncodingByte(encoding)); // set text encoding byte
|
|
||||||
bufferDataAddress = buffer.get() + 1;
|
|
||||||
break;
|
|
||||||
case TagTextEncoding::Utf16LittleEndian:
|
|
||||||
case TagTextEncoding::Utf16BigEndian:
|
|
||||||
// allocate buffer
|
|
||||||
buffer = make_unique<char[]>(bufferSize = static_cast<std::uint32_t>(1 + 2 + dataSize + 2));
|
|
||||||
buffer[0] = static_cast<char>(makeTextEncodingByte(encoding)); // set text encoding byte
|
|
||||||
CppUtilities::LE::getBytes(
|
|
||||||
encoding == TagTextEncoding::Utf16LittleEndian ? static_cast<std::uint16_t>(0xFEFF) : static_cast<std::uint16_t>(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.
|
* \brief Writes the BOM for the specified \a encoding to the specified \a buffer.
|
||||||
* \returns Returns the number of bytes written to the buffer.
|
* \returns Returns the number of bytes written to the buffer.
|
||||||
|
|
|
@ -133,9 +133,6 @@ public:
|
||||||
// making helper
|
// making helper
|
||||||
static std::uint8_t makeTextEncodingByte(TagTextEncoding textEncoding);
|
static std::uint8_t makeTextEncodingByte(TagTextEncoding textEncoding);
|
||||||
static std::size_t makeBom(char *buffer, TagTextEncoding encoding);
|
static std::size_t makeBom(char *buffer, TagTextEncoding encoding);
|
||||||
static void makeString(std::unique_ptr<char[]> &buffer, std::uint32_t &bufferSize, const std::string &value, TagTextEncoding encoding);
|
|
||||||
static void makeEncodingAndData(
|
|
||||||
std::unique_ptr<char[]> &buffer, std::uint32_t &bufferSize, TagTextEncoding encoding, const char *data, std::size_t m_dataSize);
|
|
||||||
static void makeLegacyPicture(
|
static void makeLegacyPicture(
|
||||||
std::unique_ptr<char[]> &buffer, std::uint32_t &bufferSize, const TagValue &picture, std::uint8_t typeInfo, Diagnostics &diag);
|
std::unique_ptr<char[]> &buffer, std::uint32_t &bufferSize, const TagValue &picture, std::uint8_t typeInfo, Diagnostics &diag);
|
||||||
static void makePicture(std::unique_ptr<char[]> &buffer, std::uint32_t &bufferSize, const TagValue &picture, std::uint8_t typeInfo,
|
static void makePicture(std::unique_ptr<char[]> &buffer, std::uint32_t &bufferSize, const TagValue &picture, std::uint8_t typeInfo,
|
||||||
|
|
Loading…
Reference in New Issue