SVGPropertyTraits.h [plain text]
#ifndef SVGPropertyTraits_h
#define SVGPropertyTraits_h
#if ENABLE(SVG)
#include <wtf/text/WTFString.h>
namespace WebCore {
template<typename PropertyType>
struct SVGPropertyTraits { };
template<>
struct SVGPropertyTraits<bool> {
static bool initialValue() { return false; }
static String toString(bool type) { return type ? "true" : "false"; }
};
template<>
struct SVGPropertyTraits<unsigned> {
static unsigned initialValue() { return 0; }
static String toString(unsigned type) { return String::number(type); }
};
template<>
struct SVGPropertyTraits<int> {
static int initialValue() { return 0; }
static String toString(int type) { return String::number(type); }
};
template<>
struct SVGPropertyTraits<float> {
static float initialValue() { return 0; }
static String toString(float type) { return String::number(type); }
};
template<>
struct SVGPropertyTraits<String> {
static String initialValue() { return String(); }
static String toString(const String& type) { return type; }
};
}
#endif
#endif