strusAnalyzer  0.17
documentAttribute.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_DOCUMENT_ATTRIBUTE_HPP_INCLUDED
11 #define _STRUS_ANALYZER_DOCUMENT_ATTRIBUTE_HPP_INCLUDED
12 #include <string>
13 
15 namespace strus {
17 namespace analyzer {
18 
21 {
22 public:
28  DocumentAttribute( const std::string& n, const std::string& v)
29  :m_name(n),m_value(v){}
31 #if __cplusplus >= 201103L
32  DocumentAttribute( DocumentAttribute&& ) = default;
33  DocumentAttribute( const DocumentAttribute& ) = default;
34  DocumentAttribute& operator= ( DocumentAttribute&& ) = default;
35  DocumentAttribute& operator= ( const DocumentAttribute& ) = default;
36 #else
38  :m_name(o.m_name),m_value(o.m_value){}
39 #endif
40 
43  const std::string& name() const {return m_name;}
46  const std::string& value() const {return m_value;}
47 
48 private:
49  std::string m_name;
50  std::string m_value;
51 };
52 
53 }}//namespace
54 #endif
55 
const std::string & name() const
Get the name of the attribute.
Definition: documentAttribute.hpp:43
Structure describing a document attribute.
Definition: documentAttribute.hpp:20
DocumentAttribute(const DocumentAttribute &o)
Copy constructor.
Definition: documentAttribute.hpp:37
const std::string & value() const
Get the value of the attribute.
Definition: documentAttribute.hpp:46
DocumentAttribute()
Default constructor.
Definition: documentAttribute.hpp:24
DocumentAttribute(const std::string &n, const std::string &v)
Constructor.
Definition: documentAttribute.hpp:28