#ifndef STRINGLIST_H #define STRINGLIST_H //************************************************************ // // STringList.h // //************************************************************ // // Copyright (C) 1996 // // J. Fritz Barnes // Graduate Student // Computer Science Department // University of California // Davis, CA 95616 // // // Permission is granted to use at your own risk and // distribute this software in source and binary forms // provided the above copyright notice and this paragraph // are preserved on all copies. This software is provided // "as is" with no express or implied warranty. // //************************************************************ #include "STringListElem.h" class STringList { private: STringListElem* headtail; int length; STringListElem* Find_Element( int ); const STringListElem* Find_Element( int ) const; public: // default constructor STringList( void ); // user-defined constructors STringList( const STring& ); // copy constructor STringList( const STringList& ); // destructor ~STringList( void ); // assignment operator STringList& operator = ( const STringList& ); // access the ith element in the list const STring& operator[] ( int ) const ; STring& operator[] ( int ); // Value Access int Get_Length( void ); // Add a new value to the end of the list void Append( const STring& ); void Append( const STringList& ); // insert data into the list at the ith location void Insert( const int i, const STring& ); // replace data at location i void Replace( const int i, const STring& ); // remove element i from the list void Remove( const int i ); // Output operator friend ostream& operator<< ( ostream& , const STringList& ); }; #endif