diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2020-01-31 17:16:27 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2020-01-31 17:16:27 +0300 |
commit | 0be032c6998e712dc2c9f2ed97c3491d89eb05af (patch) | |
tree | f762d884147d2f0a9a115edd0b5e0de554a3ec1b /src/tag.hpp | |
download | xift-0be032c6998e712dc2c9f2ed97c3491d89eb05af.tar xift-0be032c6998e712dc2c9f2ed97c3491d89eb05af.tar.xz xift-0be032c6998e712dc2c9f2ed97c3491d89eb05af.zip |
[xift] Almost done.
Diffstat (limited to 'src/tag.hpp')
-rw-r--r-- | src/tag.hpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/tag.hpp b/src/tag.hpp new file mode 100644 index 0000000..469c4fd --- /dev/null +++ b/src/tag.hpp @@ -0,0 +1,44 @@ +#ifndef XIFT_INCLUDED_TAG +#define XIFT_INCLUDED_TAG + +#include "attribute.hpp" + + +class XiftTags { +public: + class Item: public XiftAttributes { + friend class XiftTags; + + Item(); + ~Item(); + + bool MatchesForm(const Item & form) const; + + char *name; + int len; + int size; + }; + + XiftTags(); + ~XiftTags(); + + Item &Tag(const char *name); + void Remove(const char *name); + +protected: + Item *Top(); + void Pop(); + Item *PopToBeDeleted(); + Item &New(); + + bool ContainsMatchedForm(const Item &tag) const; + +private: + struct Stack { + Stack *next; + Item *item; + } *stack; +}; + + +#endif |