X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fcectypes.h;h=cb647fd2230300eb848d1635e98173e278ff18c1;hb=ff50391c4f0724c10c7bb19b927e29b92dc40cd3;hp=8c6cf9c79dab4e7d428662104926a097d0b76548;hpb=e5e86c76b70975d8a8c03c58a230a70726399906;p=deb_libcec.git diff --git a/include/cectypes.h b/include/cectypes.h index 8c6cf9c..cb647fd 100644 --- a/include/cectypes.h +++ b/include/cectypes.h @@ -196,6 +196,8 @@ typedef struct cec_device_type_list } return bReturn; } + + cec_device_type operator[](uint8_t pos) const { return pos < 5 ? types[pos] : CEC_DEVICE_TYPE_RESERVED; } #endif } cec_device_type_list; @@ -554,6 +556,7 @@ typedef struct cec_logical_addresses } bool isset(cec_logical_address address) const { return addresses[(int) address] == 1; } + bool operator[](uint8_t pos) const { return pos < 16 ? isset((cec_logical_address) pos) : false; } #endif } cec_logical_addresses;