[messaging] MessageFolder no longer implements FilterableObject interface. 28/219528/2
authorMichal Michalski <m.michalski2@partner.samsung.com>
Thu, 5 Dec 2019 12:18:56 +0000 (13:18 +0100)
committerMichal Michalski <m.michalski2@partner.samsung.com>
Fri, 6 Dec 2019 08:41:47 +0000 (09:41 +0100)
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 <m.michalski2@partner.samsung.com>
Change-Id: If208ce7c6bce999c2b6422e5a282f04f625e1af2

src/messaging/message_folder.cc
src/messaging/message_folder.h

index a8a530f..8ec6e1c 100644 (file)
@@ -60,33 +60,6 @@ MessageFolder::MessageFolder(const picojson::value& json) {
   attributes = json.get<picojson::object>();
 }
 
-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();
index a9d2431..d9fa949 100644 (file)
@@ -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;
 };