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

Side by Side Diff: core/include/fpdfapi/fpdf_parser.h

Issue 1558083002: Change CPDF_SyntaxParser::GetNextWord() to not pass by non-const ref. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 11 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
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 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ 8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
9 9
10 #include <map> 10 #include <map>
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 void SetEncrypt(CPDF_CryptoHandler* pCryptoHandler) { 290 void SetEncrypt(CPDF_CryptoHandler* pCryptoHandler) {
291 m_pCryptoHandler.reset(pCryptoHandler); 291 m_pCryptoHandler.reset(pCryptoHandler);
292 } 292 }
293 293
294 FX_BOOL IsEncrypted() { return m_pCryptoHandler != NULL; } 294 FX_BOOL IsEncrypted() { return m_pCryptoHandler != NULL; }
295 295
296 FX_BOOL GetCharAt(FX_FILESIZE pos, uint8_t& ch); 296 FX_BOOL GetCharAt(FX_FILESIZE pos, uint8_t& ch);
297 297
298 FX_BOOL ReadBlock(uint8_t* pBuf, FX_DWORD size); 298 FX_BOOL ReadBlock(uint8_t* pBuf, FX_DWORD size);
299 299
300 CFX_ByteString GetNextWord(FX_BOOL& bIsNumber); 300 CFX_ByteString GetNextWord(bool* bIsNumber);
301 301
302 protected: 302 protected:
303 friend class CPDF_Parser; 303 friend class CPDF_Parser;
304 friend class CPDF_DataAvail; 304 friend class CPDF_DataAvail;
305 friend class fpdf_parser_parser_ReadHexString_Test; 305 friend class fpdf_parser_parser_ReadHexString_Test;
306 306
307 static const int kParserMaxRecursionDepth = 64; 307 static const int kParserMaxRecursionDepth = 64;
308 static int s_CurrentRecursionDepth; 308 static int s_CurrentRecursionDepth;
309 309
310 virtual FX_BOOL GetNextChar(uint8_t& ch); 310 virtual FX_BOOL GetNextChar(uint8_t& ch);
311 311
312 FX_BOOL GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch); 312 FX_BOOL GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch);
313 313
314 void GetNextWord(); 314 bool GetNextWordInternal();
315 315
316 bool IsWholeWord(FX_FILESIZE startpos, 316 bool IsWholeWord(FX_FILESIZE startpos,
317 FX_FILESIZE limit, 317 FX_FILESIZE limit,
318 const CFX_ByteStringC& tag, 318 const CFX_ByteStringC& tag,
319 FX_BOOL checkKeyword); 319 FX_BOOL checkKeyword);
320 320
321 CFX_ByteString ReadString(); 321 CFX_ByteString ReadString();
322 322
323 CFX_ByteString ReadHexString(); 323 CFX_ByteString ReadHexString();
324 324
(...skipping 21 matching lines...) Expand all
346 FX_DWORD m_BufSize; 346 FX_DWORD m_BufSize;
347 347
348 FX_FILESIZE m_BufOffset; 348 FX_FILESIZE m_BufOffset;
349 349
350 std::unique_ptr<CPDF_CryptoHandler> m_pCryptoHandler; 350 std::unique_ptr<CPDF_CryptoHandler> m_pCryptoHandler;
351 351
352 uint8_t m_WordBuffer[257]; 352 uint8_t m_WordBuffer[257];
353 353
354 FX_DWORD m_WordSize; 354 FX_DWORD m_WordSize;
355 355
356 FX_BOOL m_bIsNumber;
357
358 FX_FILESIZE m_dwWordPos; 356 FX_FILESIZE m_dwWordPos;
359 }; 357 };
360 358
361 #define PDFPARSE_TYPEONLY 1 359 #define PDFPARSE_TYPEONLY 1
362 #define PDFPARSE_NOSTREAM 2 360 #define PDFPARSE_NOSTREAM 2
363 struct PARSE_CONTEXT { 361 struct PARSE_CONTEXT {
364 uint32_t m_Flags; 362 uint32_t m_Flags;
365 FX_FILESIZE m_DictStart; 363 FX_FILESIZE m_DictStart;
366 FX_FILESIZE m_DictEnd; 364 FX_FILESIZE m_DictEnd;
367 FX_FILESIZE m_DataStart; 365 FX_FILESIZE m_DataStart;
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 FX_DWORD src_size, 994 FX_DWORD src_size,
997 const CPDF_Dictionary* pDict, 995 const CPDF_Dictionary* pDict,
998 uint8_t*& dest_buf, 996 uint8_t*& dest_buf,
999 FX_DWORD& dest_size, 997 FX_DWORD& dest_size,
1000 CFX_ByteString& ImageEncoding, 998 CFX_ByteString& ImageEncoding,
1001 CPDF_Dictionary*& pImageParms, 999 CPDF_Dictionary*& pImageParms,
1002 FX_DWORD estimated_size, 1000 FX_DWORD estimated_size,
1003 FX_BOOL bImageAcc); 1001 FX_BOOL bImageAcc);
1004 1002
1005 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ 1003 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp » ('j') | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698