wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Messaging / StorageChangesMessageFilterValidator.cpp
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 #include "StorageChangesMessageFilterValidator.h"
19 #include "StorageChangesMessageFilterValidatorFactory.h"
20 #include <Logger.h>
21
22 using namespace DeviceAPI::Tizen;
23
24 namespace DeviceAPI {
25         namespace Messaging {
26
27                 StorageChangesMessageFilterValidator::StorageChangesMessageFilterValidator(PropertyStructArray properties):FilterValidator(properties){
28                         m_isTypeSetted = false;
29                 }
30
31                 StorageChangesMessageFilterValidator::~StorageChangesMessageFilterValidator(){
32                 }
33
34                 bool StorageChangesMessageFilterValidator::validateAttributeRange(std::string& attrName, DeviceAPI::Tizen::AnyPtr& initialValue, DeviceAPI::Tizen::AnyPtr& endValue, int depth){
35                         bool retVal = false;
36                         if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_TIMESTAMP)!=0){
37                                 LoggerE(">>> [ERROR] Not Supported attribute :[" << attrName << "]");
38                                 return false;
39                         }
40
41                         retVal = FilterValidator::validateAttributeRange(attrName, initialValue, endValue);
42                         return retVal;
43                 }
44
45                 //TODO Implement
46                 bool StorageChangesMessageFilterValidator::validateAttribute(std::string& attrName, DeviceAPI::Tizen::MatchFlag& matchFlag,
47                                 DeviceAPI::Tizen::AnyPtr& matchValue, int depth){
48                         if(matchValue == NULL)
49                                 return false;
50
51                         bool retBool = false;
52                         
53                         retBool = FilterValidator::validateAttribute(attrName, matchFlag, matchValue, depth);
54                         LoggerD(">>> retBool:" << retBool);
55                         return retBool;
56                 }
57         }
58 }