decoder/Plugin: container_scan() returns AllocatedString
This commit is contained in:
@@ -26,6 +26,7 @@ struct ConfigBlock;
|
||||
class InputStream;
|
||||
struct TagHandler;
|
||||
class Path;
|
||||
template<typename T> class AllocatedString;
|
||||
|
||||
/**
|
||||
* Opaque handle which the decoder plugin passes to the functions in
|
||||
@@ -95,10 +96,8 @@ struct DecoderPlugin {
|
||||
* @return nullptr if there are no multiple files
|
||||
* a filename for every single track according to tnum (param 2)
|
||||
* do not include full pathname here, just the "virtual" file
|
||||
*
|
||||
* Free the return value with delete[].
|
||||
*/
|
||||
char* (*container_scan)(Path path_fs, const unsigned int tnum);
|
||||
AllocatedString<char> (*container_scan)(Path path_fs, unsigned tnum);
|
||||
|
||||
/* last element in these arrays must always be a nullptr: */
|
||||
const char *const*suffixes;
|
||||
|
@@ -103,7 +103,7 @@ ParseContainerPath(Path path_fs)
|
||||
return { path_fs.GetDirectoryName(), track - 1 };
|
||||
}
|
||||
|
||||
static char *
|
||||
static AllocatedString<>
|
||||
gme_container_scan(Path path_fs, const unsigned int tnum)
|
||||
{
|
||||
Music_Emu *emu;
|
||||
@@ -123,7 +123,7 @@ gme_container_scan(Path path_fs, const unsigned int tnum)
|
||||
const char *subtune_suffix = uri_get_suffix(path_fs.c_str());
|
||||
if (tnum <= num_songs){
|
||||
return FormatString(SUBTUNE_PREFIX "%03u.%s",
|
||||
tnum, subtune_suffix).Steal();
|
||||
tnum, subtune_suffix);
|
||||
} else
|
||||
return nullptr;
|
||||
}
|
||||
|
@@ -336,7 +336,7 @@ sidplay_scan_file(Path path_fs,
|
||||
return true;
|
||||
}
|
||||
|
||||
static char *
|
||||
static AllocatedString<>
|
||||
sidplay_container_scan(Path path_fs, const unsigned int tnum)
|
||||
{
|
||||
SidTune tune(path_fs.c_str(), nullptr, true);
|
||||
@@ -353,7 +353,7 @@ sidplay_container_scan(Path path_fs, const unsigned int tnum)
|
||||
/* Construct container/tune path names, eg.
|
||||
Delta.sid/tune_001.sid */
|
||||
if(tnum<=info.songs) {
|
||||
return FormatString(SUBTUNE_PREFIX "%03u.sid", tnum).Steal();
|
||||
return FormatString(SUBTUNE_PREFIX "%03u.sid", tnum);
|
||||
} else
|
||||
return nullptr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user