-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.h
35 lines (32 loc) · 792 Bytes
/
data.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* Andrea Favero
* 1125545
*/
#ifndef DATA_H
#define DATA_H
#include <string>
// classe che modella una data in modo simile a quanto
// fatto dalla classe QDate
class Data {
public:
static const int MASSIMO_ANNO_VALIDO = 9999;
static const int MINIMO_ANNO_VALIDO = 1800;
Data(int y, int m, int d);
Data(std::string);
static bool controlloValidita(int, int, int);
bool operator==(const Data&) const;
bool operator>=(const Data&) const;
bool operator<=(const Data&) const;
std::string toString() const;
void setY(int);
void setM(int);
void setD(int);
int getY() const;
int getM() const;
int getD() const;
private:
int y, m, d; //anno, mese, giorno
bool valida;
};
#endif // DATA_H