-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVatRate.h
More file actions
55 lines (39 loc) · 1.34 KB
/
VatRate.h
File metadata and controls
55 lines (39 loc) · 1.34 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* VatRate.h
*
* Created on: 25 March 2012
* Author: Max Foster
*/
#ifndef VATRATE_H
#define VATRATE_H
#include <fstream>
#include "Record.h"
class VatRate : public Record
{
public:
static const std::string databaseFilename;
static int size();
VatRate(double value = -1.0, time_t startDate = 0);
VatRate(const VatRate &vatRate);
~VatRate();
void operator =(const VatRate &vatrate);
void writeToFile(std::fstream &file) const;
void readFromFile(std::fstream &file);
bool hasMatchingField(const std::string &fieldName, const int searchTerm) const;
bool hasMatchingField(const std::string &fieldName, const double searchTerm) const;
bool hasMatchingField(const std::string &fieldName, const time_t searchTerm) const;
bool fieldCompare(const VatRate &rhs) const;
bool completeCompare(const VatRate &rhs) const;
double getValue() const;
void setValue(const double newValue);
static bool isValidValue(const double value, std::string &errorMessage);
time_t getStartDate() const;
void setStartDate(const time_t newStartDate);
static bool isValidStartDate(const time_t value, std::string &errorMessage);
void validate() const;
private:
double value;
time_t startDate;
};
std::ostream & operator <<(std::ostream &stream, const VatRate &vatRate);
#endif // VATRATE_H