-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage.cc
More file actions
78 lines (64 loc) · 1.24 KB
/
Copy pathmessage.cc
File metadata and controls
78 lines (64 loc) · 1.24 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include "message.h"
Message::Message() {
}
Message::Message(string command, string name, int length) {
this->command = command;
this->name = name;
this->length = length;
this->value = "";
}
Message::~Message() {
}
bool
Message::needed() {
if (value.length() == length) {
// cout << "not needed" << endl;
return false;
}
else {
// cout << "needed" << endl;
return true;
}
}
void
Message::toString() {
cout << "***** Message *****" << endl;
cout << "command: " << command << endl;
cout << "name: " << name << endl;
cout << "length: " << length << endl;
cout << "value: " << value << endl;
cout << "value.size(): " << value.size() << endl;
cout << "**********" << endl;
}
string
Message::getCommand() {
return this->command;
}
void
Message::setCommand(string str) {
this->command = str;
}
string
Message::getName() {
return this->name;
}
void
Message::setName(string name) {
this->name = name;
}
int
Message::getLength() {
return this->length;
}
void
Message::setLength(int length) {
this->length = length;
}
string
Message::getValue() {
return this->value;
}
void
Message::setValue(string value) {
this->value = value;
}