diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2020-01-31 17:36:15 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2020-01-31 17:36:15 +0300 |
commit | eac37c6a45837f7ea717c9fed8cb21e2d5665618 (patch) | |
tree | d09a2c645baf2ab043762856aacc9111be221f99 /src/attribute.hpp | |
parent | 0be032c6998e712dc2c9f2ed97c3491d89eb05af (diff) | |
download | xift-eac37c6a45837f7ea717c9fed8cb21e2d5665618.tar xift-eac37c6a45837f7ea717c9fed8cb21e2d5665618.tar.xz xift-eac37c6a45837f7ea717c9fed8cb21e2d5665618.zip |
[xift] Working.
Diffstat (limited to 'src/attribute.hpp')
-rw-r--r-- | src/attribute.hpp | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/src/attribute.hpp b/src/attribute.hpp index d54d5a3..d3323a4 100644 --- a/src/attribute.hpp +++ b/src/attribute.hpp @@ -2,44 +2,41 @@ #define XIFT_INCLUDED_ATTRIBUTE -class XiftAttributes { -public: - class Attr { - friend class XiftAttributes; - - Attr(); - ~Attr(); +struct XiftAttribute { + XiftAttribute(); + ~XiftAttribute(); - bool MatchesForm(const Attr &form) const; + bool MatchesForm(const XiftAttribute &form) const; - char *name; - int nlen; - int nsize; - char *value; - int vlen; - int vsize; + char *name; + int nlen; + int nsize; + char *value; + int vlen; + int vsize; - char value_quota; - }; + char value_quota; +}; +class XiftAttributes { +public: XiftAttributes(); ~XiftAttributes(); - Attr &Attribute(const char *name); - void Remove(const char *name); + XiftAttribute &Attribute(const char *name); + void Remove(const char *name); -protected: - Attr *Top(); - void Pop(); - Attr &New(); + XiftAttribute *Top(); + void Pop(); + XiftAttribute &New(); - bool ContainsMatchedForm(const Attr &attribute) const; + bool ContainsMatchedForm(const XiftAttribute &attribute) const; bool MatchesForm(const XiftAttributes &form) const; private: struct Stack { - Stack *next; - Attr item; + Stack *next; + XiftAttribute item; } *stack; }; |