From fe043bc7915b101a7291907c67bf458d78f3e6a4 Mon Sep 17 00:00:00 2001 From: Michal Michalski Date: Thu, 5 Dec 2019 13:18:56 +0100 Subject: [PATCH] [messaging] MessageFolder no longer implements FilterableObject interface. Due to introduction of AbstractFilter::isMatching(json) method, MessageFolder no longer needs to implement FilterableObject interface, because folders are filtered using new implementation. + Remove MessageFolder::isMatchingAttribute() + Remove MessageFolder::isMatchingAttributeRange() + MessageFolder no longer inherits from FilterableObject [Verification] Code compiles. Signed-off-by: Michal Michalski Change-Id: If208ce7c6bce999c2b6422e5a282f04f625e1af2 --- src/messaging/message_folder.cc | 27 --------------------------- src/messaging/message_folder.h | 12 +----------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/src/messaging/message_folder.cc b/src/messaging/message_folder.cc index a8a530f..8ec6e1c 100644 --- a/src/messaging/message_folder.cc +++ b/src/messaging/message_folder.cc @@ -60,33 +60,6 @@ MessageFolder::MessageFolder(const picojson::value& json) { attributes = json.get(); } -bool MessageFolder::isMatchingAttribute(const std::string& attribute_name, - const common::AttributeMatchFlag match_flag, - AnyPtr match_value) const { - ScopeLogger(); - LoggerD("Attribute: (%s), Operator: (%s), Value: (%s)", attribute_name.c_str(), - common::AttributeMatchFlagToString(match_flag).c_str(), match_value->toString().c_str()); - - const auto attr = attributes.find(attribute_name); - if (attr == attributes.end()) { - LoggerD("Attribute does not exist."); - return false; - } - - if (common::AttributeMatchFlag::kExists == match_flag) { - return true; - } - - return FilterUtils::isMatching(*match_value, attr->second, match_flag); -} - -bool MessageFolder::isMatchingAttributeRange(const std::string& attribute_name, - AnyPtr initial_value, AnyPtr end_value) const { - ScopeLogger(); - LoggerD("attribute_name: (%s) is NOT SUPPORTED", attribute_name.c_str()); - return false; -} - FolderPtrVector filterFolders(tizen::AbstractFilterPtr filter, const FolderPtrVector& source_folders) { ScopeLogger(); diff --git a/src/messaging/message_folder.h b/src/messaging/message_folder.h index a9d2431..d9fa949 100644 --- a/src/messaging/message_folder.h +++ b/src/messaging/message_folder.h @@ -38,21 +38,11 @@ enum MessageFolderType { }; extern const char* MessageFolderTypeStr[MESSAGE_FOLDER_TYPE_NOTSTANDARD]; -struct MessageFolder : public tizen::FilterableObject { +struct MessageFolder { MessageFolder(const std::string& id, const std::string& parent_id, const std::string& service_id, const std::string& content_type, const std::string& name, const std::string& path, const std::string& type, bool synchronizable); - MessageFolder(const picojson::value& json); - - virtual bool isMatchingAttribute(const std::string& attribute_name, - const common::AttributeMatchFlag match_flag, - tizen::AnyPtr match_value) const override; - - virtual bool isMatchingAttributeRange(const std::string& attribute_name, - tizen::AnyPtr initial_value, - tizen::AnyPtr end_value) const override; - picojson::object attributes; }; -- 2.7.4