fs/AllocatedPath: add method FromUTF8Throw()

This commit is contained in:
Max Kellermann
2016-04-12 21:20:32 +02:00
parent 6513ff92a7
commit fc3e0dfcd1
5 changed files with 22 additions and 10 deletions

View File

@@ -43,9 +43,8 @@ playlist_print_song(BufferedOutputStream &os, const DetachedSong &song)
: song.GetURI();
try {
const auto uri_fs = AllocatedPath::FromUTF8(uri_utf8);
if (!uri_fs.IsNull())
os.Format("%s\n", NarrowPath(uri_fs).c_str());
const auto uri_fs = AllocatedPath::FromUTF8Throw(uri_utf8);
os.Format("%s\n", NarrowPath(uri_fs).c_str());
} catch (const std::runtime_error &) {
}
}
@@ -61,7 +60,7 @@ playlist_print_uri(BufferedOutputStream &os, const char *uri)
? map_uri_fs(uri)
:
#endif
AllocatedPath::FromUTF8(uri);
AllocatedPath::FromUTF8Throw(uri);
if (!path.IsNull())
os.Format("%s\n", NarrowPath(path).c_str());