-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathitemKey.cpp
More file actions
30 lines (24 loc) · 740 Bytes
/
itemKey.cpp
File metadata and controls
30 lines (24 loc) · 740 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
/**
* ItemKey.cpp
* ItemKey class was created to store sorting atributes for each movie as an
* object
*
* @author Olga Kuriatnyk
*/
#include "itemKey.h"
// explicit constructor
ItemKey::ItemKey(const string &keyTotal) { this->itemKey = keyTotal; }
// explicit constructor
ItemKey::ItemKey(const string &subKey1, const string &subKey2) {
this->itemKey = subKey1 + " " + subKey2;
}
// @return item key
string ItemKey::getItemKey() const { return itemKey; }
// @return true if this < then other
bool ItemKey::operator<(const ItemKey &other) const {
return this->itemKey < other.itemKey;
}
// @return true if objects are equal
bool ItemKey::operator==(const ItemKey &other) const {
return (this->itemKey == other.itemKey);
}