Merge branch 'master' into htj2c
[asdcplib.git] / src / KM_util.h
index ab5a837f5e5fcbb7add7c9277ef23ab38386359d..f6a8935fda44d54297df3db6bd5b0e717e606412 100755 (executable)
@@ -269,6 +269,8 @@ namespace Kumu
       bool   HasValue() const { return true; }
       ui32_t ArchiveLength() const { return sizeof(ui16_t); }
 
+         operator ui16_t() const { return value; }
+
       bool   Archive(MemIOWriter* Writer) const {
        if ( Writer == 0 ) return false;
        return Writer->WriteUi16BE(value);
@@ -332,6 +334,18 @@ namespace Kumu
        return false;
       }
 
+      inline bool operator>(const Identifier& rhs) const {
+       ui32_t test_size = xmin(rhs.Size(), SIZE);
+
+       for ( ui32_t i = 0; i < test_size; i++ )
+         {
+           if ( m_Value[i] != rhs.m_Value[i] )
+             return m_Value[i] > rhs.m_Value[i];
+         }
+       
+       return false;
+      }
+
       inline bool operator==(const Identifier& rhs) const {
        if ( rhs.Size() != SIZE ) return false;
        return ( memcmp(m_Value, rhs.m_Value, SIZE) == 0 );