From f4bb580add3824196dc49cd7de2f7d051019ede8 Mon Sep 17 00:00:00 2001 From: weili Date: Tue, 14 Jun 2016 17:21:14 -0700 Subject: Make code compile with clang_use_chrome_plugin (part II) This change contains files in core directory which were not covered in part I. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups; BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2060913003 --- core/fxcrt/fx_basic_bstring.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'core/fxcrt/fx_basic_bstring.cpp') diff --git a/core/fxcrt/fx_basic_bstring.cpp b/core/fxcrt/fx_basic_bstring.cpp index 379f1ee882..d0ba1af5ba 100644 --- a/core/fxcrt/fx_basic_bstring.cpp +++ b/core/fxcrt/fx_basic_bstring.cpp @@ -94,11 +94,23 @@ CFX_ByteString::CFX_ByteString(const uint8_t* pStr, FX_STRSIZE nLen) { } } +CFX_ByteString::CFX_ByteString() {} + +CFX_ByteString::CFX_ByteString(const CFX_ByteString& other) + : m_pData(other.m_pData) {} + +CFX_ByteString::CFX_ByteString(CFX_ByteString&& other) { + m_pData.Swap(other.m_pData); +} + CFX_ByteString::CFX_ByteString(char ch) { m_pData.Reset(StringData::Create(1)); m_pData->m_String[0] = ch; } +CFX_ByteString::CFX_ByteString(const FX_CHAR* ptr) + : CFX_ByteString(ptr, ptr ? FXSYS_strlen(ptr) : 0) {} + CFX_ByteString::CFX_ByteString(const CFX_ByteStringC& stringSrc) { if (!stringSrc.IsEmpty()) m_pData.Reset(StringData::Create(stringSrc.c_str(), stringSrc.GetLength())); -- cgit v1.2.3