From eac37c6a45837f7ea717c9fed8cb21e2d5665618 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Fri, 31 Jan 2020 17:36:15 +0300 Subject: [xift] Working. --- src/attribute.hpp | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) (limited to 'src/attribute.hpp') 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; }; -- cgit v1.2.3