]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/cstr.cpp
2 *******************************************************************************
3 * Copyright (C) 2015-2016, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 *******************************************************************************
6 * file name: charstr.cpp
8 #include "unicode/utypes.h"
9 #include "unicode/unistr.h"
16 CStr::CStr(const UnicodeString
&in
) {
17 UErrorCode status
= U_ZERO_ERROR
;
18 int32_t length
= in
.extract(0, in
.length(), NULL
, (uint32_t)0);
19 int32_t resultCapacity
= 0;
20 char *buf
= s
.getAppendBuffer(length
, length
, resultCapacity
, status
);
21 if (U_SUCCESS(status
)) {
22 in
.extract(0, in
.length(), buf
, resultCapacity
);
23 s
.append(buf
, length
, status
);
30 const char * CStr::operator ()() const {