From e67afc35b80943480964a39e9f65d9143d49461a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 8 Nov 2014 10:55:59 +0100 Subject: db/upnp/Directory: move checkobjok() to class UPnPDirObject --- src/db/plugins/upnp/Object.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/db/plugins/upnp/Object.hxx') diff --git a/src/db/plugins/upnp/Object.hxx b/src/db/plugins/upnp/Object.hxx index 55ceafcfa..6d71c158b 100644 --- a/src/db/plugins/upnp/Object.hxx +++ b/src/db/plugins/upnp/Object.hxx @@ -21,6 +21,7 @@ #define MPD_UPNP_OBJECT_HXX #include "tag/Tag.hxx" +#include "Compiler.h" #include @@ -87,6 +88,13 @@ public: item_class = ItemClass::UNKNOWN; tag.Clear(); } + + gcc_pure + bool Check() const { + return !id.empty() && !parent_id.empty() && !name.empty() && + (type != UPnPDirObject::Type::ITEM || + item_class != UPnPDirObject::ItemClass::UNKNOWN); + } }; #endif /* _UPNPDIRCONTENT_H_X_INCLUDED_ */ -- cgit v1.2.3