2 **********************************************************************
3 * Copyright (C) 1999-2011, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
8 #include "unicode/chariter.h"
12 ForwardCharacterIterator::~ForwardCharacterIterator() {}
13 ForwardCharacterIterator::ForwardCharacterIterator()
16 ForwardCharacterIterator::ForwardCharacterIterator(const ForwardCharacterIterator &other)
21 CharacterIterator::CharacterIterator()
22 : textLength(0), pos(0), begin(0), end(0) {
25 CharacterIterator::CharacterIterator(int32_t length)
26 : textLength(length), pos(0), begin(0), end(length) {
32 CharacterIterator::CharacterIterator(int32_t length, int32_t position)
33 : textLength(length), pos(position), begin(0), end(length) {
39 } else if(pos > end) {
44 CharacterIterator::CharacterIterator(int32_t length, int32_t textBegin, int32_t textEnd, int32_t position)
45 : textLength(length), pos(position), begin(textBegin), end(textEnd) {
51 } else if(begin > textLength) {
56 } else if(end > textLength) {
61 } else if(pos > end) {
66 CharacterIterator::~CharacterIterator() {}
68 CharacterIterator::CharacterIterator(const CharacterIterator &that) :
69 ForwardCharacterIterator(that),
70 textLength(that.textLength), pos(that.pos), begin(that.begin), end(that.end)
75 CharacterIterator::operator=(const CharacterIterator &that) {
76 ForwardCharacterIterator::operator=(that);
77 textLength = that.textLength;
84 // implementing first[32]PostInc() directly in a subclass should be faster
85 // but these implementations make subclassing a little easier
87 CharacterIterator::firstPostInc(void) {
93 CharacterIterator::first32PostInc(void) {
95 return next32PostInc();