2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef __nsScriptableUConv_h_
|
|
|
|
#define __nsScriptableUConv_h_
|
|
|
|
|
|
|
|
#include "nsIScriptableUConv.h"
|
2014-05-08 02:32:00 -07:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIUnicodeDecoder.h"
|
|
|
|
#include "nsIUnicodeEncoder.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsScriptableUnicodeConverter : public nsIScriptableUnicodeConverter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSISCRIPTABLEUNICODECONVERTER
|
|
|
|
|
|
|
|
nsScriptableUnicodeConverter();
|
|
|
|
|
|
|
|
protected:
|
2014-06-23 15:40:02 -07:00
|
|
|
virtual ~nsScriptableUnicodeConverter();
|
|
|
|
|
2008-06-30 11:46:47 -07:00
|
|
|
nsCString mCharset;
|
2007-03-22 10:30:00 -07:00
|
|
|
nsCOMPtr<nsIUnicodeEncoder> mEncoder;
|
|
|
|
nsCOMPtr<nsIUnicodeDecoder> mDecoder;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mIsInternal;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
nsresult FinishWithLength(char **_retval, int32_t* aLength);
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult ConvertFromUnicodeWithLength(const nsAString& aSrc,
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t* aOutLen,
|
2007-03-22 10:30:00 -07:00
|
|
|
char **_retval);
|
|
|
|
|
|
|
|
|
|
|
|
nsresult InitConverter();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|