public:
// Use compiler's default constructor, initializes nothing.
- void setTo(const StringPiece &s, int32_t val, CharString &strings, UErrorCode &errorCode);
+ void setTo(StringPiece s, int32_t val, CharString &strings, UErrorCode &errorCode);
StringPiece getString(const CharString &strings) const {
int32_t offset=stringOffset;
};
void
-BytesTrieElement::setTo(const StringPiece &s, int32_t val,
+BytesTrieElement::setTo(StringPiece s, int32_t val,
CharString &strings, UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) {
return;
return TRUE;
}
-CharString &CharString::appendPathPart(const StringPiece &s, UErrorCode &errorCode) {
+CharString &CharString::appendPathPart(StringPiece s, UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) {
return *this;
}
class U_COMMON_API CharString : public UMemory {
public:
CharString() : len(0) { buffer[0]=0; }
- CharString(const StringPiece &s, UErrorCode &errorCode) : len(0) {
+ CharString(StringPiece s, UErrorCode &errorCode) : len(0) {
buffer[0]=0;
append(s, errorCode);
}
CharString &truncate(int32_t newLength);
CharString &append(char c, UErrorCode &errorCode);
- CharString &append(const StringPiece &s, UErrorCode &errorCode) {
+ CharString &append(StringPiece s, UErrorCode &errorCode) {
return append(s.data(), s.length(), errorCode);
}
CharString &append(const CharString &s, UErrorCode &errorCode) {
* First appends a U_FILE_SEP_CHAR if necessary.
* Does nothing if s is empty.
*/
- CharString &appendPathPart(const StringPiece &s, UErrorCode &errorCode);
+ CharString &appendPathPart(StringPiece s, UErrorCode &errorCode);
/**
* Appends a U_FILE_SEP_CHAR if this string is not empty
* in a "const char*" or a "string" wherever a "StringPiece" is
* expected.
*
- * Functions or methods may use const StringPiece& parameters to accept either
- * a "const char*" or a "string" value that will be implicitly converted to
- * a StringPiece.
+ * Functions or methods may use StringPiece parameters to accept either a
+ * "const char*" or a "string" value that will be implicitly converted to a
+ * StringPiece.
*
* Systematic usage of StringPiece is encouraged as it will reduce unnecessary
* conversions from "const char*" to "string" and back again.
private:
// For char* constructors. Could be made public.
- UnicodeString &setToUTF8(const StringPiece &utf8);
+ UnicodeString &setToUTF8(StringPiece utf8);
// For extract(char*).
// We could make a toUTF8(target, capacity, errorCode) public but not
// this version: New API will be cleaner if we make callers create substrings
return *this;
}
-UnicodeString &UnicodeString::setToUTF8(const StringPiece &utf8) {
+UnicodeString &UnicodeString::setToUTF8(StringPiece utf8) {
unBogus();
int32_t length = utf8.length();
int32_t capacity;
IDNAInfo &info, UErrorCode &errorCode) const;
void
- processUTF8(const StringPiece &src,
+ processUTF8(StringPiece src,
UBool isLabel, UBool toASCII,
ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const;
}
void
-UTS46::processUTF8(const StringPiece &src,
+UTS46::processUTF8(StringPiece src,
UBool isLabel, UBool toASCII,
ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const {
UnicodeString&
CompactDecimalFormat::format(
- const StringPiece& /* number */,
+ StringPiece /* number */,
UnicodeString& appendTo,
FieldPositionIterator* /* posIter */,
UErrorCode& status) const {
UnicodeString &
DecimalFormatImpl::format(
- const StringPiece &number,
+ StringPiece number,
UnicodeString &appendTo,
FieldPositionIterator *posIter,
UErrorCode &status) const {
FieldPositionIterator *posIter,
UErrorCode &status) const;
UnicodeString &format(
- const StringPiece &number,
+ StringPiece number,
UnicodeString &appendTo,
FieldPositionIterator *posIter,
UErrorCode &status) const;
* be acceptable for a public API.
*/
void
-DigitList::set(const StringPiece &source, UErrorCode &status, uint32_t /*fastpathBits*/) {
+DigitList::set(StringPiece source, UErrorCode &status, uint32_t /*fastpathBits*/) {
if (U_FAILURE(status)) {
return;
}
* @param source The value to be set. The string must be nul-terminated.
* @param fastpathBits special flags for fast parsing
*/
- void set(const StringPiece &source, UErrorCode &status, uint32_t fastpathBits = 0);
+ void set(StringPiece source, UErrorCode &status, uint32_t fastpathBits = 0);
/**
* Multiply this = this * arg
* @return Reference to 'appendTo' parameter.
* @internal
*/
- virtual UnicodeString& format(const StringPiece &number,
+ virtual UnicodeString& format(StringPiece number,
UnicodeString& appendTo,
FieldPositionIterator* posIter,
UErrorCode& status) const;