#include <iostream>
#include "Fecha.h"

//Constructores
Fecha::Fecha(){
	dia = 0;
	mes = 0;
	ano = 0;
}
Fecha::Fecha(const Fecha& f){
	dia = f.dia;
	mes = f.mes;
	ano = f.ano;
}
Fecha::Fecha(const short d, const short m, const short a){
	dia = d;
	mes = m;
	ano = a;
}

//Destructor
Fecha::~Fecha(){
}

//Métodos de acceso
short Fecha::obtenerDia(){
	return dia;
}
short Fecha::obtenerMes(){
	return mes;
}
short Fecha::obtenerAno(){
	return ano;
}
Fecha Fecha::mostrarFecha(){
	cout<<dia<<"/"<<mes<<"/"<<ano<<endl;
}

//Métodos de modificación
void Fecha::asignarDia(const short d){
	dia = d;
}
void Fecha::asignarMes(const short m){
	mes = m;
}
void Fecha::asignarAno(const short a){
	ano = a;
}

//Sobrecarga de operadores
bool Fecha::operator<(Fecha f){
	bool menor = false;
	if(ano < f.ano){
		menor = true;
	}
	else{
		if(ano == f.ano){
			if(mes < f.mes){
				menor = true;
			}
			else{
				if(mes == f.mes){
					if(dia < f.dia){
						menor = true;
					}
				}
			}
		}
	}
	return menor;
}
bool Fecha::operator==(Fecha f){
	if( ano != f.ano || mes != f.mes ||  dia != f.dia )
		return false;
	else
		return true;
}
	
bool Fecha::operator<=(Fecha f){
	if( *this < f || *this == f )
		return true;
	else
		return false;
}
bool Fecha::operator>(Fecha f){
	if( !(*this < f || *this == f) )
		return true;
	else
		return false;
}
/*
Fecha Fecha::operator++(){
}
*/

