summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2023-01-28 20:12:17 +0000
committerJelle Raaijmakers <jelle@gmta.nl>2023-01-28 22:41:36 +0100
commit3a9225608a0e223fe77981fdf6222337e0eadc1d (patch)
treee81f7e49dcc6f0758020e8558eee97f807febf04 /Userland/Libraries
parentee0297d9ecbf8bc63a48fb7d973d09804a8baf10 (diff)
downloadserenity-3a9225608a0e223fe77981fdf6222337e0eadc1d.zip
LibAudio: Remove `try_` prefix from fallible LoaderPlugin methods
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibAudio/Loader.cpp4
-rw-r--r--Userland/Libraries/LibAudio/Loader.h8
2 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibAudio/Loader.cpp b/Userland/Libraries/LibAudio/Loader.cpp
index 774103ba16..8f0065123b 100644
--- a/Userland/Libraries/LibAudio/Loader.cpp
+++ b/Userland/Libraries/LibAudio/Loader.cpp
@@ -21,7 +21,7 @@ Loader::Loader(NonnullOwnPtr<LoaderPlugin> plugin)
{
}
-Result<NonnullOwnPtr<LoaderPlugin>, LoaderError> Loader::try_create(StringView path)
+Result<NonnullOwnPtr<LoaderPlugin>, LoaderError> Loader::create_plugin(StringView path)
{
{
auto plugin = WavLoaderPlugin::create(path);
@@ -44,7 +44,7 @@ Result<NonnullOwnPtr<LoaderPlugin>, LoaderError> Loader::try_create(StringView p
return LoaderError { "No loader plugin available" };
}
-Result<NonnullOwnPtr<LoaderPlugin>, LoaderError> Loader::try_create(Bytes buffer)
+Result<NonnullOwnPtr<LoaderPlugin>, LoaderError> Loader::create_plugin(Bytes buffer)
{
{
auto plugin = WavLoaderPlugin::create(buffer);
diff --git a/Userland/Libraries/LibAudio/Loader.h b/Userland/Libraries/LibAudio/Loader.h
index d351ed3637..08ba0e6f5b 100644
--- a/Userland/Libraries/LibAudio/Loader.h
+++ b/Userland/Libraries/LibAudio/Loader.h
@@ -65,8 +65,8 @@ protected:
class Loader : public RefCounted<Loader> {
public:
- static Result<NonnullRefPtr<Loader>, LoaderError> create(StringView path) { return adopt_ref(*new Loader(TRY(try_create(path)))); }
- static Result<NonnullRefPtr<Loader>, LoaderError> create(Bytes buffer) { return adopt_ref(*new Loader(TRY(try_create(buffer)))); }
+ static Result<NonnullRefPtr<Loader>, LoaderError> create(StringView path) { return adopt_ref(*new Loader(TRY(create_plugin(path)))); }
+ static Result<NonnullRefPtr<Loader>, LoaderError> create(Bytes buffer) { return adopt_ref(*new Loader(TRY(create_plugin(buffer)))); }
LoaderSamples get_more_samples(size_t max_samples_to_read_from_input = 128 * KiB) const { return m_plugin->get_more_samples(max_samples_to_read_from_input); }
@@ -82,8 +82,8 @@ public:
Vector<PictureData> const& pictures() const { return m_plugin->pictures(); };
private:
- static Result<NonnullOwnPtr<LoaderPlugin>, LoaderError> try_create(StringView path);
- static Result<NonnullOwnPtr<LoaderPlugin>, LoaderError> try_create(Bytes buffer);
+ static Result<NonnullOwnPtr<LoaderPlugin>, LoaderError> create_plugin(StringView path);
+ static Result<NonnullOwnPtr<LoaderPlugin>, LoaderError> create_plugin(Bytes buffer);
explicit Loader(NonnullOwnPtr<LoaderPlugin>);