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

Side by Side Diff: xfa/fgas/crt/fgas_stream.cpp

Issue 1857713003: Rename GetCStr and GetPtr to match CFX_ByteString (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 8 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 | « xfa/fee/fde_txtedtengine.cpp ('k') | xfa/fgas/localization/fgas_locale.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 "xfa/fgas/crt/fgas_stream.h" 7 #include "xfa/fgas/crt/fgas_stream.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 if ((m_pStreamImp->GetAccessModes() & FX_STREAMACCESS_Write) == 0) { 1105 if ((m_pStreamImp->GetAccessModes() & FX_STREAMACCESS_Write) == 0) {
1106 return -1; 1106 return -1;
1107 } 1107 }
1108 if (m_wCodePage == FX_CODEPAGE_UTF8) { 1108 if (m_wCodePage == FX_CODEPAGE_UTF8) {
1109 int32_t len = iLength; 1109 int32_t len = iLength;
1110 CFX_UTF8Encoder encoder; 1110 CFX_UTF8Encoder encoder;
1111 while (len-- > 0) { 1111 while (len-- > 0) {
1112 encoder.Input(*pStr++); 1112 encoder.Input(*pStr++);
1113 } 1113 }
1114 CFX_ByteStringC bsResult = encoder.GetResult(); 1114 CFX_ByteStringC bsResult = encoder.GetResult();
1115 m_pStreamImp->WriteData((const uint8_t*)bsResult.GetCStr(), 1115 m_pStreamImp->WriteData((const uint8_t*)bsResult.c_str(),
1116 bsResult.GetLength()); 1116 bsResult.GetLength());
1117 } 1117 }
1118 return iLength; 1118 return iLength;
1119 } 1119 }
1120 CFX_Stream::CFX_Stream() 1120 CFX_Stream::CFX_Stream()
1121 : m_eStreamType(FX_SREAMTYPE_Unknown), 1121 : m_eStreamType(FX_SREAMTYPE_Unknown),
1122 m_pStreamImp(NULL), 1122 m_pStreamImp(NULL),
1123 m_dwAccess(0), 1123 m_dwAccess(0),
1124 m_iTotalSize(0), 1124 m_iTotalSize(0),
1125 m_iPosition(0), 1125 m_iPosition(0),
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 return m_pStream->WriteData((const uint8_t*)pData, (int32_t)size) == 1619 return m_pStream->WriteData((const uint8_t*)pData, (int32_t)size) ==
1620 (int32_t)size; 1620 (int32_t)size;
1621 } 1621 }
1622 FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, 1622 FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData,
1623 FX_FILESIZE offset, 1623 FX_FILESIZE offset,
1624 size_t size) { 1624 size_t size) {
1625 m_pStream->Seek(FX_STREAMSEEK_Begin, offset); 1625 m_pStream->Seek(FX_STREAMSEEK_Begin, offset);
1626 int32_t iLen = m_pStream->WriteData((uint8_t*)pData, (int32_t)size); 1626 int32_t iLen = m_pStream->WriteData((uint8_t*)pData, (int32_t)size);
1627 return iLen == (int32_t)size; 1627 return iLen == (int32_t)size;
1628 } 1628 }
OLDNEW
« no previous file with comments | « xfa/fee/fde_txtedtengine.cpp ('k') | xfa/fgas/localization/fgas_locale.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698