mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-23004 UTFIterator(p, limit)
This commit is contained in:
parent
8249b4e70d
commit
d73daaf77f
2 changed files with 6 additions and 5 deletions
|
@ -15,6 +15,7 @@
|
|||
|
||||
#if U_SHOW_CPLUSPLUS_API || U_SHOW_CPLUSPLUS_HEADER_API || !defined(UTYPES_H)
|
||||
|
||||
#include <iterator>
|
||||
#include <string_view>
|
||||
#ifdef UTYPES_H
|
||||
#include "unicode/utf16.h"
|
||||
|
@ -543,7 +544,9 @@ public:
|
|||
// Test pointers for == or != but not < or >.
|
||||
inline UTFIterator(UnitIter start, UnitIter p, UnitIter limit) :
|
||||
p_(p), start_(start), limit_(limit), units_(0, 0, false, p) {}
|
||||
// TODO: add constructor with just start-or-p and limit: start=p
|
||||
// Constructs an iterator with start=p.
|
||||
inline UTFIterator(UnitIter p, UnitIter limit) :
|
||||
p_(p), start_(p), limit_(limit), units_(0, 0, false, p) {}
|
||||
// Constructs an iterator start or limit sentinel.
|
||||
inline UTFIterator(UnitIter p) : p_(p), start_(p), limit_(p), units_(0, 0, false, p) {}
|
||||
|
||||
|
|
|
@ -272,8 +272,7 @@ void U16IteratorTest::testFwdIter() {
|
|||
std::u16string_view good(u"abçカ🚴"sv);
|
||||
FwdIter<char16_t> goodBegin(good.data());
|
||||
FwdIter<char16_t> goodLimit(good.data() + good.length());
|
||||
UTFIterator<FwdIter<char16_t>, UChar32, U_BEHAVIOR_NEGATIVE> rangeBegin(
|
||||
goodBegin, goodBegin, goodLimit);
|
||||
UTFIterator<FwdIter<char16_t>, UChar32, U_BEHAVIOR_NEGATIVE> rangeBegin(goodBegin, goodLimit);
|
||||
UTFIterator<FwdIter<char16_t>, UChar32, U_BEHAVIOR_NEGATIVE> rangeLimit(goodLimit);
|
||||
// TODO: UTFStringCodePoints<FwdIter, UChar32, U_BEHAVIOR_NEGATIVE> range(good);
|
||||
auto iter = rangeBegin;
|
||||
|
@ -396,8 +395,7 @@ void U8IteratorTest::testFwdIter() {
|
|||
std::string_view good(reinterpret_cast<const char*>(u8"abçカ🚴"));
|
||||
FwdIter<char> goodBegin(good.data());
|
||||
FwdIter<char> goodLimit(good.data() + good.length());
|
||||
UTFIterator<FwdIter<char>, UChar32, U_BEHAVIOR_NEGATIVE> rangeBegin(
|
||||
goodBegin, goodBegin, goodLimit);
|
||||
UTFIterator<FwdIter<char>, UChar32, U_BEHAVIOR_NEGATIVE> rangeBegin(goodBegin, goodLimit);
|
||||
UTFIterator<FwdIter<char>, UChar32, U_BEHAVIOR_NEGATIVE> rangeLimit(goodLimit);
|
||||
// TODO: UTFStringCodePoints<FwdIter, UChar32, U_BEHAVIOR_NEGATIVE> range(good);
|
||||
auto iter = rangeBegin;
|
||||
|
|
Loading…
Add table
Reference in a new issue