diff options
-rw-r--r-- | Source/MediaInfo/TimeCode.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/MediaInfo/TimeCode.h b/Source/MediaInfo/TimeCode.h index f9cd7fd3f..c61cd79c9 100644 --- a/Source/MediaInfo/TimeCode.h +++ b/Source/MediaInfo/TimeCode.h @@ -63,6 +63,9 @@ public: size_t const pos;
};
+ constexpr14 bitset8() : stored(0) {}
+ constexpr14 bitset8(int8u val) : stored(val) {}
+
constexpr14 bitset8& reset() noexcept
{
stored=0;
@@ -101,10 +104,32 @@ public: return test(pos);
}
+ constexpr14 int8u to_int8u() const noexcept
+ {
+ return stored;
+ }
+
+ constexpr14 explicit operator bool() const noexcept
+ {
+ return stored;
+ }
+
private:
int8u stored=0;
};
+inline int8u operator | (const bitset8 a, const bitset8 b) noexcept
+{
+ return a.to_int8u() | b.to_int8u();
+}
+
+inline int8u operator & (const bitset8 a, const bitset8 b) noexcept
+{
+ return a.to_int8u() & b.to_int8u();
+}
+
+
+
//***************************************************************************
// Class TimeCode
//***************************************************************************
|