
//File Name.h - contains definition of Name class

#ifndef _name_h
#define _name_h

class Name{   

 public:
	Name(const char * fName, const char * lName){
		firstName = new string(fName);
		lastName = new string(lName);
	}
	Name(const string fName, const string lName){
		firstName = new string(fName);
		lastName = new string(lName);
	}
	Name(const Name & aName){
		firstName = new string(*(aName.firstName));
		lastName = new string(*(aName.lastName));
	}
	Name & operator=(const Name & aName){
		if(this != &aName){
			firstName = aName.firstName;
			lastName = aName.lastName;
		}
		return *this;
	}
	bool operator==(Name aName){
		if((firstName == aName.firstName) && (lastName == aName.lastName))
			return true;
		else
			return false;
	}
	~Name(){
		delete firstName;
		delete lastName;
	}
	string getFirstName(){
		return *firstName;
	}
	string getLastName(){
		return *lastName;
	}
	void printOn(ostream & ostr) const {
		ostr << *firstName << " " << *lastName;
	}

private:
	string * firstName;
	string * lastName;

};

ostream & operator<<(ostream & ostr, const Name & aName) {
	aName.printOn(ostr);
	return ostr;
}

#endif