summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_syntax_parser.h
diff options
context:
space:
mode:
authornpm <npm@chromium.org>2016-11-03 15:42:24 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-03 15:42:24 -0700
commit7f3a8c3c317b291b44521a6a0c4dd192ad2d5966 (patch)
treeedc3d5f35225971679e581c8ef951de8275a944b /core/fpdfapi/parser/cpdf_syntax_parser.h
parenta5811f0edbaa3be7807dd84b3d4d7876289cef8a (diff)
downloadpdfium-7f3a8c3c317b291b44521a6a0c4dd192ad2d5966.tar.xz
Clean up CPDF_SyntaxParser a little bit
- Added a private method to read a character. - Added enum for parsing status. - Deleted unused method. Review-Url: https://codereview.chromium.org/2469833002
Diffstat (limited to 'core/fpdfapi/parser/cpdf_syntax_parser.h')
-rw-r--r--core/fpdfapi/parser/cpdf_syntax_parser.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.h b/core/fpdfapi/parser/cpdf_syntax_parser.h
index eae5a00a41..6aab8db3fe 100644
--- a/core/fpdfapi/parser/cpdf_syntax_parser.h
+++ b/core/fpdfapi/parser/cpdf_syntax_parser.h
@@ -47,9 +47,6 @@ class CPDF_SyntaxParser {
bool bWholeWord,
bool bForward,
FX_FILESIZE limit);
- int SearchMultiWord(const CFX_ByteStringC& words,
- bool bWholeWord,
- FX_FILESIZE limit);
FX_FILESIZE FindTag(const CFX_ByteStringC& tag, FX_FILESIZE limit);
void SetEncrypt(std::unique_ptr<CPDF_CryptoHandler> pCryptoHandler);
@@ -67,6 +64,7 @@ class CPDF_SyntaxParser {
static int s_CurrentRecursionDepth;
uint32_t GetDirectNum();
+ bool ReadChar(FX_FILESIZE read_pos, uint32_t read_size);
bool GetNextChar(uint8_t& ch);
bool GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch);
void GetNextWordInternal(bool* bIsNumber);
@@ -83,9 +81,13 @@ class CPDF_SyntaxParser {
uint32_t gennum);
CFX_ByteString MaybeIntern(const CFX_ByteString& str);
+ inline bool CheckPosition(FX_FILESIZE pos) {
+ return m_BufOffset >= pos ||
+ static_cast<FX_FILESIZE>(m_BufOffset + m_BufSize) <= pos;
+ }
FX_FILESIZE m_Pos;
- int m_MetadataObjnum;
+ uint32_t m_MetadataObjnum;
IFX_SeekableReadStream* m_pFileAccess;
FX_FILESIZE m_HeaderOffset;
FX_FILESIZE m_FileLen;