2021-09-28 02:11:55 +03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2022-09-04 14:04:42 +02:00
|
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
2021-09-28 02:11:55 +03:00
|
|
|
#include <LibWeb/URL/URLSearchParams.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::URL {
|
|
|
|
|
|
2022-09-04 14:04:42 +02:00
|
|
|
class URLSearchParamsIterator : public Bindings::PlatformObject {
|
|
|
|
|
WEB_PLATFORM_OBJECT(URLSearchParamsIterator, Bindings::PlatformObject);
|
|
|
|
|
|
2021-09-28 02:11:55 +03:00
|
|
|
public:
|
2023-02-19 13:11:31 +01:00
|
|
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<URLSearchParamsIterator>> create(URLSearchParams const&, JS::Object::PropertyKind iteration_kind);
|
2021-09-28 02:11:55 +03:00
|
|
|
|
2022-09-04 14:04:42 +02:00
|
|
|
virtual ~URLSearchParamsIterator() override;
|
2021-09-28 02:11:55 +03:00
|
|
|
|
|
|
|
|
JS::Object* next();
|
|
|
|
|
|
|
|
|
|
private:
|
2022-09-04 14:04:42 +02:00
|
|
|
URLSearchParamsIterator(URLSearchParams const&, JS::Object::PropertyKind iteration_kind);
|
|
|
|
|
|
2023-01-28 12:33:35 -05:00
|
|
|
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
2022-09-04 14:04:42 +02:00
|
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
2021-09-28 02:11:55 +03:00
|
|
|
|
2023-02-26 16:09:02 -07:00
|
|
|
JS::NonnullGCPtr<URLSearchParams const> m_url_search_params;
|
2021-09-28 02:11:55 +03:00
|
|
|
JS::Object::PropertyKind m_iteration_kind;
|
|
|
|
|
size_t m_index { 0 };
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|