1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/unicharutil/src/nsCaseConversionImp2.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,62 @@ 1.4 +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsCaseConversionImp2.h" 1.10 +#include "nsUnicharUtils.h" 1.11 + 1.12 +NS_IMETHODIMP_(MozExternalRefCountType) nsCaseConversionImp2::AddRef(void) 1.13 +{ 1.14 + return (MozExternalRefCountType)1; 1.15 +} 1.16 + 1.17 +NS_IMETHODIMP_(MozExternalRefCountType) nsCaseConversionImp2::Release(void) 1.18 +{ 1.19 + return (MozExternalRefCountType)1; 1.20 +} 1.21 + 1.22 +NS_IMPL_QUERY_INTERFACE(nsCaseConversionImp2, nsICaseConversion) 1.23 + 1.24 +NS_IMETHODIMP nsCaseConversionImp2::ToUpper(char16_t aChar, char16_t* aReturn) 1.25 +{ 1.26 + *aReturn = ToUpperCase(aChar); 1.27 + return NS_OK; 1.28 +} 1.29 + 1.30 +NS_IMETHODIMP nsCaseConversionImp2::ToLower(char16_t aChar, char16_t* aReturn) 1.31 +{ 1.32 + *aReturn = ToLowerCase(aChar); 1.33 + return NS_OK; 1.34 +} 1.35 + 1.36 +NS_IMETHODIMP nsCaseConversionImp2::ToTitle(char16_t aChar, char16_t* aReturn) 1.37 +{ 1.38 + *aReturn = ToTitleCase(aChar); 1.39 + return NS_OK; 1.40 +} 1.41 + 1.42 +NS_IMETHODIMP nsCaseConversionImp2::ToUpper(const char16_t* anArray, 1.43 + char16_t* aReturn, 1.44 + uint32_t aLen) 1.45 +{ 1.46 + ToUpperCase(anArray, aReturn, aLen); 1.47 + return NS_OK; 1.48 +} 1.49 + 1.50 +NS_IMETHODIMP nsCaseConversionImp2::ToLower(const char16_t* anArray, 1.51 + char16_t* aReturn, 1.52 + uint32_t aLen) 1.53 +{ 1.54 + ToLowerCase(anArray, aReturn, aLen); 1.55 + return NS_OK; 1.56 +} 1.57 + 1.58 +NS_IMETHODIMP 1.59 +nsCaseConversionImp2::CaseInsensitiveCompare(const char16_t *aLeft, 1.60 + const char16_t *aRight, 1.61 + uint32_t aCount, int32_t* aResult) 1.62 +{ 1.63 + *aResult = ::CaseInsensitiveCompare(aLeft, aRight, aCount); 1.64 + return NS_OK; 1.65 +}