diff options
Diffstat (limited to 'sal/qa/rtl_strings/rtl_String_Utils.cxx')
-rw-r--r-- | sal/qa/rtl_strings/rtl_String_Utils.cxx | 213 |
1 files changed, 0 insertions, 213 deletions
diff --git a/sal/qa/rtl_strings/rtl_String_Utils.cxx b/sal/qa/rtl_strings/rtl_String_Utils.cxx index acc2dbfaa..29cede88b 100644 --- a/sal/qa/rtl_strings/rtl_String_Utils.cxx +++ b/sal/qa/rtl_strings/rtl_String_Utils.cxx @@ -185,63 +185,6 @@ void makeComment( char *com, const char *str1, const char *str2, com[str1Length + signLength + AStringLen(str2)] = 0; } - -//------------------------------------------------------------------------ - -sal_Bool AStringToFloatCompare ( const sal_Char *pStr, - const float nX, - const float nEPS - ) -{ - sal_Bool cmp = sal_False; - - if ( pStr != NULL ) - { - ::rtl::OString aStr(pStr); - - float actNum = 0; - float expNum = nX; - float eps = nEPS; - - actNum = aStr.toFloat(); - - if ( abs( (int)(actNum - expNum) ) <= eps ) - { - cmp = sal_True; - } // if - } // if - - return cmp; -} // AStringToFloatCompare - -//------------------------------------------------------------------------ - -sal_Bool AStringToDoubleCompare ( const sal_Char *pStr, - const double nX, - const double nEPS - ) -{ - sal_Bool cmp = sal_False; - - if ( pStr != NULL ) - { - ::rtl::OString aStr(pStr); - - double actNum = 0; - double expNum = nX; - double eps = nEPS; - - actNum = aStr.toDouble(); - - if ( abs( (int)(actNum - expNum) ) <= eps ) - { - cmp = sal_True; - } // if - } // if - - return cmp; -} // AStringToDoubleCompare - sal_uInt32 UStringLen( const sal_Unicode *pUStr ) { sal_uInt32 nUStrLen = 0; @@ -377,160 +320,4 @@ sal_Int32 AStringToUStringNCompare( const sal_Unicode *pUStr, return nCmp; } // AStringToUStringNCompare -//------------------------------------------------------------------------ - -sal_Int32 AStringToRTLUStringCompare( const rtl_uString *pRTLUStr, - const sal_Char *pAStr - ) -{ - sal_Int32 nCmp = kErrCompareAStringToRTLUString; - - if ( ( pRTLUStr != NULL ) && ( pAStr != NULL ) ) - { - rtl_uString *pRTLUStrCopy = NULL; - - rtl_uString_newFromString( &pRTLUStrCopy, pRTLUStr ); - - if ( pRTLUStrCopy != NULL ) - { - const sal_Unicode *pUStr = rtl_uString_getStr( pRTLUStrCopy ); - - if ( pUStr != NULL ) - { - nCmp = AStringToUStringCompare( pUStr, pAStr ); - } // if - - rtl_uString_release( pRTLUStrCopy ); - - pRTLUStrCopy = NULL; - } // if - } // if - - return nCmp; -} // AStringToRTLUStringCompare - -//------------------------------------------------------------------------ - -sal_Int32 AStringToRTLUStringNCompare( const rtl_uString *pRTLUStr, - const sal_Char *pAStr, - const sal_uInt32 nAStrCount - ) -{ - sal_Int32 nCmp = kErrCompareNAStringToRTLUString; - - if ( ( pRTLUStr != NULL ) && ( pAStr != NULL ) ) - { - rtl_uString *pRTLUStrCopy = NULL; - - rtl_uString_newFromString( &pRTLUStrCopy, pRTLUStr ); - - if ( pRTLUStrCopy != NULL ) - { - const sal_Unicode *pUStr = rtl_uString_getStr( pRTLUStrCopy ); - - if ( pUStr != NULL ) - { - nCmp = AStringToUStringNCompare( pUStr, pAStr, nAStrCount ); - } // if - - rtl_uString_release( pRTLUStrCopy ); - - pRTLUStrCopy = NULL; - } // if - } // if - - return nCmp; -} // AStringToRTLUStringNCompare - -//------------------------------------------------------------------------ - -sal_Bool AStringToUStringCopy( sal_Unicode *pDest, - const sal_Char *pSrc - ) -{ - sal_Bool bCopied = sal_False; - sal_uInt32 nCount = AStringLen( pSrc ); - sal_uInt32 nLen = nCount; - - if ( ( pDest != NULL ) - && ( pSrc != NULL ) - && ( AStringNIsValid( pSrc, nLen ) ) - ) - { - while ( nCount >= 0 ) - { - *pDest = (unsigned char)*pSrc; - - pDest++; - pSrc++; - - // Since we are dealing with unsigned integers - // we want to make sure that the last number is - // indeed zero. - - if ( nCount > 0 ) - { - nCount--; - } // if - else - { - break; - } // else - } // while - - if ( nCount == 0 ) - { - bCopied = sal_True; - } // if - } // if - - return bCopied; -} // AStringToUStringCopy - -//------------------------------------------------------------------------ - -sal_Bool AStringToUStringNCopy( sal_Unicode *pDest, - const sal_Char *pSrc, - const sal_uInt32 nSrcLen - ) -{ - sal_Bool bCopied = sal_False; - sal_uInt32 nCount = nSrcLen; - sal_uInt32 nLen = nSrcLen; - - if ( ( pDest != NULL ) - && ( pSrc != NULL ) - && ( AStringNIsValid( pSrc, nLen ) ) - ) - { - while ( nCount >= 0 ) - { - *pDest = (unsigned char)*pSrc; - - pDest++; - pSrc++; - - // Since we are dealing with unsigned integers - // we want to make sure that the last number is - // indeed zero. - - if ( nCount > 0 ) - { - nCount--; - } // if - else - { - break; - } // else - } // while - - if ( nCount == 0 ) - { - bCopied = sal_True; - } // if - } // if - - return bCopied; -} // AStringToUStringNCopy - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |