MCPcopy Create free account
hub / github.com/KDE/kid3 / languageCodeByteVector

Function languageCodeByteVector

src/plugins/taglibmetadata/taglibmpegsupport.cpp:1392–1402  ·  view source on GitHub ↗

* Convert a string to a language code byte vector. * * @param str string containing language code. * * @return 3 byte vector with language code. */

Source from the content-addressed store, hash-verified

1390 * @return 3 byte vector with language code.
1391 */
1392TagLib::ByteVector languageCodeByteVector(QString str)
1393{
1394 if (uint len = str.length(); len > 3) {
1395 str.truncate(3);
1396 } else if (len < 3) {
1397 for (uint i = len; i < 3; ++i) {
1398 str += QLatin1Char(' ');
1399 }
1400 }
1401 return TagLib::ByteVector(str.toLatin1().data(), str.length());
1402}
1403
1404/**
1405 * The following template functions are used to uniformly set fields

Callers 1

setLanguageFunction · 0.85

Calls 3

truncateMethod · 0.80
lengthMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected