mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:48:13 +00:00
LibCore: Add Resource for platform agnostic application resource loading
The first implementation is simply raw files.
This commit is contained in:
parent
f4a89c31c6
commit
0d417cd604
8 changed files with 393 additions and 0 deletions
26
Userland/Libraries/LibCore/ResourceImplementationFile.h
Normal file
26
Userland/Libraries/LibCore/ResourceImplementationFile.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Andrew Kaster <akaster@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <LibCore/Resource.h>
|
||||
#include <LibCore/ResourceImplementation.h>
|
||||
|
||||
namespace Core {
|
||||
class ResourceImplementationFile : public ResourceImplementation {
|
||||
public:
|
||||
explicit ResourceImplementationFile(String base_directory);
|
||||
|
||||
virtual ErrorOr<NonnullRefPtr<Resource>> load_from_resource_scheme_uri(StringView) override;
|
||||
virtual Vector<String> child_names_for_resource_scheme(Resource const&) override;
|
||||
virtual Optional<String> filesystem_path_for_resource_scheme(String const&) override;
|
||||
|
||||
private:
|
||||
String m_base_directory;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue