ladybird/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.h
Linus Groh ad04d7ac9b LibWeb: Move ExceptionOr from DOM/ to WebIDL/
This is a concept fully defined in the Web IDL spec and doesn't belong
in the DOM directory/namespace - not even DOMException, despite the name
:^)
2022-09-25 19:13:31 +01:00

34 lines
790 B
C++

/*
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Bindings/PlatformObject.h>
namespace Web::DOMParsing {
class XMLSerializer final : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(XMLSerializer, Bindings::PlatformObject);
public:
static JS::NonnullGCPtr<XMLSerializer> create_with_global_object(HTML::Window&);
virtual ~XMLSerializer() override;
WebIDL::ExceptionOr<String> serialize_to_string(JS::NonnullGCPtr<DOM::Node> root);
private:
explicit XMLSerializer(HTML::Window&);
};
enum class RequireWellFormed {
No,
Yes,
};
WebIDL::ExceptionOr<String> serialize_node_to_xml_string(JS::NonnullGCPtr<DOM::Node> root, RequireWellFormed require_well_formed);
}