SVGStringListValues.h [plain text]
#pragma once
#include "QualifiedName.h"
#include "SVGAttributeAccessor.h"
#include "SVGPropertyTraits.h"
#include <wtf/Vector.h>
namespace WebCore {
class SVGElement;
class SVGStringList;
class SVGStringListValues;
template<typename T>
class SVGPropertyTearOff;
using SVGStringListValuesAttribute = SVGPropertyAttribute<SVGStringListValues>;
template<typename OwnerType>
using SVGStringListValuesAttributeAccessor = SVGPropertyAttributeAccessor<OwnerType, SVGStringListValuesAttribute>;
class SVGStringListValues final : public Vector<String> {
public:
SVGStringListValues(const QualifiedName& attributeName)
: m_attributeName(attributeName)
{
}
void reset(const String&);
void parse(const String&, UChar delimiter = ',');
void commitChange(SVGElement& contextElement);
String valueAsString() const;
private:
const QualifiedName& m_attributeName;
};
template<> struct SVGPropertyTraits<SVGStringListValues> {
static String toString(const SVGStringListValues& list) { return list.valueAsString(); }
using ListItemType = String;
using ListItemTearOff = SVGPropertyTearOff<String>;
using ListPropertyTearOff = SVGStringList;
};
}