home *** CD-ROM | disk | FTP | other *** search
- // \EXAMPLES\EX08064.H
- // definition of the class PhoneBk
- //--------------------------------------------------------------
-
- // files in this example:
- // %F,15,EX08061.H%EX08061.H definition of class String
- // %F,15,EX08062.H%EX08062.H definition of class PhoneNum
- // %F,15,EX08063.H%EX08063.H definitions of List and ListIter
- // EX08064.H this file
- // %F,15,EX08061.CPP%EX08061.CPP member functions of class String
- // %F,15,EX08062.CPP%EX08062.CPP member functions of the class PhoneNum
- // %F,15,EX08063.CPP%EX08063.CPP member functions List and ListIter
- // %F,15,EX08064.CPP%EX08064.CPP member functions of class PhoneBk
- // %F,15,EX0806.CPP%EX0806.CPP main to exercise PhoneBk class
- //--------------------------------------------------------------
-
- #ifndef PHONEBK_H
- #define PHONEBK_H
-
- //--------------------------------------------------------------
- #include "EX08063.H"
-
- //--------------------------------------------------------------
- // Definition of a class PhoneBk, each object is a phonebook.
- //--------------------------------------------------------------
- class PhoneBk {
- List list;
- int maxsize; // maximum number of entries
- int numEntry; // number of entries so far
- public:
- PhoneBk (); // default constructor
- PhoneBk ( const PhoneBk& oldbook); // copy constructor
- ~PhoneBk () {}; // destructor
- int insert( char* who, long telnum); // insert or change entry
- int remove( char* who); // remove entry for name
- long lookup(char* who); // look up number for name
- ostream& print(ostream& os); // print the phonebook
- };
-
- //--------------------------------------------------------------
- #endif
-