-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBaseData.cpp
60 lines (47 loc) · 1.06 KB
/
BaseData.cpp
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
56
57
58
59
60
#include <bits/stdc++.h>
#include "BaseData.h"
using namespace std;
DataType BaseData:: getType() {
return type;
}
void StringData:: setString(const string &_data) {
data = _data;
}
string StringData::getString() const {
return data;
}
void StringData::printData(ofstream &ouf) {
ouf << data;
}
void IntData:: setInt(const int &_data) {
data = _data;
}
int IntData:: getInt() const {
return data;
}
void IntData::printData(ofstream &ouf) {
ouf << data;
}
void DoubleData:: setDouble(const double &_data) {
data = _data;
}
double DoubleData::getDouble() const {
return data;
}
void DoubleData::printData(ofstream &ouf) {
ouf << data;
}
void VectorStringData::setString(const string &_data) {
data.push_back (_data);
}
vector<string> VectorStringData::getVectorString() const {
return data;
}
void VectorStringData::printData(ofstream &ouf) {
bool flag = 0;
for (string it : data) {
if (flag) ouf << " / ";
ouf << it;
flag = 1;
}
}