mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibCore: Add MappedFile::map_from_file()
This method relies on `map_from_fd_and_close()` but takes a `File` instead of a fd.
This commit is contained in:
parent
3a95c8111d
commit
5b6e93f96a
Notes:
sideshowbarker
2024-07-17 07:48:42 +09:00
Author: https://github.com/LucasChollet
Commit: 5b6e93f96a
Pull-request: https://github.com/SerenityOS/serenity/pull/17023
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/awesomekling
2 changed files with 8 additions and 1 deletions
|
@ -10,7 +10,7 @@
|
|||
#include <AK/Noncopyable.h>
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/Result.h>
|
||||
#include <LibCore/Forward.h>
|
||||
|
||||
namespace Core {
|
||||
|
||||
|
@ -20,6 +20,7 @@ class MappedFile : public RefCounted<MappedFile> {
|
|||
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<MappedFile>> map(StringView path);
|
||||
static ErrorOr<NonnullRefPtr<MappedFile>> map_from_file(NonnullOwnPtr<Core::File>, StringView path);
|
||||
static ErrorOr<NonnullRefPtr<MappedFile>> map_from_fd_and_close(int fd, StringView path);
|
||||
~MappedFile();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue