fs/AllocatedPath: make the nullptr_t constructor public

This commit is contained in:
Max Kellermann
2018-01-17 12:17:41 +01:00
parent c4f7740b80
commit bbc5212436
24 changed files with 58 additions and 62 deletions

View File

@@ -39,7 +39,7 @@
* The absolute path of the playlist directory encoded in the
* filesystem character set.
*/
static AllocatedPath playlist_dir_fs = AllocatedPath::Null();
static AllocatedPath playlist_dir_fs = nullptr;
static void
mapper_set_playlist_dir(AllocatedPath &&path)
@@ -72,15 +72,15 @@ map_uri_fs(const char *uri) noexcept
assert(*uri != '/');
if (instance->storage == nullptr)
return AllocatedPath::Null();
return nullptr;
const auto music_dir_fs = instance->storage->MapFS("");
if (music_dir_fs.IsNull())
return AllocatedPath::Null();
return nullptr;
const auto uri_fs = AllocatedPath::FromUTF8(uri);
if (uri_fs.IsNull())
return AllocatedPath::Null();
return nullptr;
return AllocatedPath::Build(music_dir_fs, uri_fs);
}
@@ -118,7 +118,7 @@ AllocatedPath
map_spl_utf8_to_fs(const char *name) noexcept
{
if (playlist_dir_fs.IsNull())
return AllocatedPath::Null();
return nullptr;
std::string filename_utf8 = name;
filename_utf8.append(PLAYLIST_FILE_SUFFIX);
@@ -126,7 +126,7 @@ map_spl_utf8_to_fs(const char *name) noexcept
const auto filename_fs =
AllocatedPath::FromUTF8(filename_utf8.c_str());
if (filename_fs.IsNull())
return AllocatedPath::Null();
return nullptr;
return AllocatedPath::Build(playlist_dir_fs, filename_fs);
}