]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/chariter.cpp
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 **********************************************************************
5 * Copyright (C) 1999-2011, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
10 #include "unicode/chariter.h"
14 ForwardCharacterIterator::~ForwardCharacterIterator() {}
15 ForwardCharacterIterator::ForwardCharacterIterator()
18 ForwardCharacterIterator::ForwardCharacterIterator(const ForwardCharacterIterator
&other
)
23 CharacterIterator::CharacterIterator()
24 : textLength(0), pos(0), begin(0), end(0) {
27 CharacterIterator::CharacterIterator(int32_t length
)
28 : textLength(length
), pos(0), begin(0), end(length
) {
34 CharacterIterator::CharacterIterator(int32_t length
, int32_t position
)
35 : textLength(length
), pos(position
), begin(0), end(length
) {
41 } else if(pos
> end
) {
46 CharacterIterator::CharacterIterator(int32_t length
, int32_t textBegin
, int32_t textEnd
, int32_t position
)
47 : textLength(length
), pos(position
), begin(textBegin
), end(textEnd
) {
53 } else if(begin
> textLength
) {
58 } else if(end
> textLength
) {
63 } else if(pos
> end
) {
68 CharacterIterator::~CharacterIterator() {}
70 CharacterIterator::CharacterIterator(const CharacterIterator
&that
) :
71 ForwardCharacterIterator(that
),
72 textLength(that
.textLength
), pos(that
.pos
), begin(that
.begin
), end(that
.end
)
77 CharacterIterator::operator=(const CharacterIterator
&that
) {
78 ForwardCharacterIterator::operator=(that
);
79 textLength
= that
.textLength
;
86 // implementing first[32]PostInc() directly in a subclass should be faster
87 // but these implementations make subclassing a little easier
89 CharacterIterator::firstPostInc(void) {
95 CharacterIterator::first32PostInc(void) {
97 return next32PostInc();