MCPcopy Create free account
hub / github.com/MusicPlayerDaemon/MPD / GetDateString

Function GetDateString

src/decoder/plugins/SidplayDecoderPlugin.cxx:434–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434[[gnu::pure]]
435static AllocatedString
436GetDateString(const SidTuneInfo &info) noexcept
437{
438 /*
439 * Field 2 is called <released>, previously used as <copyright>.
440 * It is formatted <year><space><company or author or group>,
441 * where <year> may be <YYYY>, <YYY?>, <YY??> or <YYYY-YY>, for
442 * example "1987", "199?", "19??" or "1985-87". The <company or
443 * author or group> may be for example Rob Hubbard. A full field
444 * may be for example "1987 Rob Hubbard".
445 */
446 AllocatedString release = GetInfoString(info, 2);
447
448 /* Keep the <year> part only for the date. */
449 for (size_t i = 0; release[i] != AllocatedString::SENTINEL; i++)
450 if (std::isspace(release[i])) {
451 release[i] = AllocatedString::SENTINEL;
452 break;
453 }
454
455 return release;
456}
457
458static void
459ScanSidTuneInfo(const SidTuneInfo &info, unsigned track, unsigned n_tracks,

Callers 1

ScanSidTuneInfoFunction · 0.85

Calls 1

GetInfoStringFunction · 0.85

Tested by

no test coverage detected