forked from TheUnity42/2551FinalProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContact.cpp
More file actions
35 lines (27 loc) · 905 Bytes
/
Copy pathContact.cpp
File metadata and controls
35 lines (27 loc) · 905 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
#include "Contact.hpp"
#include <string.h>
Contact::Contact() {
this->UUID = new unsigned char[UUID_LENGTH];
this->name = new char[NAME_LENGTH + 1];
this->name[0] = '\0';
this->UUID[0] = 0;
}
Contact::Contact(unsigned char *givenUUID, char const *givenName) {
this->UUID = givenUUID;
this->name = new char[NAME_LENGTH + 1];
strcpy(this->name, givenName);
}
Contact::Contact(unsigned char *givenUUID, char givenName) {
this->UUID = givenUUID;
this->name = new char[NAME_LENGTH + 1];
this->name[0] = givenName;
this->name[1] = '\0';
}
void Contact::setUUID(unsigned char *givenUUID) { this->UUID = givenUUID; }
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 this->name; }