template <typename ValueType, typename SizeType = ValueType>
class CheckedRange
Defined at line 31 of file ../../third_party/crashpad/src/util/numeric/checked_range.h
Ensures that a range, composed of a base and size, does not overflow
its data type.
Public Methods
void CheckedRange<ValueType, SizeType> (ValueType base, SizeType size)
Defined at line 33 of file ../../third_party/crashpad/src/util/numeric/checked_range.h
void SetRange (ValueType base, SizeType size)
Sets the range’s base and size to
and
respectively.
Defined at line 41 of file ../../third_party/crashpad/src/util/numeric/checked_range.h
ValueType base ()
The range’s base.
Defined at line 47 of file ../../third_party/crashpad/src/util/numeric/checked_range.h
SizeType size ()
The range’s size.
Defined at line 50 of file ../../third_party/crashpad/src/util/numeric/checked_range.h
ValueType end ()
The range’s end (its base plus its size).
Defined at line 53 of file ../../third_party/crashpad/src/util/numeric/checked_range.h
bool IsValid ()
Returns the validity of the range.
A range is valid if its size can be converted to the range’s data type
without data loss, and if its end (base plus size) can be computed without
overflowing its data type.
Returns
`true` if the range is valid, `false` otherwise.
Defined at line 62 of file ../../third_party/crashpad/src/util/numeric/checked_range.h
bool ContainsValue (ValueType value)
Returns whether the range contains another value.
A range contains a value if the value is greater than or equal to its
base, and less than its end (base plus size).
This method must only be called if IsValid() would return `true`.
Parameters
Returns
`true` if the range contains
`false` otherwise.
Defined at line 81 of file ../../third_party/crashpad/src/util/numeric/checked_range.h
bool ContainsRange (const CheckedRange<ValueType, SizeType> & that)
Returns whether the range contains another range.
A range contains another range when the contained range’s base is greater
than or equal to the containing range’s base, and the contained range’s
end is less than or equal to the containing range’s end.
This method must only be called if IsValid() would return `true` for both
CheckedRange objects involved.
Parameters
Returns
`true` if `this` range, the containing range, contains
the contained range. `false` otherwise.
Defined at line 100 of file ../../third_party/crashpad/src/util/numeric/checked_range.h
bool OverlapsRange (const CheckedRange<ValueType, SizeType> & that)
Returns whether the range overlaps another range.
Ranges are considered to be closed-open [base, end) for this test. Zero
length ranges are never considered to overlap another range.
This method must only be called if IsValid() would return `true` for both
CheckedRange objects involved.
Parameters
Returns
`true` if `this` range, the first range, overlaps
the provided range. `false` otherwise.
Defined at line 119 of file ../../third_party/crashpad/src/util/numeric/checked_range.h
bool operator< (const CheckedRange<ValueType, SizeType> & other)
Defined at line 129 of file ../../third_party/crashpad/src/util/numeric/checked_range.h