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

Function ParseContainerPath

src/decoder/plugins/GmeDecoderPlugin.cxx:83–93  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

81 * and the track number (or 0 if no "tune_xxx" suffix is present).
82 */
83static GmeContainerPath
84ParseContainerPath(Path path_fs)
85{
86 const Path base = path_fs.GetBase();
87 unsigned track;
88 if (base.IsNull() ||
89 (track = ParseSubtuneName(NarrowPath(base))) < 1)
90 return { AllocatedPath(path_fs), 0 };
91
92 return { path_fs.GetDirectoryName(), track - 1 };
93}
94
95static AllocatedPath
96ReplaceSuffix(Path src,

Callers 3

gme_file_decodeFunction · 0.70
gme_scan_fileFunction · 0.70
gme_container_scanFunction · 0.70

Calls 3

GetDirectoryNameMethod · 0.80
ParseSubtuneNameFunction · 0.70
GetBaseMethod · 0.45

Tested by

no test coverage detected