|
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "nsCaseConversionImp2.h" |
|
7 #include "nsUnicharUtils.h" |
|
8 |
|
9 NS_IMETHODIMP_(MozExternalRefCountType) nsCaseConversionImp2::AddRef(void) |
|
10 { |
|
11 return (MozExternalRefCountType)1; |
|
12 } |
|
13 |
|
14 NS_IMETHODIMP_(MozExternalRefCountType) nsCaseConversionImp2::Release(void) |
|
15 { |
|
16 return (MozExternalRefCountType)1; |
|
17 } |
|
18 |
|
19 NS_IMPL_QUERY_INTERFACE(nsCaseConversionImp2, nsICaseConversion) |
|
20 |
|
21 NS_IMETHODIMP nsCaseConversionImp2::ToUpper(char16_t aChar, char16_t* aReturn) |
|
22 { |
|
23 *aReturn = ToUpperCase(aChar); |
|
24 return NS_OK; |
|
25 } |
|
26 |
|
27 NS_IMETHODIMP nsCaseConversionImp2::ToLower(char16_t aChar, char16_t* aReturn) |
|
28 { |
|
29 *aReturn = ToLowerCase(aChar); |
|
30 return NS_OK; |
|
31 } |
|
32 |
|
33 NS_IMETHODIMP nsCaseConversionImp2::ToTitle(char16_t aChar, char16_t* aReturn) |
|
34 { |
|
35 *aReturn = ToTitleCase(aChar); |
|
36 return NS_OK; |
|
37 } |
|
38 |
|
39 NS_IMETHODIMP nsCaseConversionImp2::ToUpper(const char16_t* anArray, |
|
40 char16_t* aReturn, |
|
41 uint32_t aLen) |
|
42 { |
|
43 ToUpperCase(anArray, aReturn, aLen); |
|
44 return NS_OK; |
|
45 } |
|
46 |
|
47 NS_IMETHODIMP nsCaseConversionImp2::ToLower(const char16_t* anArray, |
|
48 char16_t* aReturn, |
|
49 uint32_t aLen) |
|
50 { |
|
51 ToLowerCase(anArray, aReturn, aLen); |
|
52 return NS_OK; |
|
53 } |
|
54 |
|
55 NS_IMETHODIMP |
|
56 nsCaseConversionImp2::CaseInsensitiveCompare(const char16_t *aLeft, |
|
57 const char16_t *aRight, |
|
58 uint32_t aCount, int32_t* aResult) |
|
59 { |
|
60 *aResult = ::CaseInsensitiveCompare(aLeft, aRight, aCount); |
|
61 return NS_OK; |
|
62 } |