#include "HTMLTagStore.h"
HTMLTagStore::HTMLTagStore(vector *tags) {
for (vector::const_iterator i = tags->begin(); i != tags->end(); i++) set(*i);
}
HTMLTagStore::HTMLTagStore(vector *tags) {
for (vector::const_iterator i = tags->begin(); i != tags->end(); i++) set(i->t);
}
void HTMLTagStore::open(char *out) {
for (iterator i = begin(); i != end(); i++) {
sprintf(out, "<%s>", (*i)->text());
while (*out) out++;
}
*out = 0;
}
void HTMLTagStore::close(char *out) {
for (iterator i = end(); i != begin(); --i) {
sprintf(out, "%s>", (*i)->text());
while (*out) out++;
}
*out = 0;
}
HTMLTagStore::iterator HTMLTagStore::begin() {iterator i(this, 0); i++; return i;}
HTMLTagStore::iterator HTMLTagStore::end() {return iterator(this, STORESIZE);}