From 11d33361e95d5ea61ee43e4261fa8f53aa372731 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 19 Feb 2016 14:26:46 -0800 Subject: Get rid of CFX_CharMap instantiations. The only thing left are a couple of static methods. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1711273002 . --- core/include/fxcrt/fx_basic.h | 16 ++++++++-------- core/include/fxcrt/fx_string.h | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'core/include/fxcrt') diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h index 4402856996..3e30b1d1a1 100644 --- a/core/include/fxcrt/fx_basic.h +++ b/core/include/fxcrt/fx_basic.h @@ -221,17 +221,17 @@ class CFX_FileBufferArchive : public IFX_BufferArchive { FX_BOOL m_bTakeover; }; -struct CFX_CharMap { - static CFX_CharMap* GetDefaultMapper(int32_t codepage = 0); - - CFX_WideString (*m_GetWideString)(CFX_CharMap* pMap, - const CFX_ByteString& bstr); +class CFX_CharMap { + public: + static CFX_ByteString GetByteString(FX_WORD codepage, + const CFX_WideString& wstr); - CFX_ByteString (*m_GetByteString)(CFX_CharMap* pMap, - const CFX_WideString& wstr); + static CFX_WideString GetWideString(FX_WORD codepage, + const CFX_ByteString& bstr); - int32_t (*m_GetCodePage)(); + CFX_CharMap() = delete; }; + class CFX_UTF8Decoder { public: CFX_UTF8Decoder() { m_PendingBytes = 0; } diff --git a/core/include/fxcrt/fx_string.h b/core/include/fxcrt/fx_string.h index c625bfa925..ca29e1321a 100644 --- a/core/include/fxcrt/fx_string.h +++ b/core/include/fxcrt/fx_string.h @@ -16,7 +16,6 @@ class CFX_BinaryBuf; class CFX_ByteString; class CFX_WideString; -struct CFX_CharMap; // An immutable string with caller-provided storage which must outlive the // string itself. -- cgit v1.2.3