diff options
Diffstat (limited to 'core/fxcrt')
-rw-r--r-- | core/fxcrt/fx_basic_buffer.cpp | 6 | ||||
-rw-r--r-- | core/fxcrt/fx_xml_parser.cpp | 10 | ||||
-rw-r--r-- | core/fxcrt/include/fx_basic.h | 8 |
3 files changed, 12 insertions, 12 deletions
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<const FX_WCHAR*>(m_pBuffer.get()), m_DataSize / sizeof(FX_WCHAR)); } diff --git a/core/fxcrt/fx_xml_parser.cpp b/core/fxcrt/fx_xml_parser.cpp index b4df4d0532..4b52189142 100644 --- a/core/fxcrt/fx_xml_parser.cpp +++ b/core/fxcrt/fx_xml_parser.cpp @@ -132,7 +132,7 @@ void CXML_Parser::GetName(CFX_ByteString& space, CFX_ByteString& name) { while (m_dwIndex < m_dwBufferSize) { ch = m_pBuffer[m_dwIndex]; if (ch == ':') { - space = buf.GetByteString(); + space = buf.AsStringC(); buf.Clear(); } else if (g_FXCRT_XML_IsNameChar(ch)) { buf.AppendChar(ch); @@ -146,7 +146,7 @@ void CXML_Parser::GetName(CFX_ByteString& space, CFX_ByteString& name) { break; } } while (ReadNextBlock()); - name = buf.GetByteString(); + name = buf.AsStringC(); } void CXML_Parser::SkipLiterals(const CFX_ByteStringC& str) { m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex; @@ -202,7 +202,7 @@ uint32_t CXML_Parser::GetCharRef() { case 1: m_dwIndex++; if (ch == ';') { - CFX_ByteStringC ref = buf.GetByteString(); + CFX_ByteStringC ref = buf.AsStringC(); if (ref == "gt") { code = '>'; } else if (ref == "lt") { @@ -457,7 +457,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, iState = 10; } else { content << decoder.GetResult(); - CFX_WideString dataStr = content.GetWideString(); + CFX_WideString dataStr = content.AsStringC(); if (!bCDATA && !m_bSaveSpaceChars) { dataStr.TrimRight(L" \t\r\n"); } @@ -501,7 +501,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, } } while (ReadNextBlock()); content << decoder.GetResult(); - CFX_WideString dataStr = content.GetWideString(); + CFX_WideString dataStr = content.AsStringC(); if (!m_bSaveSpaceChars) { dataStr.TrimRight(L" \t\r\n"); } diff --git a/core/fxcrt/include/fx_basic.h b/core/fxcrt/include/fx_basic.h index 1b64a5924f..5a577c2e54 100644 --- a/core/fxcrt/include/fx_basic.h +++ b/core/fxcrt/include/fx_basic.h @@ -58,7 +58,7 @@ class CFX_ByteTextBuf : public CFX_BinaryBuf { public: void AppendChar(int ch) { AppendByte((uint8_t)ch); } FX_STRSIZE GetLength() const { return m_DataSize; } - CFX_ByteStringC GetByteString() const; + CFX_ByteStringC AsStringC() const; CFX_ByteTextBuf& operator<<(int i); CFX_ByteTextBuf& operator<<(uint32_t i); @@ -80,7 +80,7 @@ class CFX_WideTextBuf : public CFX_BinaryBuf { FX_WCHAR* GetBuffer() const { return reinterpret_cast<FX_WCHAR*>(m_pBuffer.get()); } - CFX_WideStringC GetWideString() const; + CFX_WideStringC AsStringC() const; void Delete(int start_index, int count) { CFX_BinaryBuf::Delete(start_index * sizeof(FX_WCHAR), @@ -206,7 +206,7 @@ class CFX_UTF8Decoder { void ClearStatus() { m_PendingBytes = 0; } - CFX_WideStringC GetResult() const { return m_Buffer.GetWideString(); } + CFX_WideStringC GetResult() const { return m_Buffer.AsStringC(); } protected: int m_PendingBytes; @@ -222,7 +222,7 @@ class CFX_UTF8Encoder { void Input(FX_WCHAR unicode); void AppendStr(const CFX_ByteStringC& str) { m_Buffer << str; } - CFX_ByteStringC GetResult() const { return m_Buffer.GetByteString(); } + CFX_ByteStringC GetResult() const { return m_Buffer.AsStringC(); } protected: CFX_ByteTextBuf m_Buffer; |