Beta merge 2
[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 MatchFlag& matchFlag,
34                 const AnyArrayPtr& matchValues) :
35         m_attributeName(attributeName),
36         m_matchFlag(matchFlag),
37         m_matchValues(matchValues)
38 {
39 }
40
41 AttributeFilter::~AttributeFilter()
42 {
43 }
44
45 string AttributeFilter::getAttributeName() const
46 {
47         return m_attributeName;
48 }
49
50 void AttributeFilter::setAttributeName(const string &value)
51 {
52         m_attributeName = value;
53 }
54
55 bool AttributeFilter::validate(FilterValidatorPtr& validator, int depth)
56 {
57         return validator->validateAttribute(m_attributeName, m_matchFlag, m_matchValues, depth);
58 }
59
60 void AttributeFilter::travel(IFilterVisitorPtr& visitor, int depth)
61 {
62         visitor->visitAttribute(m_attributeName, m_matchFlag, m_matchValues, depth);
63 }
64
65 AnyArrayPtr AttributeFilter::getMatchValues() const
66 {
67         return m_matchValues;
68 }
69
70 void AttributeFilter::setMatchValues(const AnyArrayPtr &value)
71 {
72         m_matchValues = value;
73 }
74
75 MatchFlag AttributeFilter::getMatchFlag() const
76 {
77         return m_matchFlag;
78 }
79
80 void AttributeFilter::setMatchFlag(const MatchFlag& value)
81 {
82         m_matchFlag = value;
83 }
84
85 } // Tizen
86 } // Api
87 } // TizenApis