Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::GraphemeIterator::GraphemeClusterIterator Class Reference
Collaboration diagram for duckdb::GraphemeIterator::GraphemeClusterIterator:

Public Member Functions

 GraphemeClusterIterator (const char *s, size_t len)
void Next ()
void SetInvalid ()
bool IsInvalid () const
GraphemeClusterIterator & operator++ ()
bool operator!= (const GraphemeClusterIterator &other) const
GraphemeCluster operator* () const

Public Attributes

const char * s
size_t len
GraphemeCluster cluster

Constructor & Destructor Documentation

◆ GraphemeClusterIterator()

duckdb::GraphemeIterator::GraphemeClusterIterator::GraphemeClusterIterator ( const char * s,
size_t len )
507471 : s(s_p), len(len_p) {
507472 if (s) {
507473 cluster.start = 0;
507474 cluster.end = 0;
507475 Next();
507476 } else {
507477 SetInvalid();
507478 }

Member Function Documentation

◆ Next()

void duckdb::GraphemeIterator::GraphemeClusterIterator::Next ( )
507492 {
507493 if (IsInvalid()) {
507494 throw std::runtime_error("Grapheme cluster out of bounds!");
507495 }
507496 if (cluster.end >= len) {
507497 // out of bounds
507498 SetInvalid();
507499 return;
507500 }
507501 size_t next_pos = Utf8Proc::NextGraphemeCluster(s, len, cluster.end);
507502 cluster.start = cluster.end;
507503 cluster.end = next_pos;
static size_t NextGraphemeCluster(const char *s, size_t len, size_t pos)
Returns the position (in bytes) of the next grapheme cluster.
Definition duckdb.cpp:507427

◆ SetInvalid()

void duckdb::GraphemeIterator::GraphemeClusterIterator::SetInvalid ( )
507481 {
507482 s = nullptr;
507483 len = 0;
507484 cluster.start = 0;
507485 cluster.end = 0;

◆ IsInvalid()

bool duckdb::GraphemeIterator::GraphemeClusterIterator::IsInvalid ( ) const
507488 {
507489 return !s;

◆ operator++()

GraphemeIterator::GraphemeClusterIterator & duckdb::GraphemeIterator::GraphemeClusterIterator::operator++ ( )
507506 {
507507 Next();
507508 return *this;

◆ operator!=()

bool duckdb::GraphemeIterator::GraphemeClusterIterator::operator!= ( const GraphemeClusterIterator & other) const
507510 {
507511 return !(len == other.len && s == other.s && cluster.start == other.cluster.start &&
507512 cluster.end == other.cluster.end);

◆ operator*()

GraphemeCluster duckdb::GraphemeIterator::GraphemeClusterIterator::operator* ( ) const
507515 {
507516 if (IsInvalid()) {
507517 throw std::runtime_error("Grapheme cluster out of bounds!");
507518 }
507519 return cluster;

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