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>
|
2024-02-11 19:48:56 +13:00
|
|
|
#include <LibWeb/DOMURL/URLSearchParams.h>
|
2021-09-28 02:11:55 +03:00
|
|
|
|
2024-02-11 19:48:56 +13:00
|
|
|
namespace Web::DOMURL {
|
2021-09-28 02:11:55 +03:00
|
|
|
|
2022-09-04 14:04:42 +02:00
|
|
|
class URLSearchParamsIterator : public Bindings::PlatformObject {
|
|
|
|
WEB_PLATFORM_OBJECT(URLSearchParamsIterator, Bindings::PlatformObject);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(URLSearchParamsIterator);
|
2022-09-04 14:04:42 +02:00
|
|
|
|
2021-09-28 02:11:55 +03:00
|
|
|
public:
|
2024-11-15 04:01:23 +13:00
|
|
|
static WebIDL::ExceptionOr<GC::Ref<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-08-07 08:41:28 +02:00
|
|
|
virtual 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
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ref<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 };
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|