// SubStr.h // This file contains the definition for the abstrat class SubStr. This // class has no data, nor any implementations for the methods in it. The // clases that inherit it will have that. It is only a public interface. // The goal of this class is to be general enough so that any length of // substring could be represented and written to file without problems. #ifndef SUBSTR #define SUBSTR #include #include class SubStr { public: virtual int write(FILE *fout) const=0; // Write to current location. virtual int writeRandom(FILE *fout) const=0; // Write at index. virtual void print() const=0; virtual int compare(const SubStr &s) const=0; virtual int compare(const string &s) const=0; virtual int getLength() const=0; // How many elements in the substring. virtual int getEnglish() const=0; // Tells if we can use it for charging. virtual void setEnglish()=0; virtual void clearEnglish()=0; virtual char operator[](int n) const=0; private: // Nothing. This is just an interface. }; #endif