Serenity Operating System
at master 39 lines 929 B view raw
1/* 2 * Copyright (c) 2020-2021, the SerenityOS developers. 3 * Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org> 4 * 5 * SPDX-License-Identifier: BSD-2-Clause 6 */ 7 8#pragma once 9 10#include <AK/FlyString.h> 11#include <AK/RefCounted.h> 12#include <AK/String.h> 13#include <AK/Vector.h> 14#include <LibWeb/CSS/Parser/ComponentValue.h> 15#include <LibWeb/Forward.h> 16 17namespace Web::CSS::Parser { 18 19class Function : public RefCounted<Function> { 20public: 21 static NonnullRefPtr<Function> create(FlyString name, Vector<ComponentValue>&& values) 22 { 23 return adopt_ref(*new Function(move(name), move(values))); 24 } 25 26 ~Function(); 27 28 StringView name() const { return m_name; } 29 Vector<ComponentValue> const& values() const { return m_values; } 30 31 ErrorOr<String> to_string() const; 32 33private: 34 Function(FlyString name, Vector<ComponentValue>&& values); 35 36 FlyString m_name; 37 Vector<ComponentValue> m_values; 38}; 39}