From: Michal Michalski Date: Thu, 5 Dec 2019 12:18:56 +0000 (+0100) Subject: [messaging] MessageFolder no longer implements FilterableObject interface. X-Git-Tag: accepted/tizen/unified/20191212.123659~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F219528%2F2;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [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 --- 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; };