summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-04 11:55:50 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-04 11:55:51 -0700
commit488b7ad845d6de212d89cd957303b294ecfa5922 (patch)
treeadfdd2327724bd3597a1a7614bbe29a01a0c8dc0 /core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h
parent41872fa5ac7448a50f66ad56d7bde8d1aa77db4b (diff)
downloadpdfium-488b7ad845d6de212d89cd957303b294ecfa5922.tar.xz
Move core/fpdfapi/fpdf_parser to core/fpdfapi/parser
BUG=pdfium:603 Review-Url: https://codereview.chromium.org/2392603004
Diffstat (limited to 'core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h')
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h101
1 files changed, 0 insertions, 101 deletions
diff --git a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h
deleted file mode 100644
index 3a9f1b473a..0000000000
--- a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef CORE_FPDFAPI_FPDF_PARSER_CPDF_SYNTAX_PARSER_H_
-#define CORE_FPDFAPI_FPDF_PARSER_CPDF_SYNTAX_PARSER_H_
-
-#include <memory>
-
-#include "core/fxcrt/cfx_string_pool_template.h"
-#include "core/fxcrt/cfx_weak_ptr.h"
-#include "core/fxcrt/fx_basic.h"
-
-class CPDF_CryptoHandler;
-class CPDF_Dictionary;
-class CPDF_IndirectObjectHolder;
-class CPDF_Object;
-class CPDF_Stream;
-class IFX_FileRead;
-
-class CPDF_SyntaxParser {
- public:
- CPDF_SyntaxParser();
- explicit CPDF_SyntaxParser(const CFX_WeakPtr<CFX_ByteStringPool>& pPool);
- ~CPDF_SyntaxParser();
-
- void InitParser(IFX_FileRead* pFileAccess, uint32_t HeaderOffset);
-
- FX_FILESIZE SavePos() const { return m_Pos; }
- void RestorePos(FX_FILESIZE pos) { m_Pos = pos; }
-
- CPDF_Object* GetObject(CPDF_IndirectObjectHolder* pObjList,
- uint32_t objnum,
- uint32_t gennum,
- FX_BOOL bDecrypt);
- CPDF_Object* GetObjectForStrict(CPDF_IndirectObjectHolder* pObjList,
- uint32_t objnum,
- uint32_t gennum);
- CFX_ByteString GetKeyword();
-
- void ToNextLine();
- void ToNextWord();
-
- FX_BOOL SearchWord(const CFX_ByteStringC& word,
- FX_BOOL bWholeWord,
- FX_BOOL bForward,
- FX_FILESIZE limit);
- int SearchMultiWord(const CFX_ByteStringC& words,
- FX_BOOL bWholeWord,
- FX_FILESIZE limit);
- FX_FILESIZE FindTag(const CFX_ByteStringC& tag, FX_FILESIZE limit);
-
- void SetEncrypt(std::unique_ptr<CPDF_CryptoHandler> pCryptoHandler);
-
- FX_BOOL ReadBlock(uint8_t* pBuf, uint32_t size);
- FX_BOOL GetCharAt(FX_FILESIZE pos, uint8_t& ch);
- CFX_ByteString GetNextWord(bool* bIsNumber);
-
- private:
- friend class CPDF_Parser;
- friend class CPDF_DataAvail;
- friend class cpdf_syntax_parser_ReadHexString_Test;
-
- static const int kParserMaxRecursionDepth = 64;
- static int s_CurrentRecursionDepth;
-
- uint32_t GetDirectNum();
- FX_BOOL GetNextChar(uint8_t& ch);
- FX_BOOL GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch);
- void GetNextWordInternal(bool* bIsNumber);
- bool IsWholeWord(FX_FILESIZE startpos,
- FX_FILESIZE limit,
- const CFX_ByteStringC& tag,
- FX_BOOL checkKeyword);
-
- CFX_ByteString ReadString();
- CFX_ByteString ReadHexString();
- unsigned int ReadEOLMarkers(FX_FILESIZE pos);
- CPDF_Stream* ReadStream(CPDF_Dictionary* pDict,
- uint32_t objnum,
- uint32_t gennum);
-
- CFX_ByteString MaybeIntern(const CFX_ByteString& str);
-
- FX_FILESIZE m_Pos;
- int m_MetadataObjnum;
- IFX_FileRead* m_pFileAccess;
- FX_FILESIZE m_HeaderOffset;
- FX_FILESIZE m_FileLen;
- uint8_t* m_pFileBuf;
- uint32_t m_BufSize;
- FX_FILESIZE m_BufOffset;
- std::unique_ptr<CPDF_CryptoHandler> m_pCryptoHandler;
- uint8_t m_WordBuffer[257];
- uint32_t m_WordSize;
- CFX_WeakPtr<CFX_ByteStringPool> m_pPool;
-};
-
-#endif // CORE_FPDFAPI_FPDF_PARSER_CPDF_SYNTAX_PARSER_H_