Example #1
0
        public static CacheFormat FromVersion(CacheFormatVersion formatVersion)
        {
            if (formatVersion > CacheFormatVersion.CURRENT)
            {
                throw new NotSupportedException();
            }
            CacheFormatVersion versionRequired;

            if (formatVersion.CompareTo(CacheHeaderStruct.WithStructSizes) >= 0)
            {
                versionRequired = CacheHeaderStruct.WithStructSizes;
            }
            else
            {
                versionRequired = formatVersion;
            }
            return(new CacheFormat
            {
                FormatVersion = formatVersion,
                VersionRequired = versionRequired,
                ChromPeakSize = ChromPeak.GetStructSize(formatVersion),
                ChromTransitionSize = ChromTransition.GetStructSize(formatVersion),
                CachedFileSize = CachedFileHeaderStruct.GetStructSize(formatVersion),
                ChromGroupHeaderSize = ChromGroupHeaderInfo.GetStructSize(formatVersion)
            });
        }
Example #2
0
        public int CompareTo(SkylineVersion other)
        {
            int result = SrmDocumentVersion.CompareTo(other.SrmDocumentVersion);

            if (result == 0)
            {
                result = CacheFormatVersion.CompareTo(other.CacheFormatVersion);
            }
            return(result);
        }