-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathField.cpp
More file actions
33 lines (29 loc) · 726 Bytes
/
Field.cpp
File metadata and controls
33 lines (29 loc) · 726 Bytes
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
//
// Created by hegedus on 2017.12.14..
//
#include "Field.h"
Field::Field(Visibility visibility, std::string name, std::string type, bool isStatic) :
visibility{visibility}, name{name}, type{type}, isStatic{isStatic} {}
std::string Field::write() const {
std::string ret;
switch (visibility) {
case PUBLIC :
ret = "+ ";
break;
case PRIVATE :
ret = "- ";
break;
case PROTECTED :
ret = "# ";
break;
default:
ret = "+ ";
break;
}
ret += name + " : " + type;
if(isStatic) {
ret = "<U>" + ret + "</U>";
}
ret += "<BR ALIGN=\"LEFT\"/>";
return ret;
}