1 /*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "filter_category.h"
17
18 namespace OHOS {
19 namespace WuKong {
FilterCategory()20 FilterCategory::FilterCategory() : Filter()
21 {
22 }
23
~FilterCategory()24 FilterCategory::~FilterCategory()
25 {
26 }
27
FilterDetail(std::string type,std::map<std::string,std::string> data,std::vector<std::map<std::string,std::string>> & dataVector)28 void FilterCategory::FilterDetail(std::string type, std::map<std::string, std::string> data,
29 std::vector<std::map<std::string, std::string>> &dataVector)
30 {
31 DEBUG_LOG_STR("filter by category{%s}", type.c_str());
32 std::map<std::string, std::string>::iterator it = data.find(type);
33 if ((it != data.end()) && (!it->second.empty())) {
34 DEBUG_LOG("record data");
35 dataVector.push_back(data);
36 }
37 }
38 } // namespace WuKong
39 } // namespace OHOS
40