nsScriptableUConv.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* -*- Mode: C++; tab-width: 2; 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. #ifndef __nsScriptableUConv_h_
  6. #define __nsScriptableUConv_h_
  7. #include "nsIScriptableUConv.h"
  8. #include "nsCOMPtr.h"
  9. #include "nsIUnicodeDecoder.h"
  10. #include "nsIUnicodeEncoder.h"
  11. class nsScriptableUnicodeConverter : public nsIScriptableUnicodeConverter
  12. {
  13. public:
  14. NS_DECL_ISUPPORTS
  15. NS_DECL_NSISCRIPTABLEUNICODECONVERTER
  16. nsScriptableUnicodeConverter();
  17. protected:
  18. virtual ~nsScriptableUnicodeConverter();
  19. nsCString mCharset;
  20. nsCOMPtr<nsIUnicodeEncoder> mEncoder;
  21. nsCOMPtr<nsIUnicodeDecoder> mDecoder;
  22. bool mIsInternal;
  23. nsresult FinishWithLength(char **_retval, int32_t* aLength);
  24. nsresult ConvertFromUnicodeWithLength(const nsAString& aSrc,
  25. int32_t* aOutLen,
  26. char **_retval);
  27. nsresult InitConverter();
  28. };
  29. #endif