Exemplo n.º 1
0
 public bool Contains(ByteRange range)
 {
     if (range.Start >= Start && range.End <= End)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 public void PopConstraint()
 {
     if (_ConstraintStack.Count > 0) _CurrentConstraint = _ConstraintStack.Pop();
     else
     {
         Trace.WriteLine("Attempted to pop constraint too many times.", "WARNING");
         _CurrentConstraint = ByteRange.MaxValue;
     }
 }
Exemplo n.º 3
0
 public bool Overlaps(ByteRange range)
 {
     if (Contains(range.Start) || Contains(range.End))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 4
0
 public void PopConstraint()
 {
     if (_ConstraintStack.Count > 0)
     {
         _currentConstraint = _ConstraintStack.Pop();
     }
     else
     {
         Trace.WriteLine("Attempted to pop constraint too many times.", "WARNING");
         _currentConstraint = ByteRange.MaxValue;
     }
 }
Exemplo n.º 5
0
        public void PushConstraint(long offset, long length)
        {

            if (offset < _CurrentConstraint.Start)
            {
                Trace.WriteLine(String.Format("Attempted to set a new constraint ({0},{1}) offset outside the bounds of the existing constraint({2},{3}).", offset, length, _CurrentConstraint.Start, _CurrentConstraint.Length), "WARNING");
                offset = _CurrentConstraint.Start;
            }
            if (offset + length > _CurrentConstraint.End)
            {
                Trace.WriteLine(String.Format("Attempted to set a new constraint ({0},{1}) length outside the bounds of the existing constraint({2},{3}).", offset, length, _CurrentConstraint.Start, _CurrentConstraint.Length), "WARNING");
                length = _CurrentConstraint.End - offset;
            }

            if (_CurrentConstraint != null) _ConstraintStack.Push(_CurrentConstraint);
            _CurrentConstraint = new ByteRange(offset, offset + length);
        }
Exemplo n.º 6
0
        public void PushConstraint(long offset, long length)
        {
            if (offset < _CurrentConstraint.Start)
            {
                Trace.WriteLine(String.Format("Attempted to set a new constraint ({0},{1}) offset outside the bounds of the existing constraint({2},{3}).", offset, length, _CurrentConstraint.Start, _CurrentConstraint.Length), "WARNING");
                offset = _CurrentConstraint.Start;
            }
            if (offset + length > _CurrentConstraint.End)
            {
                Trace.WriteLine(String.Format("Attempted to set a new constraint ({0},{1}) length outside the bounds of the existing constraint({2},{3}).", offset, length, _CurrentConstraint.Start, _CurrentConstraint.Length), "WARNING");
                length = _CurrentConstraint.End - offset;
            }

            if (_CurrentConstraint != null)
            {
                _ConstraintStack.Push(_CurrentConstraint);
            }
            _CurrentConstraint = new ByteRange(offset, offset + length);
        }
Exemplo n.º 7
0
        public void PushConstraint(long offset, long length)
        {
            if (offset < _currentConstraint.Start)
            {
                Trace.WriteLine($"Attempted to set a new constraint ({offset},{length}) offset outside the bounds of the existing constraint({_currentConstraint.Start},{_currentConstraint.Length}).", "WARNING");
                offset = _currentConstraint.Start;
            }

            if (offset + length > _currentConstraint.End)
            {
                Trace.WriteLine($"Attempted to set a new constraint ({offset},{length}) length outside the bounds of the existing constraint({_currentConstraint.Start},{_currentConstraint.Length}).", "WARNING");
                length = _currentConstraint.End - offset;
            }

            if (_currentConstraint != null)
            {
                _ConstraintStack.Push(_currentConstraint);
            }

            _currentConstraint = new ByteRange(offset, offset + length);
        }
Exemplo n.º 8
0
 public bool Overlaps(ByteRange range)
 {
     if (Contains(range.Start) || Contains(range.End)) return true;
     else return false;
 }
Exemplo n.º 9
0
 public bool Contains(ByteRange range)
 {
     if (range.Start >= Start && range.End <= End) return true;
     return false;
 }