-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathContact.cpp
More file actions
44 lines (36 loc) · 907 Bytes
/
Contact.cpp
File metadata and controls
44 lines (36 loc) · 907 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
34
35
36
37
38
39
40
41
42
43
44
#include "Contact.hpp"
#include <string.h>
Contact::Contact() {
this->name[0] = '\0';
this->UUID[0] = 0;
}
Contact::Contact(unsigned char *givenUUID, char const *givenName) {
//this->UUID = givenUUID;
memcpy(UUID, givenUUID, 5);
for(int i = 0; i < 10 && (givenName[i] != '\0'); i++){
this->name[i] = givenName[i];
}
}
Contact::Contact(unsigned char *givenUUID, char givenName) {
// this->UUID = givenUUID;
memcpy(UUID, givenUUID, 5);
this->name[0] = givenName;
this->name[1] = '\0';
}
void Contact::setUUID(unsigned char *givenUUID) {
//this->UUID = givenUUID;
memcpy(UUID, givenUUID, 5);
}
void Contact::setName(char const *givenName) {
strcpy(this->name, givenName);
}
void Contact::setName(char givenName) {
this->name[0] = givenName;
this->name[1] = '\0';
}
unsigned char *Contact::getUUID() {
return this->UUID;
}
char *Contact::getName() {
return name;
}