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

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

Issue 1888103002: Replace calls to deprecated CFX_{Wide,Byte}String::Empty() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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 | « core/fxcodec/lgif/fx_gif.cpp ('k') | core/fxcrt/include/fx_string.h » ('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 <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "core/fxcrt/include/fx_basic.h" 10 #include "core/fxcrt/include/fx_basic.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(FX_FLOAT& i) { 283 CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(FX_FLOAT& i) {
284 Read(&i, sizeof(FX_FLOAT)); 284 Read(&i, sizeof(FX_FLOAT));
285 return *this; 285 return *this;
286 } 286 }
287 CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(CFX_ByteString& str) { 287 CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(CFX_ByteString& str) {
288 if (m_LoadingPos + 4 > m_LoadingSize) { 288 if (m_LoadingPos + 4 > m_LoadingSize) {
289 return *this; 289 return *this;
290 } 290 }
291 int len; 291 int len;
292 operator>>(len); 292 operator>>(len);
293 str.Empty(); 293 str.clear();
294 if (len <= 0 || m_LoadingPos + len > m_LoadingSize) { 294 if (len <= 0 || m_LoadingPos + len > m_LoadingSize) {
295 return *this; 295 return *this;
296 } 296 }
297 FX_CHAR* buffer = str.GetBuffer(len); 297 FX_CHAR* buffer = str.GetBuffer(len);
298 FXSYS_memcpy(buffer, m_pLoadingBuf + m_LoadingPos, len); 298 FXSYS_memcpy(buffer, m_pLoadingBuf + m_LoadingPos, len);
299 str.ReleaseBuffer(len); 299 str.ReleaseBuffer(len);
300 m_LoadingPos += len; 300 m_LoadingPos += len;
301 return *this; 301 return *this;
302 } 302 }
303 CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(CFX_WideString& str) { 303 CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(CFX_WideString& str) {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 } 419 }
420 420
421 int32_t CFX_FileBufferArchive::AppendString(const CFX_ByteStringC& lpsz) { 421 int32_t CFX_FileBufferArchive::AppendString(const CFX_ByteStringC& lpsz) {
422 return AppendBlock(lpsz.raw_str(), lpsz.GetLength()); 422 return AppendBlock(lpsz.raw_str(), lpsz.GetLength());
423 } 423 }
424 424
425 void CFX_FileBufferArchive::AttachFile(IFX_StreamWrite* pFile) { 425 void CFX_FileBufferArchive::AttachFile(IFX_StreamWrite* pFile) {
426 FXSYS_assert(pFile); 426 FXSYS_assert(pFile);
427 m_pFile = pFile; 427 m_pFile = pFile;
428 } 428 }
OLDNEW
« no previous file with comments | « core/fxcodec/lgif/fx_gif.cpp ('k') | core/fxcrt/include/fx_string.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698