From: Lars Op den Kamp Date: Mon, 18 Mar 2013 15:04:02 +0000 (+0100) Subject: added operator == for cec_datapacket X-Git-Tag: upstream/2.2.0~1^2~4^2~20 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6b4d1b3a3a5d4c4790234e3f8fa8a8da5a3221d7;p=deb_libcec.git added operator == for cec_datapacket --- diff --git a/include/cectypes.h b/include/cectypes.h index e8670f8..95194f6 100644 --- a/include/cectypes.h +++ b/include/cectypes.h @@ -915,6 +915,16 @@ typedef struct cec_datapacket return *this; } + bool operator ==(const struct cec_datapacket& packet) const + { + if (size != packet.size) + return false; + for (uint8_t iPtr = 0; iPtr < size; iPtr++) + if (packet.data[iPtr] != data[iPtr]) + return false; + return true; + } + bool IsEmpty(void) const { return size == 0; } /**< @return True when this packet is empty, false otherwise. */ bool IsFull(void) const { return size == 100; } /**< @return True when this packet is false, false otherwise. */