db/upnp/Directory: move checkobjok() to class UPnPDirObject

This commit is contained in:
Max Kellermann
2014-11-08 10:55:59 +01:00
parent 5e73007b1d
commit e67afc35b8
2 changed files with 9 additions and 11 deletions

View File

@@ -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_ */