]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/chariter.cpp
2 **********************************************************************
3 * Copyright (C) 1999-2004, 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(const CharacterIterator
&that
) :
67 ForwardCharacterIterator(that
),
68 textLength(that
.textLength
), pos(that
.pos
), begin(that
.begin
), end(that
.end
)
73 CharacterIterator::operator=(const CharacterIterator
&that
) {
74 ForwardCharacterIterator::operator=(that
);
75 textLength
= that
.textLength
;
82 // implementing first[32]PostInc() directly in a subclass should be faster
83 // but these implementations make subclassing a little easier
85 CharacterIterator::firstPostInc(void) {
91 CharacterIterator::first32PostInc(void) {
93 return next32PostInc();