System: Remove unused ParseM3UFile function

This commit is contained in:
Connor McLaughlin 2021-04-16 14:13:57 +10:00
parent 2985c395df
commit 1b16662f17
1 changed files with 0 additions and 46 deletions

View File

@ -305,52 +305,6 @@ bool IsLoadableFilename(const char* path)
return false;
}
std::vector<std::string> ParseM3UFile(const char* path)
{
std::ifstream ifs(path);
if (!ifs.is_open())
{
Log_ErrorPrintf("Failed to open %s", path);
return {};
}
std::vector<std::string> entries;
std::string line;
while (std::getline(ifs, line))
{
u32 start_offset = 0;
while (start_offset < line.size() && std::isspace(line[start_offset]))
start_offset++;
// skip comments
if (start_offset == line.size() || line[start_offset] == '#')
continue;
// strip ending whitespace
u32 end_offset = static_cast<u32>(line.size()) - 1;
while (std::isspace(line[end_offset]) && end_offset > start_offset)
end_offset--;
// anything?
if (start_offset == end_offset)
continue;
std::string entry_path(line.begin() + start_offset, line.begin() + end_offset + 1);
if (!FileSystem::IsAbsolutePath(entry_path))
{
SmallString absolute_path;
FileSystem::BuildPathRelativeToFile(absolute_path, path, entry_path.c_str());
entry_path = absolute_path;
}
Log_DevPrintf("Read path from m3u: '%s'", entry_path.c_str());
entries.push_back(std::move(entry_path));
}
Log_InfoPrintf("Loaded %zu paths from m3u '%s'", entries.size(), path);
return entries;
}
ConsoleRegion GetConsoleRegionForDiscRegion(DiscRegion region)
{
switch (region)