-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSearchResults.cpp
76 lines (57 loc) · 1.7 KB
/
SearchResults.cpp
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
#include <iostream>
#include <cstdint>
#include "SearchResults.h"
namespace Search {
const std::wstring &SearchResult::getPath() const {
return path;
}
void SearchResult::setPath(const std::wstring &docPath) {
path = docPath;
}
const std::wstring &SearchResult::getTitle() const {
return title;
}
void SearchResult::setTitle(const std::wstring &docTitle) {
title = docTitle;
}
const std::uint32_t &SearchResult::getFsSize() const {
return fsSize;
}
void SearchResult::setFsSize(const std::uint32_t &sz) {
fsSize = sz;
}
const float &SearchResult::getScore() const {
return score;
};
void SearchResult::setScore(const float &docScore) {
score = docScore;
}
const std::wstring &SearchResult::getExtension() const {
return extension;
}
void SearchResult::setExtension(const std::wstring &docExtension) {
extension = docExtension;
}
const std::vector<std::wstring> &SearchResult::getHighlights() const {
return highlights;
};
void SearchResult::setHighlights(const std::vector<std::wstring> &docHighlights) {
highlights = docHighlights;
};
///
void SearchResults::print() const {
std::cout << "Hits: " << totalHits << "\n";
}
unsigned int SearchResults::getTotalHits() const {
return totalHits;
}
void SearchResults::setTotalHits(unsigned int hits) {
totalHits = hits;
}
const std::vector<SearchResult> &SearchResults::getResults() const {
return results;
}
void SearchResults::appendResult(const SearchResult &result) {
results.push_back(result);
}
}