#ifndef _HTMLATTRIBUTE_H #define _HTMLATTRIBUTE_H #include "extensions.h" #include "StringMap.h" #include "Streams.h" #include using namespace std; class HTMLAttribute: protected Character { static StringMapCI m_attributes; const char *m_text; //e.g. "src" public: HTMLAttribute(const char *_text); static HTMLAttribute attribute_id, attribute_class, attribute_style, attribute_alt, attribute_href, attribute_src, attribute_onclick, attribute_name, attribute_content; //in META tags //special operators used primarily for comparing heading levels h1 > h6 const bool operator== (HTMLAttribute *t) {return this == t;} //compare address as these are singletons const bool operator!= (HTMLAttribute *t) {return !(this->operator==(t));} //accessors const char *text() {return m_text;} //lookup static HTMLAttribute *getattribute(const char *textstart); static HTMLAttribute *attribute(const char *text); static HTMLAttribute *attribute(const char *textstart, const char *textfinish); }; #endif