author Nathan Froyd <>
Thu, 19 Feb 2015 10:35:08 -0500
changeset 258774 0645b0eeb7202ee9e3aa0a0fe90b2affabbc79bc
parent 249862 cdbe4d2202d7b7451398a92a2e73b9b341d89d27
child 259646 a20c7910a82fa2df2f3398c1108d102bac9128b0
permissions -rw-r--r--
Bug 1134633 - convert makefile rules with to use GENERATED_FILES; r=mshal Now that GENERATED_FILES can generate makefile rules for generating files, we can start moving rules from's into

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * 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 */
#ifndef nsCollation_h__
#define nsCollation_h__

#include "nsICollation.h"
#include "nsCOMPtr.h"
#include "mozilla/Attributes.h"

class nsIUnicodeEncoder;

// Create a collation interface for an input locale.
class nsCollationFactory MOZ_FINAL : public nsICollationFactory {

  ~nsCollationFactory() {}


  NS_IMETHOD CreateCollation(nsILocale* locale, nsICollation** instancePtr) MOZ_OVERRIDE;

  nsCollationFactory() {}

struct nsCollation {



  // normalize string before collation key generation
  nsresult NormalizeString(const nsAString& stringIn, nsAString& stringOut);

  // charset conversion util, C string buffer is allocate by PR_Malloc, caller should call PR_Free
  nsresult SetCharset(const char* aCharset);
  nsresult UnicodeToChar(const nsAString& aSrc, char** dst);

  nsCOMPtr <nsIUnicodeEncoder>            mEncoder;

#endif  /* nsCollation_h__ */