#ifndef TextLines_SEEN__ #define TextLines_SEEN__ /////// File: TextLines.h /////// #include typedef char * String; typedef unsigned int Uint; class TextLines { public: TextLines(Uint size = 1024, Uint ll = 256); String operator[](Uint i) // overloading [] { return( i < len ? lines[i] : NULL ); } Uint length() { return(len); } void swap(Uint i, Uint j) // interchange lines { String tmp = lines[i]; lines[i] = lines[j]; lines[j] = tmp; } void input(istream& in); void display(); ~TextLines(); // destructor private: String *lines; Uint len; // total no. of lines Uint maxlines; // max no. of lines Uint linelen; // max line len int read_lines(istream& in); }; #endif