2022-02-26 13:50:31 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Lucas Chollet <lucas.chollet@free.fr>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2023-12-16 11:19:34 -03:00
|
|
|
#include <AK/ByteString.h>
|
2022-02-26 13:50:31 -03:00
|
|
|
#include <AK/Error.h>
|
|
|
|
|
#include <AK/Function.h>
|
2025-03-22 22:12:30 -03:00
|
|
|
#include <AK/Swift.h>
|
2025-07-19 23:35:33 -03:00
|
|
|
#include <LibWeb/Export.h>
|
2022-02-26 13:50:31 -03:00
|
|
|
|
|
|
|
|
namespace Web {
|
|
|
|
|
|
2025-07-19 23:35:33 -03:00
|
|
|
class WEB_API FileRequest {
|
2022-02-26 13:50:31 -03:00
|
|
|
public:
|
2024-05-17 21:14:06 -03:00
|
|
|
FileRequest(ByteString path, ESCAPING Function<void(ErrorOr<i32>)> on_file_request_finish);
|
2022-02-26 13:50:31 -03:00
|
|
|
|
2023-12-16 11:19:34 -03:00
|
|
|
ByteString path() const;
|
2022-02-26 13:50:31 -03:00
|
|
|
|
|
|
|
|
Function<void(ErrorOr<i32>)> on_file_request_finish;
|
|
|
|
|
|
|
|
|
|
private:
|
2023-12-16 11:19:34 -03:00
|
|
|
ByteString m_path {};
|
2025-03-22 22:12:30 -03:00
|
|
|
} SWIFT_UNSAFE_REFERENCE; // FIXME: This type is actually move-only, not unsafe
|
2022-02-26 13:50:31 -03:00
|
|
|
|
|
|
|
|
}
|