| 432 | } |
| 433 | |
| 434 | [[gnu::pure]] |
| 435 | static AllocatedString |
| 436 | GetDateString(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 | |
| 458 | static void |
| 459 | ScanSidTuneInfo(const SidTuneInfo &info, unsigned track, unsigned n_tracks, |
no test coverage detected