mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-12 08:24:08 +00:00
ICU-809
replaced UnicodeString.farray by UnicodeString.getBuffer() X-SVN-Rev: 7968
This commit is contained in:
parent
84194f7ed8
commit
ba68284b32
3 changed files with 24 additions and 28 deletions
|
@ -33,8 +33,6 @@ class Locale; // unicode/locid.h
|
|||
class UCharReference;
|
||||
class UnicodeConverter; // unicode/convert.h
|
||||
class StringCharacterIterator;
|
||||
class SearchIterator;
|
||||
class StringSearch;
|
||||
class BreakIterator; // unicode/brkiter.h
|
||||
|
||||
/* The <iostream> include has been moved to unicode/ustream.h */
|
||||
|
@ -2923,9 +2921,7 @@ private:
|
|||
friend class UnicodeConverter;
|
||||
|
||||
friend class StringCharacterIterator;
|
||||
friend class SearchIterator;
|
||||
friend class StringSearch;
|
||||
friend class StringThreadTest;
|
||||
friend class StringTest;
|
||||
|
||||
/*
|
||||
* The following are all the class fields that are stored
|
||||
|
|
|
@ -121,7 +121,7 @@ void SearchIterator::setText(const UnicodeString &text, UErrorCode &status)
|
|||
}
|
||||
else {
|
||||
m_text_ = text;
|
||||
m_search_->text = m_text_.fArray;
|
||||
m_search_->text = m_text_.getBuffer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ SearchIterator::SearchIterator(const UnicodeString &text,
|
|||
m_search_->reset = TRUE;
|
||||
m_search_->matchedIndex = USEARCH_DONE;
|
||||
m_search_->matchedLength = 0;
|
||||
m_search_->text = m_text_.fArray;
|
||||
m_search_->text = m_text_.getBuffer();
|
||||
m_search_->textLength = text.length();
|
||||
}
|
||||
|
||||
|
@ -333,7 +333,7 @@ SearchIterator::SearchIterator(CharacterIterator &text,
|
|||
m_search_->matchedIndex = USEARCH_DONE;
|
||||
m_search_->matchedLength = 0;
|
||||
text.getText(m_text_);
|
||||
m_search_->text = m_text_.fArray;
|
||||
m_search_->text = m_text_.getBuffer();
|
||||
m_search_->textLength = m_text_.length();
|
||||
m_breakiterator_ = breakiter;
|
||||
}
|
||||
|
|
|
@ -29,8 +29,8 @@ StringSearch::StringSearch(const UnicodeString &pattern,
|
|||
return;
|
||||
}
|
||||
|
||||
m_strsrch_ = usearch_open(m_pattern_.fArray, m_pattern_.fLength,
|
||||
m_text_.fArray, m_text_.fLength,
|
||||
m_strsrch_ = usearch_open(m_pattern_.getBuffer(), m_pattern_.length(),
|
||||
m_text_.getBuffer(), m_text_.length(),
|
||||
locale.getName(), NULL, &status);
|
||||
uprv_free(m_search_);
|
||||
m_search_ = NULL;
|
||||
|
@ -64,9 +64,9 @@ StringSearch::StringSearch(const UnicodeString &pattern,
|
|||
m_strsrch_ = NULL;
|
||||
return;
|
||||
}
|
||||
m_strsrch_ = usearch_openFromCollator(m_pattern_.fArray,
|
||||
m_pattern_.fLength, m_text_.fArray,
|
||||
m_text_.fLength, coll->ucollator,
|
||||
m_strsrch_ = usearch_openFromCollator(m_pattern_.getBuffer(),
|
||||
m_pattern_.length(), m_text_.getBuffer(),
|
||||
m_text_.length(), coll->ucollator,
|
||||
NULL, &status);
|
||||
uprv_free(m_search_);
|
||||
m_search_ = NULL;
|
||||
|
@ -95,8 +95,8 @@ StringSearch::StringSearch(const UnicodeString &pattern,
|
|||
m_strsrch_ = NULL;
|
||||
return;
|
||||
}
|
||||
m_strsrch_ = usearch_open(m_pattern_.fArray, m_pattern_.fLength,
|
||||
m_text_.fArray, m_text_.fLength,
|
||||
m_strsrch_ = usearch_open(m_pattern_.getBuffer(), m_pattern_.length(),
|
||||
m_text_.getBuffer(), m_text_.length(),
|
||||
locale.getName(), NULL, &status);
|
||||
uprv_free(m_search_);
|
||||
m_search_ = NULL;
|
||||
|
@ -130,9 +130,9 @@ StringSearch::StringSearch(const UnicodeString &pattern,
|
|||
m_strsrch_ = NULL;
|
||||
return;
|
||||
}
|
||||
m_strsrch_ = usearch_openFromCollator(m_pattern_.fArray,
|
||||
m_pattern_.fLength, m_text_.fArray,
|
||||
m_text_.fLength, coll->ucollator,
|
||||
m_strsrch_ = usearch_openFromCollator(m_pattern_.getBuffer(),
|
||||
m_pattern_.length(), m_text_.getBuffer(),
|
||||
m_text_.length(), coll->ucollator,
|
||||
NULL, &status);
|
||||
uprv_free(m_search_);
|
||||
m_search_ = NULL;
|
||||
|
@ -159,9 +159,9 @@ StringSearch::StringSearch(const StringSearch &that) :
|
|||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
}
|
||||
else {
|
||||
m_strsrch_ = usearch_openFromCollator(m_pattern_.fArray,
|
||||
m_pattern_.fLength,
|
||||
m_text_.fArray, m_text_.fLength,
|
||||
m_strsrch_ = usearch_openFromCollator(m_pattern_.getBuffer(),
|
||||
m_pattern_.length(),
|
||||
m_text_.getBuffer(), m_text_.length(),
|
||||
that.m_strsrch_->collator,
|
||||
NULL, &status);
|
||||
}
|
||||
|
@ -198,10 +198,10 @@ StringSearch & StringSearch::operator=(const StringSearch &that)
|
|||
m_pattern_ = that.m_pattern_;
|
||||
// all m_search_ in the parent class is linked up with m_strsrch_
|
||||
usearch_close(m_strsrch_);
|
||||
m_strsrch_ = usearch_openFromCollator(m_pattern_.fArray,
|
||||
m_pattern_.fLength,
|
||||
m_text_.fArray,
|
||||
m_text_.fLength,
|
||||
m_strsrch_ = usearch_openFromCollator(m_pattern_.getBuffer(),
|
||||
m_pattern_.length(),
|
||||
m_text_.getBuffer(),
|
||||
m_text_.length(),
|
||||
that.m_strsrch_->collator,
|
||||
NULL, &status);
|
||||
int32_t length;
|
||||
|
@ -244,7 +244,7 @@ void StringSearch::setText(const UnicodeString &text, UErrorCode &status)
|
|||
{
|
||||
if (U_SUCCESS(status)) {
|
||||
m_text_ = text;
|
||||
usearch_setText(m_strsrch_, text.fArray, text.fLength, &status);
|
||||
usearch_setText(m_strsrch_, text.getBuffer(), text.length(), &status);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ void StringSearch::setText(CharacterIterator &text, UErrorCode &status)
|
|||
{
|
||||
if (U_SUCCESS(status)) {
|
||||
text.getText(m_text_);
|
||||
usearch_setText(m_strsrch_, m_text_.fArray, m_text_.fLength, &status);
|
||||
usearch_setText(m_strsrch_, m_text_.getBuffer(), m_text_.length(), &status);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ void StringSearch::setPattern(const UnicodeString &pattern,
|
|||
{
|
||||
if (U_SUCCESS(status)) {
|
||||
m_pattern_ = pattern;
|
||||
usearch_setPattern(m_strsrch_, m_pattern_.fArray, m_pattern_.fLength,
|
||||
usearch_setPattern(m_strsrch_, m_pattern_.getBuffer(), m_pattern_.length(),
|
||||
&status);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue