OLD | NEW |
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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 CFX_ByteString word = GetNextWord(&bIsNumber); | 387 CFX_ByteString word = GetNextWord(&bIsNumber); |
388 if (word.GetLength() == 0) | 388 if (word.GetLength() == 0) |
389 return nullptr; | 389 return nullptr; |
390 | 390 |
391 if (bIsNumber) { | 391 if (bIsNumber) { |
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.c_str()); |
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.AsStringC()); | 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 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 CFX_ByteString word = GetNextWord(&bIsNumber); | 511 CFX_ByteString word = GetNextWord(&bIsNumber); |
512 if (word.GetLength() == 0) | 512 if (word.GetLength() == 0) |
513 return nullptr; | 513 return nullptr; |
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.c_str())); |
522 } | 522 } |
523 m_Pos = SavedPos; | 523 m_Pos = SavedPos; |
524 return new CPDF_Number(word.AsStringC()); | 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; |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |