From 8e4c505ff6d82263183e9f812fcc7b45c1414f15 Mon Sep 17 00:00:00 2001 From: tsepez Date: Thu, 14 Apr 2016 13:42:44 -0700 Subject: Rename CFX_ByteTextBuf::GetByteString() to AsStringC(). Do the same for CFX_WideTextBuf as well. The name is confusing because these return CFX_ByteStringC, not CFX_ByteString. The AsStringC naming gives parallelism with the string types themselves, and may help to indicate that the result is only good for the lifetime of the object being operated upon. Review URL: https://codereview.chromium.org/1886263003 --- core/fxcrt/fx_basic_buffer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/fxcrt/fx_basic_buffer.cpp') diff --git a/core/fxcrt/fx_basic_buffer.cpp b/core/fxcrt/fx_basic_buffer.cpp index 1e5d0554d1..338edc16c9 100644 --- a/core/fxcrt/fx_basic_buffer.cpp +++ b/core/fxcrt/fx_basic_buffer.cpp @@ -100,7 +100,7 @@ void CFX_BinaryBuf::InsertBlock(FX_STRSIZE pos, m_DataSize += size; } -CFX_ByteStringC CFX_ByteTextBuf::GetByteString() const { +CFX_ByteStringC CFX_ByteTextBuf::AsStringC() const { return CFX_ByteStringC(m_pBuffer.get(), m_DataSize); } @@ -186,8 +186,8 @@ CFX_WideTextBuf& CFX_WideTextBuf::operator<<(const CFX_WideTextBuf& buf) { return *this; } -CFX_WideStringC CFX_WideTextBuf::GetWideString() const { - return CFX_WideStringC((const FX_WCHAR*)m_pBuffer.get(), +CFX_WideStringC CFX_WideTextBuf::AsStringC() const { + return CFX_WideStringC(reinterpret_cast(m_pBuffer.get()), m_DataSize / sizeof(FX_WCHAR)); } -- cgit v1.2.3