Bumping manifests a=b2g-bump
[gecko.git] / intl / locale / nsCollation.h
blob389616bbb25e3819a882d9bd46f5b41cd6e2ab1c
2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsCollation_h__
8 #define nsCollation_h__
11 #include "nsICollation.h"
12 #include "nsCOMPtr.h"
13 #include "mozilla/Attributes.h"
15 class nsIUnicodeEncoder;
17 // Create a collation interface for an input locale.
18 //
19 class nsCollationFactory MOZ_FINAL : public nsICollationFactory {
21 ~nsCollationFactory() {}
23 public:
24 NS_DECL_ISUPPORTS
26 NS_IMETHOD CreateCollation(nsILocale* locale, nsICollation** instancePtr);
28 nsCollationFactory() {}
32 struct nsCollation {
34 public:
36 nsCollation();
38 ~nsCollation();
40 // normalize string before collation key generation
41 nsresult NormalizeString(const nsAString& stringIn, nsAString& stringOut);
43 // charset conversion util, C string buffer is allocate by PR_Malloc, caller should call PR_Free
44 nsresult SetCharset(const char* aCharset);
45 nsresult UnicodeToChar(const nsAString& aSrc, char** dst);
47 protected:
48 nsCOMPtr <nsIUnicodeEncoder> mEncoder;
51 #endif /* nsCollation_h__ */