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

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp

Issue 1862123003: Rename both As{Byte,Wide}StringC() helpers to AsStringC(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase, fix new usage. 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/fpdfapi/fpdf_parser/cpdf_string.cpp ('k') | core/fpdfdoc/cpvt_color.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 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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 "core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h" 7 #include "core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 FX_FILESIZE SavedPos = m_Pos; 392 FX_FILESIZE SavedPos = m_Pos;
393 CFX_ByteString nextword = GetNextWord(&bIsNumber); 393 CFX_ByteString nextword = GetNextWord(&bIsNumber);
394 if (bIsNumber) { 394 if (bIsNumber) {
395 CFX_ByteString nextword2 = GetNextWord(nullptr); 395 CFX_ByteString nextword2 = GetNextWord(nullptr);
396 if (nextword2 == "R") { 396 if (nextword2 == "R") {
397 uint32_t objnum = FXSYS_atoui(word); 397 uint32_t objnum = FXSYS_atoui(word);
398 return new CPDF_Reference(pObjList, objnum); 398 return new CPDF_Reference(pObjList, objnum);
399 } 399 }
400 } 400 }
401 m_Pos = SavedPos; 401 m_Pos = SavedPos;
402 return new CPDF_Number(word.AsByteStringC()); 402 return new CPDF_Number(word.AsStringC());
403 } 403 }
404 404
405 if (word == "true" || word == "false") 405 if (word == "true" || word == "false")
406 return new CPDF_Boolean(word == "true"); 406 return new CPDF_Boolean(word == "true");
407 407
408 if (word == "null") 408 if (word == "null")
409 return new CPDF_Null; 409 return new CPDF_Null;
410 410
411 if (word == "(") { 411 if (word == "(") {
412 CFX_ByteString str = ReadString(); 412 CFX_ByteString str = ReadString();
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 514
515 if (bIsNumber) { 515 if (bIsNumber) {
516 FX_FILESIZE SavedPos = m_Pos; 516 FX_FILESIZE SavedPos = m_Pos;
517 CFX_ByteString nextword = GetNextWord(&bIsNumber); 517 CFX_ByteString nextword = GetNextWord(&bIsNumber);
518 if (bIsNumber) { 518 if (bIsNumber) {
519 CFX_ByteString nextword2 = GetNextWord(nullptr); 519 CFX_ByteString nextword2 = GetNextWord(nullptr);
520 if (nextword2 == "R") 520 if (nextword2 == "R")
521 return new CPDF_Reference(pObjList, FXSYS_atoui(word)); 521 return new CPDF_Reference(pObjList, FXSYS_atoui(word));
522 } 522 }
523 m_Pos = SavedPos; 523 m_Pos = SavedPos;
524 return new CPDF_Number(word.AsByteStringC()); 524 return new CPDF_Number(word.AsStringC());
525 } 525 }
526 526
527 if (word == "true" || word == "false") 527 if (word == "true" || word == "false")
528 return new CPDF_Boolean(word == "true"); 528 return new CPDF_Boolean(word == "true");
529 529
530 if (word == "null") 530 if (word == "null")
531 return new CPDF_Null; 531 return new CPDF_Null;
532 532
533 if (word == "(") { 533 if (word == "(") {
534 CFX_ByteString str = ReadString(); 534 CFX_ByteString str = ReadString();
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 if (limit && m_Pos == limit) 981 if (limit && m_Pos == limit)
982 return -1; 982 return -1;
983 } 983 }
984 return -1; 984 return -1;
985 } 985 }
986 986
987 void CPDF_SyntaxParser::SetEncrypt( 987 void CPDF_SyntaxParser::SetEncrypt(
988 std::unique_ptr<IPDF_CryptoHandler> pCryptoHandler) { 988 std::unique_ptr<IPDF_CryptoHandler> pCryptoHandler) {
989 m_pCryptoHandler = std::move(pCryptoHandler); 989 m_pCryptoHandler = std::move(pCryptoHandler);
990 } 990 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_string.cpp ('k') | core/fpdfdoc/cpvt_color.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698