#ifndef SML_NODE_H #define SML_NODE_H #include #include class SmlNode { friend Bu::Formatter &operator<<( Bu::Formatter &f, const SmlNode &n ); public: enum Type { typeRoot, typeText, typeTag, }; SmlNode( Type eType, const Bu::String &sText=Bu::String(), SmlNode *pParent=NULL ); virtual ~SmlNode(); static SmlNode *parse( const Bu::String &sSrc ); typedef Bu::List SmlNodeList; SmlNode *append( Type type, const Bu::String &sText ); SmlNode *getParent() { return pParent; } Type getType() const { return eType; } Bu::String getText() const { return sText; } const SmlNodeList &getChildren() const { return lChildren; } private: Type eType; Bu::String sText; SmlNodeList lChildren; SmlNode *pParent; }; Bu::Formatter &operator<<( Bu::Formatter &f, const SmlNode &n ); #endif