#include "Person.h"

Person::Person(long id, const string& name, const string& birthDate)
	: id(id)
	, name(name)
	, birthDate(birthDate)
{
}

istream& Person::load(istream& in)
{
	in >> id; in.ignore();
	return readline(in, name) >> birthDate;
}

ostream& Person::print(ostream& output) const
{
	return output << id << ": " << name << " (" << birthDate << ')'
				  << " status=" << SocioeconomicalStatusStr[getSocioeconomicalStatus()];
}

istream& readline(istream& in, string& str)
{
	char buffer[1024];
	in.getline(buffer, 1024);
	str = buffer;
	return in;
}
