summaryrefslogtreecommitdiff
path: root/src/tag.hpp
blob: 75e5f59b2704475b325b04f6e95674abe7c0c752 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef XIFT_INCLUDED_TAG
#define XIFT_INCLUDED_TAG

#include "attribute.hpp"


struct XiftTag: public XiftAttributes {
    XiftTag();
    ~XiftTag();

    bool MatchesForm(const XiftTag & form) const;

    char *name;
    int   len;
    int   size;
};

class XiftTags {
public:
    XiftTags();
    ~XiftTags();

    XiftTag &Tag(const char *name);
    void     Remove(const char *name);

    XiftTag *Top();
    void     Pop();
    XiftTag *PopToBeDeleted();
    XiftTag &New();

    bool ContainsMatchedForm(const XiftTag &tag) const;

private:
    struct Stack {
        Stack   *next;
        XiftTag *item;
    } *stack;
};


#endif