strusAnalyzer  0.17
queryTerm.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Patrick P. Frey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
10 #ifndef _STRUS_ANALYZER_QUERY_TERM_HPP_INCLUDED
11 #define _STRUS_ANALYZER_QUERY_TERM_HPP_INCLUDED
12 #include <string>
13 #include <vector>
14 
16 namespace strus {
18 namespace analyzer {
19 
21 class QueryTerm
22 {
23 public:
26  :m_type(),m_value(),m_len(0){}
28 #if __cplusplus >= 201103L
29  QueryTerm( QueryTerm&& ) = default;
30  QueryTerm( const QueryTerm& ) = default;
31  QueryTerm& operator= ( QueryTerm&& ) = default;
32  QueryTerm& operator= ( const QueryTerm& ) = default;
33 #else
34  QueryTerm( const QueryTerm& o)
35  :m_type(o.m_type),m_value(o.m_value),m_len(o.m_len){}
36 #endif
37  QueryTerm( const std::string& t, const std::string& v, int l)
42  :m_type(t),m_value(v),m_len(l){}
43 
46  const std::string& type() const {return m_type;}
49  const std::string& value() const {return m_value;}
52  int len() const {return m_len;}
53 
56  void setLen( int len_) {m_len = len_;}
57 
58 private:
59  std::string m_type;
60  std::string m_value;
61  int m_len;
62 };
63 
64 }}//namespace
65 #endif
66 
const std::string & value() const
Get the value of the term.
Definition: queryTerm.hpp:49
void setLen(int len_)
Set the length of the term (ordinal position count)
Definition: queryTerm.hpp:56
const std::string & type() const
Get the type name of the term.
Definition: queryTerm.hpp:46
int len() const
Get the length of the term (ordinal position count)
Definition: queryTerm.hpp:52
QueryTerm(const QueryTerm &o)
Copy constructor.
Definition: queryTerm.hpp:34
QueryTerm()
Default constructor.
Definition: queryTerm.hpp:25
Structure describing a typed query term.
Definition: queryTerm.hpp:21