aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/plugins/upnp/Object.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-11-08 10:55:59 +0100
committerMax Kellermann <max@duempel.org>2014-11-08 10:55:59 +0100
commite67afc35b80943480964a39e9f65d9143d49461a (patch)
treedb6a43e508fd27ef40e27391e7f225df181d938d /src/db/plugins/upnp/Object.hxx
parent5e73007b1d44589bb9232a73b534814414bc56d7 (diff)
downloadmpd-e67afc35b80943480964a39e9f65d9143d49461a.tar.gz
mpd-e67afc35b80943480964a39e9f65d9143d49461a.tar.xz
mpd-e67afc35b80943480964a39e9f65d9143d49461a.zip
db/upnp/Directory: move checkobjok() to class UPnPDirObject
Diffstat (limited to 'src/db/plugins/upnp/Object.hxx')
-rw-r--r--src/db/plugins/upnp/Object.hxx8
1 files changed, 8 insertions, 0 deletions
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 <string>
@@ -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_ */