#ifndef TLines_SEEN #define TLines_SEEN /////// File: TLine_OS.h /////// #include #include "SortKey.h" #include "OrderedSeq.h" class TextLine_OS : public OrderedSeq { public: TextLine_OS(Uint pos = 0, Uint size = 1024, Uint ll = 256, String dlm = DELIM); String operator[](Uint i); // overloading [] void remove(Uint i); // delete entry i Uint length() { return(len); } void input(istream& in); void display(ostream& out = cout); ~TextLine_OS(); // destructor protected: int append(void* line); // append entry at end private: void swap(Uint i, Uint j); // interchange lines int cmp(Uint i, Uint j) { return( key.cmp(lines[i], lines[j])); } int cmp(void* k, Uint j) { return( key.cmp(k, lines[j])); } String *lines; SortKey key; Uint len; // total no. of lines Uint maxlen; // max no. of lines Uint linelen; // max line len int read_lines(istream& in); }; #endif