c01f04c5c12b22439451ea7efc734dfcbb89237f
[platform/core/appfw/pkgmgr-info.git] / src / server / filter_checker / app_filter_checker / app_disable_app_filter_checker.cc
1 /*
2  * Copyright (c) 2021 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 #include "app_disable_app_filter_checker.hh"
18
19 #include <string.h>
20
21 #include "pkgmgrinfo_basic.h"
22 #include "pkgmgrinfo_private.h"
23
24 namespace pkgmgr_server {
25 namespace database {
26
27 bool AppDisableAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
28     application_x* app_info, package_x* pkg_info) {
29   return (node->value != nullptr && app_info->is_disabled != nullptr &&
30           strcasecmp(node->value, app_info->is_disabled) == 0);
31 }
32
33 }  // namespace database
34 }  // namespace pkgmgr_server