Lines Matching full:range
16 #include "ui/gfx/range/gfx_range_export.h"
32 // A Range contains two integer values that represent a numeric range, like the
33 // range of characters in a text selection. A range is made of a start and end
34 // position; when they are the same, the Range is akin to a caret. Note that
36 // range.
37 class GFX_RANGE_EXPORT Range {
39 // Creates an empty range {0,0}.
40 constexpr Range() : Range(0) {} in Range() function
42 // Initializes the range with a start and end.
43 constexpr Range(uint32_t start, uint32_t end) : start_(start), end_(end) {} in Range() function
45 // Initializes the range with the same start and end positions.
46 constexpr explicit Range(uint32_t position) : Range(position, position) {} in Range() function
50 explicit Range(const NSRange& range);
53 // {0,-1} to indicate the whole range.
54 Range(const CHARRANGE& range, long total_length = -1);
57 // Returns a range that is invalid, which is {UINT32_MAX,UINT32_MAX}.
58 static constexpr Range InvalidRange() { in InvalidRange()
59 return Range(std::numeric_limits<uint32_t>::max()); in InvalidRange()
62 // Checks if the range is valid through comparison to InvalidRange().
86 constexpr bool operator==(const Range& other) const {
89 constexpr bool operator!=(const Range& other) const {
92 constexpr bool EqualsIgnoringDirection(const Range& other) const { in EqualsIgnoringDirection()
96 // Returns true if this range intersects the specified |range|.
97 constexpr bool Intersects(const Range& range) const { in Intersects() argument
98 return IsValid() && range.IsValid() && in Intersects()
99 !(range.GetMax() < GetMin() || range.GetMin() >= GetMax()); in Intersects()
102 // Returns true if this range contains the specified |range|.
103 constexpr bool Contains(const Range& range) const { in Contains() argument
104 return IsValid() && range.IsValid() && GetMin() <= range.GetMin() && in Contains()
105 range.GetMax() <= GetMax(); in Contains()
108 // Computes the intersection of this range with the given |range|.
110 // The returned range is always empty or forward (never reversed).
111 Range Intersect(const Range& range) const;
114 Range& operator=(const NSRange& range);
116 // NSRange does not store the directionality of a range, so if this
117 // is_reversed(), the range will get flipped when converted to an NSRange.
122 // GTK+ has no concept of a range.
134 GFX_RANGE_EXPORT std::ostream& operator<<(std::ostream& os, const Range& range);