//CatalogEntry.cpp //Brooke Loftus #include CatalogEntry::CatalogEntry() { title="no title"; author="no author"; callNumber="no call number"; } friend istream operator &>>(istream &in, CatalogEntry &entry) { string discard; getline (in, discard, '"'); getline (in, entry.author, '"'); getline (in, discard, '"'); getline (in, entry.title, '"'); getline (in, discard, '"'); getline (in, entry.callNumber, '"'); getline (in, discard); return in; } string CatalogEntry::getAuthor() const {return author;} string CatalogEntry::getTitle() const {return title;} string CatalogEntry::getCallNumber() const {return callNumber;} friend ostream operator &<< (ostream &out, const CatalogEntry &entry) { out << entry.callNumber << ' ' << entry.author << ": " << entry.title; } friend bool operator ==(const CatalogEntry &one, const CatalogEntry &two) { if ( (one.title==two.title) && (one.author==two.author) && (one.callNumber==two.callNumber) ) return true; else return false; } friend bool operator !=(const CatalogEntry &one, const CatalogEntry &two) { if (one == two) return false; else return true; } friend bool operator <=(const CatalogEntry &one, const CatalogEntry &two) { if ( one == two) return true; if ( one.callNumber < two.callNumber ) return true; if ( one.callNumber == two.callNumer ) if ( one.author < two.author ) return true; if ( one.author == two.author ) if ( one.title < two.title ) return true; return false; } friend bool operator < (const CatalogEntry &one, const CatalogEntry &two) { if ( one.callNumber < two.callNumber ) return true; if ( one.callNumber == two.callNumer ) if ( one.author < two.author ) return true; if ( one.author == two.author ) if ( one.title < two.title ) return true; return false; } friend bool operator >=(const CatalogEntry &one, const CatalogEntry &two) { return (two <= one); } friend bool operator > (const CatalogEntry &one, const CatalogEntry &two) { return (two < one); }