1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:07:45 +00:00

LibCore: Do not return an Optional from Resource:::filesystem_path

This API never returns OptionalNone, and all callers already assume as
much.
This commit is contained in:
Timothy Flynn 2023-11-05 08:05:22 -05:00 committed by Andreas Kling
parent 2a1fc96650
commit 98a82565cd
6 changed files with 16 additions and 9 deletions

View file

@ -11,11 +11,12 @@
#include <LibCore/Resource.h>
namespace Core {
class ResourceImplementation {
public:
ErrorOr<NonnullRefPtr<Resource>> load_from_uri(StringView);
Vector<String> child_names(Resource const&);
Optional<String> filesystem_path(Resource const&);
String filesystem_path(Resource const&);
virtual ~ResourceImplementation() = default;
@ -25,7 +26,7 @@ public:
protected:
virtual ErrorOr<NonnullRefPtr<Resource>> load_from_resource_scheme_uri(StringView) = 0;
virtual Vector<String> child_names_for_resource_scheme(Resource const&) = 0;
virtual Optional<String> filesystem_path_for_resource_scheme(String const&) = 0;
virtual String filesystem_path_for_resource_scheme(String const&) = 0;
static bool is_directory(StringView filesystem_path);
@ -33,4 +34,5 @@ protected:
static NonnullRefPtr<Resource> make_resource(String full_path, ByteBuffer);
static NonnullRefPtr<Resource> make_directory_resource(String full_path);
};
}