ICU-12140 Pass StringPiece by value, externally.

R=markus.icu@gmail.com

Review URL: https://codereview.appspot.com/306850043 .

X-SVN-Rev: 39064
This commit is contained in:
Fredrik Roubert 2016-08-17 19:07:15 +00:00
parent d17f99dd61
commit 3959b30d02
12 changed files with 28 additions and 28 deletions

View file

@ -145,7 +145,7 @@ BytesTrieBuilder::~BytesTrieBuilder() {
}
BytesTrieBuilder &
BytesTrieBuilder::add(const StringPiece &s, int32_t value, UErrorCode &errorCode) {
BytesTrieBuilder::add(StringPiece s, int32_t value, UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) {
return *this;
}

View file

@ -66,7 +66,7 @@ public:
* @return *this
* @stable ICU 4.8
*/
BytesTrieBuilder &add(const StringPiece &s, int32_t value, UErrorCode &errorCode);
BytesTrieBuilder &add(StringPiece s, int32_t value, UErrorCode &errorCode);
/**
* Builds a BytesTrie for the add()ed data.

View file

@ -200,7 +200,7 @@ public:
* @stable ICU 4.6
*/
virtual void
labelToASCII_UTF8(const StringPiece &label, ByteSink &dest,
labelToASCII_UTF8(StringPiece label, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const;
/**
@ -218,7 +218,7 @@ public:
* @stable ICU 4.6
*/
virtual void
labelToUnicodeUTF8(const StringPiece &label, ByteSink &dest,
labelToUnicodeUTF8(StringPiece label, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const;
/**
@ -236,7 +236,7 @@ public:
* @stable ICU 4.6
*/
virtual void
nameToASCII_UTF8(const StringPiece &name, ByteSink &dest,
nameToASCII_UTF8(StringPiece name, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const;
/**
@ -254,7 +254,7 @@ public:
* @stable ICU 4.6
*/
virtual void
nameToUnicodeUTF8(const StringPiece &name, ByteSink &dest,
nameToUnicodeUTF8(StringPiece name, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const;
};

View file

@ -3279,7 +3279,7 @@ public:
* @see toUTF8String
* @stable ICU 4.2
*/
static UnicodeString fromUTF8(const StringPiece &utf8);
static UnicodeString fromUTF8(StringPiece utf8);
/**
* Create a UnicodeString from a UTF-32 string.

View file

@ -417,7 +417,7 @@ UnicodeString::~UnicodeString()
// Factory methods
//========================================
UnicodeString UnicodeString::fromUTF8(const StringPiece &utf8) {
UnicodeString UnicodeString::fromUTF8(StringPiece utf8) {
UnicodeString result;
result.setToUTF8(utf8);
return result;

View file

@ -70,7 +70,7 @@ isASCIIOkBiDi(const char *s, int32_t length);
IDNA::~IDNA() {}
void
IDNA::labelToASCII_UTF8(const StringPiece &label, ByteSink &dest,
IDNA::labelToASCII_UTF8(StringPiece label, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const {
if(U_SUCCESS(errorCode)) {
UnicodeString destString;
@ -80,7 +80,7 @@ IDNA::labelToASCII_UTF8(const StringPiece &label, ByteSink &dest,
}
void
IDNA::labelToUnicodeUTF8(const StringPiece &label, ByteSink &dest,
IDNA::labelToUnicodeUTF8(StringPiece label, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const {
if(U_SUCCESS(errorCode)) {
UnicodeString destString;
@ -90,7 +90,7 @@ IDNA::labelToUnicodeUTF8(const StringPiece &label, ByteSink &dest,
}
void
IDNA::nameToASCII_UTF8(const StringPiece &name, ByteSink &dest,
IDNA::nameToASCII_UTF8(StringPiece name, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const {
if(U_SUCCESS(errorCode)) {
UnicodeString destString;
@ -100,7 +100,7 @@ IDNA::nameToASCII_UTF8(const StringPiece &name, ByteSink &dest,
}
void
IDNA::nameToUnicodeUTF8(const StringPiece &name, ByteSink &dest,
IDNA::nameToUnicodeUTF8(StringPiece name, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const {
if(U_SUCCESS(errorCode)) {
UnicodeString destString;
@ -133,19 +133,19 @@ public:
IDNAInfo &info, UErrorCode &errorCode) const;
virtual void
labelToASCII_UTF8(const StringPiece &label, ByteSink &dest,
labelToASCII_UTF8(StringPiece label, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const;
virtual void
labelToUnicodeUTF8(const StringPiece &label, ByteSink &dest,
labelToUnicodeUTF8(StringPiece label, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const;
virtual void
nameToASCII_UTF8(const StringPiece &name, ByteSink &dest,
nameToASCII_UTF8(StringPiece name, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const;
virtual void
nameToUnicodeUTF8(const StringPiece &name, ByteSink &dest,
nameToUnicodeUTF8(StringPiece name, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const;
private:
@ -253,25 +253,25 @@ UTS46::nameToUnicode(const UnicodeString &name, UnicodeString &dest,
}
void
UTS46::labelToASCII_UTF8(const StringPiece &label, ByteSink &dest,
UTS46::labelToASCII_UTF8(StringPiece label, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const {
processUTF8(label, TRUE, TRUE, dest, info, errorCode);
}
void
UTS46::labelToUnicodeUTF8(const StringPiece &label, ByteSink &dest,
UTS46::labelToUnicodeUTF8(StringPiece label, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const {
processUTF8(label, TRUE, FALSE, dest, info, errorCode);
}
void
UTS46::nameToASCII_UTF8(const StringPiece &name, ByteSink &dest,
UTS46::nameToASCII_UTF8(StringPiece name, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const {
processUTF8(name, FALSE, TRUE, dest, info, errorCode);
}
void
UTS46::nameToUnicodeUTF8(const StringPiece &name, ByteSink &dest,
UTS46::nameToUnicodeUTF8(StringPiece name, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const {
processUTF8(name, FALSE, FALSE, dest, info, errorCode);
}

View file

@ -830,7 +830,7 @@ DecimalFormat::format( double number,
UnicodeString&
DecimalFormat::format(const StringPiece &number,
DecimalFormat::format(StringPiece number,
UnicodeString &toAppendTo,
FieldPositionIterator *posIter,
UErrorCode &status) const

View file

@ -157,7 +157,7 @@ Formattable::Formattable(int64_t value)
// -------------------------------------
// Creates a formattable object with a decimal number value from a string.
Formattable::Formattable(const StringPiece &number, UErrorCode &status) {
Formattable::Formattable(StringPiece number, UErrorCode &status) {
init();
setDecimalNumber(number, status);
}
@ -798,7 +798,7 @@ Formattable::adoptDigitList(DigitList *dl) {
// ---------------------------------------
void
Formattable::setDecimalNumber(const StringPiece &numberString, UErrorCode &status) {
Formattable::setDecimalNumber(StringPiece numberString, UErrorCode &status) {
if (U_FAILURE(status)) {
return;
}

View file

@ -452,7 +452,7 @@ NumberFormat::format(int64_t number,
// XXXFormat::format(double
UnicodeString&
NumberFormat::format(const StringPiece &decimalNum,
NumberFormat::format(StringPiece decimalNum,
UnicodeString& toAppendTo,
FieldPositionIterator* fpi,
UErrorCode& status) const

View file

@ -1091,7 +1091,7 @@ public:
* @return Reference to 'appendTo' parameter.
* @stable 4.4
*/
virtual UnicodeString& format(const StringPiece &number,
virtual UnicodeString& format(StringPiece number,
UnicodeString& appendTo,
FieldPositionIterator* posIter,
UErrorCode& status) const;

View file

@ -136,7 +136,7 @@ public:
* decimal number.
* @stable ICU 4.4
*/
Formattable(const StringPiece &number, UErrorCode &status);
Formattable(StringPiece number, UErrorCode &status);
/**
* Creates a Formattable object with a UnicodeString object to copy from.
@ -583,7 +583,7 @@ public:
* incoming string is not a valid decimal number.
* @stable ICU 4.4
*/
void setDecimalNumber(const StringPiece &numberString,
void setDecimalNumber(StringPiece numberString,
UErrorCode &status);
/**

View file

@ -519,7 +519,7 @@ public:
* @return Reference to 'appendTo' parameter.
* @stable 4.4
*/
virtual UnicodeString& format(const StringPiece &number,
virtual UnicodeString& format(StringPiece number,
UnicodeString& appendTo,
FieldPositionIterator* posIter,
UErrorCode& status) const;