Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: core/fxcrt/fx_basic_bstring.cpp

Issue 1979723003: Make CFX_WideString(const CFX_WideString&) explicit. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Override Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdftext/fpdf_text_int.cpp ('k') | core/fxcrt/fx_basic_buffer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cctype> 10 #include <cctype>
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 ASSERT(nIndex < m_pData->m_nDataLength); 813 ASSERT(nIndex < m_pData->m_nDataLength);
814 ReallocBeforeWrite(m_pData->m_nDataLength); 814 ReallocBeforeWrite(m_pData->m_nDataLength);
815 m_pData->m_String[nIndex] = ch; 815 m_pData->m_String[nIndex] = ch;
816 } 816 }
817 817
818 CFX_WideString CFX_ByteString::UTF8Decode() const { 818 CFX_WideString CFX_ByteString::UTF8Decode() const {
819 CFX_UTF8Decoder decoder; 819 CFX_UTF8Decoder decoder;
820 for (FX_STRSIZE i = 0; i < GetLength(); i++) { 820 for (FX_STRSIZE i = 0; i < GetLength(); i++) {
821 decoder.Input((uint8_t)m_pData->m_String[i]); 821 decoder.Input((uint8_t)m_pData->m_String[i]);
822 } 822 }
823 return decoder.GetResult(); 823 return CFX_WideString(decoder.GetResult());
824 } 824 }
825 825
826 // static 826 // static
827 CFX_ByteString CFX_ByteString::FromUnicode(const FX_WCHAR* str, 827 CFX_ByteString CFX_ByteString::FromUnicode(const FX_WCHAR* str,
828 FX_STRSIZE len) { 828 FX_STRSIZE len) {
829 FX_STRSIZE str_len = len >= 0 ? len : FXSYS_wcslen(str); 829 FX_STRSIZE str_len = len >= 0 ? len : FXSYS_wcslen(str);
830 return FromUnicode(CFX_WideString(str, str_len)); 830 return FromUnicode(CFX_WideString(str, str_len));
831 } 831 }
832 832
833 // static 833 // static
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 fraction %= scale; 976 fraction %= scale;
977 scale /= 10; 977 scale /= 10;
978 } 978 }
979 return buf_size; 979 return buf_size;
980 } 980 }
981 CFX_ByteString CFX_ByteString::FormatFloat(FX_FLOAT d, int precision) { 981 CFX_ByteString CFX_ByteString::FormatFloat(FX_FLOAT d, int precision) {
982 FX_CHAR buf[32]; 982 FX_CHAR buf[32];
983 FX_STRSIZE len = FX_ftoa(d, buf); 983 FX_STRSIZE len = FX_ftoa(d, buf);
984 return CFX_ByteString(buf, len); 984 return CFX_ByteString(buf, len);
985 } 985 }
OLDNEW
« no previous file with comments | « core/fpdftext/fpdf_text_int.cpp ('k') | core/fxcrt/fx_basic_buffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698