Function.h 926 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. #pragma once
  8. #include <AK/FlyString.h>
  9. #include <AK/RefCounted.h>
  10. #include <AK/String.h>
  11. #include <AK/Vector.h>
  12. #include <LibWeb/CSS/Parser/ComponentValue.h>
  13. #include <LibWeb/Forward.h>
  14. namespace Web::CSS::Parser {
  15. class Function : public RefCounted<Function> {
  16. public:
  17. static NonnullRefPtr<Function> create(FlyString name, Vector<ComponentValue>&& values)
  18. {
  19. return adopt_ref(*new Function(move(name), move(values)));
  20. }
  21. ~Function();
  22. FlyString const& name() const { return m_name; }
  23. Vector<ComponentValue> const& values() const { return m_values; }
  24. String to_string() const;
  25. private:
  26. Function(FlyString name, Vector<ComponentValue>&& values);
  27. FlyString m_name;
  28. Vector<ComponentValue> m_values;
  29. };
  30. }