ladybird/Libraries/LibWeb/CSS/URL.h
2025-05-03 12:01:43 +01:00

35 lines
650 B
C++

/*
* Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/String.h>
namespace Web::CSS {
// https://drafts.csswg.org/css-values-4/#urls
class URL {
public:
URL(String url);
String const& url() const { return m_url; }
String to_string() const;
bool operator==(URL const&) const;
private:
String m_url;
};
}
template<>
struct AK::Formatter<Web::CSS::URL> : AK::Formatter<StringView> {
ErrorOr<void> format(FormatBuilder& builder, Web::CSS::URL const& value)
{
return Formatter<StringView>::format(builder, value.to_string());
}
};