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

Function ParseContainerPath

src/decoder/plugins/SidplayDecoderPlugin.cxx:164–174  ·  view source on GitHub ↗

* returns the file path stripped of any /tune_xxx.* subtune suffix * and the track number (or 1 if no "tune_xxx" suffix is present). */

Source from the content-addressed store, hash-verified

162 * and the track number (or 1 if no "tune_xxx" suffix is present).
163 */
164[[gnu::pure]]
165static SidplayContainerPath
166ParseContainerPath(Path path_fs) noexcept
167{
168 const NarrowPath base = NarrowPath(path_fs.GetBase());
169 unsigned track;
170 if (!base || (track = ParseSubtuneName(base)) < 1)
171 return { AllocatedPath(path_fs), 1 };
172
173 return { path_fs.GetDirectoryName(), track };
174}
175
176[[gnu::pure]]
177static SignedSongTime

Callers 2

sidplay_file_decodeFunction · 0.70
sidplay_scan_fileFunction · 0.70

Calls 3

GetDirectoryNameMethod · 0.80
ParseSubtuneNameFunction · 0.70
GetBaseMethod · 0.45

Tested by

no test coverage detected