2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file AttributeFilter.cpp
19 * @author Kisub Song (kisubs.song@samsung.com)
24 #include "AttributeFilter.h"
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)
43 AttributeFilter::~AttributeFilter()
47 string AttributeFilter::getAttributeName() const
49 return m_attributeName;
52 void AttributeFilter::setAttributeName(const string &value)
54 m_attributeName = value;
57 bool AttributeFilter::validate(FilterValidatorPtr& validator, int depth)
59 return validator->validateAttribute(m_attributeName, m_matchValues, m_matchFlag, m_caseSensitive, depth);
62 void AttributeFilter::travel(IFilterVisitorPtr& visitor, int depth)
64 visitor->visitAttribute(m_attributeName, m_matchValues, m_matchFlag, m_caseSensitive, depth);
67 AnyArrayPtr AttributeFilter::getMatchValues() const
72 void AttributeFilter::setMatchValues(const AnyArrayPtr &value)
74 m_matchValues = value;
77 string AttributeFilter::getMatchFlag() const
82 void AttributeFilter::setMatchFlag(const string& value)
87 bool AttributeFilter::getCaseSensitive() const
89 return m_caseSensitive;
92 void AttributeFilter::setCaseSensitive(const bool& value)
94 m_caseSensitive = value;