// File: StringNode.h // // HNode with C-style string data that is dynamically allocated // #ifndef STRINGNODE_H #define STRINGNODE_H #include #include "HList.h" using namespace std ; class StringNode : public HNode { public: StringNode(const char *str = "") ; // Must have these for Nodes with dynamically allocated data ~StringNode() ; StringNode(const StringNode& X) ; StringNode& operator=(const StringNode& X) ; void print(ostream& os =cout) const ; StringNode *clone() const ; // OK to return StringNode ptr bool operator==(const HNode& rhs_ref) const ; const char *get() const ; // not virtual! void set(const char *str) ; protected: // allows for future derivation char *m_str ; } ; #endif