2
**********************************************************************
3
* Copyright (C) 1999-2001, International Business Machines
4
* Corporation and others. All Rights Reserved.
5
**********************************************************************
8
#include "unicode/chariter.h"
12
CharacterIterator::CharacterIterator(int32_t length)
13
: textLength(length), pos(0), begin(0), end(length) {
19
CharacterIterator::CharacterIterator(int32_t length, UTextOffset position)
20
: textLength(length), pos(position), begin(0), end(length) {
26
} else if(pos > end) {
31
CharacterIterator::CharacterIterator(int32_t length, UTextOffset textBegin, UTextOffset textEnd, UTextOffset position)
32
: textLength(length), pos(position), begin(textBegin), end(textEnd) {
38
} else if(begin > textLength) {
43
} else if(end > textLength) {
48
} else if(pos > end) {
53
CharacterIterator::CharacterIterator(const CharacterIterator &that) :
54
ForwardCharacterIterator(that),
55
textLength(that.textLength), pos(that.pos), begin(that.begin), end(that.end)
60
CharacterIterator::operator=(const CharacterIterator &that) {
61
ForwardCharacterIterator::operator=(that);
62
textLength = that.textLength;
69
// implementing first[32]PostInc() directly in a subclass should be faster
70
// but these implementations make subclassing a little easier
72
CharacterIterator::firstPostInc(void) {
78
CharacterIterator::first32PostInc(void) {
80
return next32PostInc();