intl/locale/src/nsPlatformCharset.h
author Makoto Kato <m_kato@ga2.so-net.ne.jp>
Fri, 25 May 2012 18:36:19 +0900
changeset 97212 3f363fd3a7e5e64a6a654c4d5b401bf88af0e48b
parent 96742 f4157e8c410708d76703f19e4dfb61859bfe32d8
child 204152 12985d7bd06a6fb901b7c2fb55a5b86353d57660
permissions -rw-r--r--
Bug 752406 - Remove locale.OSTYPE in unixcharset.properties. r=smontagu

/* -*- Mode: C; tab-width: 4; 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 http://mozilla.org/MPL/2.0/. */
#ifndef nsPlatformCharset_h__
#define nsPlatformCharset_h__

#include "nsIPlatformCharset.h"

class nsPlatformCharset : public nsIPlatformCharset
{
  NS_DECL_ISUPPORTS

public:

  nsPlatformCharset();
  virtual ~nsPlatformCharset();

  NS_IMETHOD Init();
  NS_IMETHOD GetCharset(nsPlatformCharsetSel selector, nsACString& oResult);
  NS_IMETHOD GetDefaultCharsetForLocale(const nsAString& localeName, nsACString& oResult);

private:
  nsCString mCharset;
  nsString mLocale; // remember the locale & charset

  nsresult MapToCharset(nsAString& inANSICodePage, nsACString& outCharset);
  nsresult InitGetCharset(nsACString& oString);
  nsresult VerifyCharset(nsCString &aCharset);
};

#endif // nsPlatformCharset_h__