532c6fd34dc9d312d9eb53a5ef08ceb67762d8b0
[profile/ivi/wrt-plugins-tizen.git] / src / platform / API / Filter / AttributeFilter.cpp
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /**
18  * @file       AttributeFilter.cpp
19  * @author     Kisub Song (kisubs.song@samsung.com)
20  * @version    0.1
21  * @brief
22  */
23
24 #include "AttributeFilter.h"
25
26 namespace TizenApis {
27 namespace Api {
28 namespace Tizen {
29
30 using namespace std;
31
32 AttributeFilter::AttributeFilter(const string attributeName,
33                 const AnyArrayPtr& matchValues,
34         const string& matchFlag,
35         const bool caseSensitive) :
36         m_attributeName(attributeName),
37         m_matchValues(matchValues),
38         m_matchFlag(matchFlag),
39         m_caseSensitive(caseSensitive)
40 {
41 }
42
43 AttributeFilter::~AttributeFilter()
44 {
45 }
46
47 string AttributeFilter::getAttributeName() const
48 {
49         return m_attributeName;
50 }
51
52 void AttributeFilter::setAttributeName(const string &value)
53 {
54         m_attributeName = value;
55 }
56
57 bool AttributeFilter::validate(FilterValidatorPtr& validator, int depth)
58 {
59         return validator->validateAttribute(m_attributeName, m_matchValues, m_matchFlag, m_caseSensitive, depth);
60 }
61
62 void AttributeFilter::travel(IFilterVisitorPtr& visitor, int depth)
63 {
64         visitor->visitAttribute(m_attributeName, m_matchValues, m_matchFlag, m_caseSensitive, depth);
65 }
66
67 AnyArrayPtr AttributeFilter::getMatchValues() const
68 {
69         return m_matchValues;
70 }
71
72 void AttributeFilter::setMatchValues(const AnyArrayPtr &value)
73 {
74         m_matchValues = value;
75 }
76
77 string AttributeFilter::getMatchFlag() const
78 {
79         return m_matchFlag;
80 }
81
82 void AttributeFilter::setMatchFlag(const string& value)
83 {
84         m_matchFlag = value;
85 }
86
87 bool AttributeFilter::getCaseSensitive() const
88 {
89         return m_caseSensitive;
90 }
91
92 void AttributeFilter::setCaseSensitive(const bool& value)
93 {
94         m_caseSensitive = value;
95 }
96
97 } // Tizen
98 } // Api
99 } // TizenApis