forked from jaege/Cpp-Primer-5th-Exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuery.cpp
35 lines (30 loc) · 767 Bytes
/
Query.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
#include "Query.h"
#include "WordQuery.h"
#include "TextQuery.h"
#include "QueryResult.h"
#include "Query_base.h"
#if DEBUG_LEVEL >= 1
#include <iostream>
#endif
// NOTE The following member functions cannot be inline or they must be put
// into header, because they are used in different translation units.
//inline
Query::Query(const std::string &s) : pq(new WordQuery(s)) {
#if DEBUG_LEVEL >= 1
std::cout << "Query::Query(const std::string &)" << std::endl;
#endif
}
//inline
QueryResult Query::eval(const TextQuery &t) const {
#if DEBUG_LEVEL >= 1
std::cout << "Query::eval" << std::endl;
#endif
return pq->eval(t);
}
//inline
std::string Query::rep() const {
#if DEBUG_LEVEL >= 1
std::cout << "Query::rep" << std::endl;
#endif
return pq->rep();
}