Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkBreakIterator_client Class Reference
Inheritance diagram for SkBreakIterator_client:
SkBreakIterator

Public Member Functions

 SkBreakIterator_client (std::shared_ptr< SkUnicode_client::Data > data)
 
Position first () override
 
Position current () override
 
Position next () override
 
Status status () override
 
bool isDone () override
 
bool setText (const char utftext8[], int utf8Units) override
 
bool setText (const char16_t utftext16[], int utf16Units) override
 
- Public Member Functions inherited from SkBreakIterator
virtual ~SkBreakIterator ()=default
 
virtual Position first ()=0
 
virtual Position current ()=0
 
virtual Position next ()=0
 
virtual Status status ()=0
 
virtual bool isDone ()=0
 
virtual bool setText (const char utftext8[], int utf8Units)=0
 
virtual bool setText (const char16_t utftext16[], int utf16Units)=0
 

Additional Inherited Members

- Public Types inherited from SkBreakIterator
typedef int32_t Position
 
typedef int32_t Status
 

Detailed Description

Definition at line 196 of file SkUnicode_client.cpp.

Constructor & Destructor Documentation

◆ SkBreakIterator_client()

SkBreakIterator_client::SkBreakIterator_client ( std::shared_ptr< SkUnicode_client::Data data)
inlineexplicit

Definition at line 202 of file SkUnicode_client.cpp.

202: fData(data) { }
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

Member Function Documentation

◆ current()

Position SkBreakIterator_client::current ( )
inlineoverridevirtual

Implements SkBreakIterator.

Definition at line 205 of file SkUnicode_client.cpp.

206 { return fData->fLineBreaks[fStart + fLastResult].pos; }

◆ first()

Position SkBreakIterator_client::first ( )
inlineoverridevirtual

Implements SkBreakIterator.

Definition at line 203 of file SkUnicode_client.cpp.

204 { return fData->fLineBreaks[fStart + (fLastResult = 0)].pos; }
SkPoint pos

◆ isDone()

bool SkBreakIterator_client::isDone ( )
inlineoverridevirtual

Implements SkBreakIterator.

Definition at line 215 of file SkUnicode_client.cpp.

215{ return fStart + fLastResult == fEnd; }

◆ next()

Position SkBreakIterator_client::next ( )
inlineoverridevirtual

Implements SkBreakIterator.

Definition at line 207 of file SkUnicode_client.cpp.

208 { return fData->fLineBreaks[fStart + fLastResult + 1].pos; }

◆ setText() [1/2]

bool SkBreakIterator_client::setText ( const char  utftext8[],
int  utf8Units 
)
inlineoverridevirtual

Implements SkBreakIterator.

Definition at line 216 of file SkUnicode_client.cpp.

216 {
217 SkASSERT(utftext8 >= fData->fText8.data() &&
218 utf8Units <= SkToS16(fData->fText8.size()));
219 fStart = utftext8 - fData->fText8.data();
220 fEnd = fStart + utf8Units;
221 fLastResult = 0;
222 return true;
223 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
constexpr int16_t SkToS16(S x)
Definition: SkTo.h:23

◆ setText() [2/2]

bool SkBreakIterator_client::setText ( const char16_t  utftext16[],
int  utf16Units 
)
inlineoverridevirtual

Implements SkBreakIterator.

Definition at line 224 of file SkUnicode_client.cpp.

224 {
225 SkASSERT(utftext16 >= fData->fText16.data() &&
226 utf16Units <= SkToS16(fData->fText16.size()));
227 fStart = utftext16 - fData->fText16.data();
228 fEnd = fStart + utf16Units;
229 fLastResult = 0;
230 return true;
231 }

◆ status()

Status SkBreakIterator_client::status ( )
inlineoverridevirtual

Implements SkBreakIterator.

Definition at line 209 of file SkUnicode_client.cpp.

209 {
210 return fData->fLineBreaks[fStart + fLastResult].breakType ==
212 ? SkUnicode::CodeUnitFlags::kHardLineBreakBefore
213 : SkUnicode::CodeUnitFlags::kSoftLineBreakBefore;
214 }

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