From 7c6e2b4cef7e787aa03dcb9ff68b99b2afc2cc1f Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Wed, 5 Sep 2001 23:41:11 +0000 Subject: [PATCH] ICU-1109 remove uprv_fillOutputString(), replaced by new function int32_t UnicodeString::extract(UChar *, int32_t, UErrorCode &) X-SVN-Rev: 5697 --- icu4c/source/common/common.dsp | 4 ---- icu4c/source/common/cpputils.cpp | 35 -------------------------------- icu4c/source/common/cpputils.h | 10 --------- 3 files changed, 49 deletions(-) delete mode 100644 icu4c/source/common/cpputils.cpp diff --git a/icu4c/source/common/common.dsp b/icu4c/source/common/common.dsp index 433b252d8ed..2a806da9241 100644 --- a/icu4c/source/common/common.dsp +++ b/icu4c/source/common/common.dsp @@ -108,10 +108,6 @@ SOURCE=.\convert.cpp # End Source File # Begin Source File -SOURCE=.\cpputils.cpp -# End Source File -# Begin Source File - SOURCE=.\cstring.c # End Source File # Begin Source File diff --git a/icu4c/source/common/cpputils.cpp b/icu4c/source/common/cpputils.cpp deleted file mode 100644 index d3e2c2a011f..00000000000 --- a/icu4c/source/common/cpputils.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/********************************************************************** - * Copyright (C) 1999-2001, International Business Machines - * Corporation and others. All Rights Reserved. - **********************************************************************/ - -#include "unicode/utypes.h" -#include "unicode/unistr.h" -#include "cpputils.h" - -/** Simple utility to fill a UChar array from a UnicodeString */ -U_CAPI int32_t U_EXPORT2 -uprv_fillOutputString(const UnicodeString &temp, - UChar *dest, - int32_t destCapacity, - UErrorCode *status) { - int32_t length = temp.length(); - - if (destCapacity > 0) { - // copy the contents; extract() will check if it needs to copy anything at all - temp.extract(0, destCapacity, dest, 0); - - // zero-terminate the dest buffer if possible - if (length < destCapacity) { - dest[length] = 0; - } - } - - // set the error code according to the necessary buffer length - if (length > destCapacity && U_SUCCESS(*status)) { - *status = U_BUFFER_OVERFLOW_ERROR; - } - - // return the full string length - return length; -} diff --git a/icu4c/source/common/cpputils.h b/icu4c/source/common/cpputils.h index 55628e67214..f53b9ae25ac 100644 --- a/icu4c/source/common/cpputils.h +++ b/icu4c/source/common/cpputils.h @@ -17,9 +17,6 @@ #include "unicode/utypes.h" #include "cmemory.h" -// forward declaration -class UnicodeString; - /*==========================================================================*/ /* Array copy utility functions */ /*==========================================================================*/ @@ -57,11 +54,4 @@ uprv_arrayCopy(const UChar *src, int32_t srcStart, UChar *dst, int32_t dstStart, int32_t count) { uprv_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } -/** Simple utility to fill a UChar array from a UnicodeString */ -U_CAPI int32_t U_EXPORT2 -uprv_fillOutputString(const UnicodeString &temp, - UChar *dest, - int32_t destCapacity, - UErrorCode *status); - #endif /* _CPPUTILS */