////////////////////////////////////////////////////////////////////// // Project 2 for CS 1704 Spring 2004 // // Programmer: Michael Tuozzo // OS: Windows XP Professional // System: Mobile Pentium 4, 1.2/2.2 GHz, 512 MB Memory // Compiler: Visual C++ 6.0, Service Pack 4 // Last modified: February 18, 2004 // // Class Name - mmcontroller // Description - This class is a multimedia organizer class. It // maintains a list of students and a list of items // supports insertion, deletion, and printing of info // stored in the lists. ////////////////////////////////////////////////////////////////////// #include "multimedia.h" ///////////////////////////////////////////////// // Function Name - multimedia // Description - default constructor // // Parameters: none // Pre: none // Post: object is initialized // Returns: none // // Calls: none ///////////////////////////////////////////////// multimedia::multimedia(){name = type = author = owner = ""; price = ""; currstat = "";} ///////////////////////////////////////////////// // Function Name - multimedia // Description - copy constructor // // Parameters: multimedia& // Pre: none // Post: object is initialized // Returns: none // // Calls: none ///////////////////////////////////////////////// multimedia::multimedia(const multimedia &tocopy){ name = tocopy.name; type = tocopy.type; author = tocopy.author; owner = tocopy.owner; price = tocopy.price; currstat = tocopy.currstat; } ///////////////////////////////////////////////// // Function Name - clear // Description - clears item's info without destruction // // Parameters: none // Pre: none // Post: object is cleared // Returns: none // // Calls: none ///////////////////////////////////////////////// void multimedia::clear(){ setname(""); settype(""); setauthor(""); setowner(""); setprice("-1.0"); setstatus(""); } ///////////////////////////////////////////////// // Function Name - print // Description - prints item's info // // Parameters: ofstream& // Pre: none // Post: item's info will have been printed // Returns: none // // Calls: none ///////////////////////////////////////////////// void multimedia::print(ofstream& output, bool printowner){ if( name.length() > 0 ) output << "Item:\n " << name << endl; if( type.length() > 0 ) output << "Media Type:\n " << type << endl; if( author.length() > 0 ) output << "by:\n " << author << endl; if( owner.length() > 0 && printowner == true ) output << "Owner:\n " << owner << endl; if( price.length() > 0 ) output << "Price:\n " << price << endl; if( currstat.length() > 0 ) output << "Availability:\n " << currstat << endl; output << endl; } ///////////////////////////////////////////////// // Function Name - ~multimedia // Description - destructor // // Parameters: none // Pre: none // Post: object is destroyed // Returns: none // // Calls: none ///////////////////////////////////////////////// multimedia::~multimedia(){name = type = author = owner = ""; price = ""; currstat = "";}