diff options
Diffstat (limited to 'tools/source/string/tustring.cxx')
-rw-r--r-- | tools/source/string/tustring.cxx | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx deleted file mode 100644 index cc4f27d3915b..000000000000 --- a/tools/source/string/tustring.cxx +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <string.h> - -#include "boost/static_assert.hpp" - -#include <osl/interlck.h> -#include <rtl/alloc.h> -#include <rtl/tencinfo.h> -#include <rtl/instance.hxx> -#include <tools/string.hxx> - -#include <impstrg.hxx> - -#include <tools/debug.hxx> - -DBG_NAME( UniString ) - -#define STRCODE sal_Unicode -#define STRCODEU sal_Unicode -#define STRING UniString -#define STRINGDATA UniStringData -#define STRING_TYPE rtl_uString -#define STRING_ACQUIRE rtl_uString_acquire -#define STRING_RELEASE rtl_uString_release -#define STRING_NEW rtl_uString_new - -#include <strimp.cxx> -#include <strucvt.cxx> - -StringCompare STRING::CompareTo( const STRING& rStr, xub_StrLen nLen ) const -{ - if ( mpData == rStr.mpData ) - return COMPARE_EQUAL; - - // determine maximal length - if ( mpData->mnLen < nLen ) - nLen = static_cast< xub_StrLen >(mpData->mnLen+1); - if ( rStr.mpData->mnLen < nLen ) - nLen = static_cast< xub_StrLen >(rStr.mpData->mnLen+1); - - sal_Int32 nCompare = ImplStringCompareWithoutZero( mpData->maStr, rStr.mpData->maStr, nLen ); - - if ( nCompare == 0 ) - return COMPARE_EQUAL; - else if ( nCompare < 0 ) - return COMPARE_LESS; - else - return COMPARE_GREATER; -} - -sal_Bool operator==(const UniString& rStr1, const UniString& rStr2) -{ - if ( rStr1.mpData == rStr2.mpData ) - return sal_True; - - if ( rStr1.mpData->mnLen != rStr2.mpData->mnLen ) - return sal_False; - - return (ImplStringCompareWithoutZero( rStr1.mpData->maStr, rStr2.mpData->maStr, rStr1.mpData->mnLen ) == 0); -} - -xub_StrLen ImplStringLen( const sal_Char* pStr ) -{ - const sal_Char* pTempStr = pStr; - while( *pTempStr ) - ++pTempStr; - return (xub_StrLen)(pTempStr-pStr); -} - -xub_StrLen ImplStringLen( const sal_Unicode* pStr ) -{ - const sal_Unicode* pTempStr = pStr; - while( *pTempStr ) - ++pTempStr; - return (xub_StrLen)(pTempStr-pStr); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |