Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Public Attributes | List of all members
skia::textlayout::SkRange< T > Struct Template Reference

#include <DartTypes.h>

Public Types

using SignedT = std::make_signed_t< T >
 

Public Member Functions

 SkRange ()
 
 SkRange (T s, T e)
 
bool operator== (const SkRange< T > &other) const
 
T width () const
 
void Shift (SignedT delta)
 
bool contains (SkRange< size_t > other) const
 
bool intersects (SkRange< size_t > other) const
 
SkRange< size_t > intersection (SkRange< size_t > other) const
 
bool empty () const
 

Public Attributes

T start
 
T end
 

Detailed Description

template<typename T>
struct skia::textlayout::SkRange< T >

Definition at line 92 of file DartTypes.h.

Member Typedef Documentation

◆ SignedT

template<typename T >
using skia::textlayout::SkRange< T >::SignedT = std::make_signed_t<T>

Definition at line 96 of file DartTypes.h.

Constructor & Destructor Documentation

◆ SkRange() [1/2]

template<typename T >
skia::textlayout::SkRange< T >::SkRange ( )
inline

Definition at line 93 of file DartTypes.h.

◆ SkRange() [2/2]

template<typename T >
skia::textlayout::SkRange< T >::SkRange ( T  s,
T  e 
)
inline

Definition at line 94 of file DartTypes.h.

94: start(s), end(e) {}
struct MyStruct s

Member Function Documentation

◆ contains()

template<typename T >
bool skia::textlayout::SkRange< T >::contains ( SkRange< size_t >  other) const
inline

Definition at line 111 of file DartTypes.h.

111 {
112 return start <= other.start && end >= other.end;
113 }

◆ empty()

template<typename T >
bool skia::textlayout::SkRange< T >::empty ( ) const
inline

Definition at line 123 of file DartTypes.h.

123 {
124 return start == EMPTY_INDEX && end == EMPTY_INDEX;
125 }
const size_t EMPTY_INDEX
Definition: DartTypes.h:91

◆ intersection()

template<typename T >
SkRange< size_t > skia::textlayout::SkRange< T >::intersection ( SkRange< size_t >  other) const
inline

Definition at line 119 of file DartTypes.h.

119 {
120 return SkRange<size_t>(std::max(start, other.start), std::min(end, other.end));
121 }
static float max(float r, float g, float b)
Definition: hsl.cpp:49
static float min(float r, float g, float b)
Definition: hsl.cpp:48

◆ intersects()

template<typename T >
bool skia::textlayout::SkRange< T >::intersects ( SkRange< size_t >  other) const
inline

Definition at line 115 of file DartTypes.h.

115 {
116 return std::max(start, other.start) <= std::min(end, other.end);
117 }

◆ operator==()

template<typename T >
bool skia::textlayout::SkRange< T >::operator== ( const SkRange< T > &  other) const
inline

Definition at line 100 of file DartTypes.h.

100 {
101 return start == other.start && end == other.end;
102 }

◆ Shift()

template<typename T >
void skia::textlayout::SkRange< T >::Shift ( SignedT  delta)
inline

Definition at line 106 of file DartTypes.h.

106 {
107 start += delta;
108 end += delta;
109 }

◆ width()

template<typename T >
T skia::textlayout::SkRange< T >::width ( ) const
inline

Definition at line 104 of file DartTypes.h.

104{ return end - start; }

Member Data Documentation

◆ end

template<typename T >
T skia::textlayout::SkRange< T >::end

Definition at line 98 of file DartTypes.h.

◆ start

template<typename T >
T skia::textlayout::SkRange< T >::start

Definition at line 98 of file DartTypes.h.


The documentation for this struct was generated from the following file: