-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueryResult.h
More file actions
29 lines (23 loc) · 764 Bytes
/
QueryResult.h
File metadata and controls
29 lines (23 loc) · 764 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
#ifndef QUERYRESULT_H
#define QUERYRESULT_H
#include "StrBlob.h"
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <memory>
#include "TextQuery.h"
class QueryResult {
friend std::ostream &print(std::ostream &, const QueryResult &);
public:
typedef StrBlob::size_type line_no;
QueryResult(const std::string &s, std::shared_ptr<std::set<line_no>> l, std::shared_ptr<StrBlob> f) : sought(s), line_nums(l), file(f) {}
std::set<line_no>::iterator begin() { return line_nums->begin(); }
std::set<line_no>::iterator end() { return line_nums->end(); }
std::shared_ptr<StrBlob> get_file() const { return file; }
private:
std::string sought;
std::shared_ptr<std::set<line_no>> line_nums;
std::shared_ptr<StrBlob> file;
};
#endif