Exemple #1
0
        /// <summary>
        /// Tests whether the other CodeDataLog is structurally identical
        /// </summary>
        public bool Check(CodeDataLog other)
        {
            if (SubType != other.SubType)
            {
                return(false);
            }
            if (SubVer != other.SubVer)
            {
                return(false);
            }

            if (this.Count != other.Count)
            {
                return(false);
            }
            foreach (var kvp in this)
            {
                if (!other.ContainsKey(kvp.Key))
                {
                    return(false);
                }
                var oval = other[kvp.Key];
                if (oval.Length != kvp.Value.Length)
                {
                    return(false);
                }
            }

            return(true);
        }
Exemple #2
0
        public void LogicalOrFrom(CodeDataLog other)
        {
            if (this.Count != other.Count)
            {
                throw new InvalidDataException("Dictionaries must have the same number of keys!");
            }

            foreach (var kvp in other)
            {
                byte[] fromdata = kvp.Value;
                byte[] todata   = this[kvp.Key];

                if (fromdata.Length != todata.Length)
                {
                    throw new InvalidDataException("Memory regions must be the same size!");
                }

                for (int i = 0; i < todata.Length; i++)
                {
                    todata[i] |= fromdata[i];
                }
            }
        }