From 1cfdb58521aa96f6c0cc39a8e8fa31f2ee6ad4a9 Mon Sep 17 00:00:00 2001 From: Artem Strygin Date: Mon, 2 Oct 2017 19:23:28 +0300 Subject: Move CPDF_Parser::ObjectType into protected section Change-Id: I2a26647359a7d14d7d1269fe2835e0b3184f2ca8 Reviewed-on: https://pdfium-review.googlesource.com/13732 Commit-Queue: Art Snake Reviewed-by: dsinclair --- core/fpdfapi/parser/cpdf_parser.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'core/fpdfapi/parser/cpdf_parser.h') diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h index 75d58e2e40..5114ee6ba3 100644 --- a/core/fpdfapi/parser/cpdf_parser.h +++ b/core/fpdfapi/parser/cpdf_parser.h @@ -41,13 +41,6 @@ class CPDF_Parser { HANDLER_ERROR }; - enum class ObjectType : uint8_t { - kFree = 0x00, - kNotCompressed = 0x01, - kCompressed = 0x02, - kNull = 0xFF, - }; - // A limit on the maximum object number in the xref table. Theoretical limits // are higher, but this may be large enough in practice. static const uint32_t kMaxObjectNumber = 1048576; @@ -81,11 +74,11 @@ class CPDF_Parser { uint32_t GetLastObjNum() const; bool IsValidObjectNumber(uint32_t objnum) const; FX_FILESIZE GetObjectPositionOrZero(uint32_t objnum) const; - ObjectType GetObjectType(uint32_t objnum) const; uint16_t GetObjectGenNum(uint32_t objnum) const; bool IsObjectFreeOrNull(uint32_t objnum) const; RetainPtr GetCryptoHandler() const; RetainPtr GetFileAccess() const; + bool IsObjectFree(uint32_t objnum) const; FX_FILESIZE GetObjectOffset(uint32_t objnum) const; @@ -106,6 +99,13 @@ class CPDF_Parser { uint32_t GetFirstPageNo() const; protected: + enum class ObjectType : uint8_t { + kFree = 0x00, + kNotCompressed = 0x01, + kCompressed = 0x02, + kNull = 0xFF, + }; + struct ObjectInfo { ObjectInfo() : pos(0), type(ObjectType::kFree), gennum(0) {} // if type is ObjectType::kCompressed the archive_obj_num should be used. @@ -192,6 +192,10 @@ class CPDF_Parser { bool ParseFileVersion(); UnownedPtr m_pDocument; + ObjectType GetObjectType(uint32_t objnum) const; + ObjectType GetObjectTypeFromCrossRefStreamType( + int cross_ref_stream_type) const; + bool m_bHasParsed; bool m_bXRefStream; int m_FileVersion; -- cgit v1.2.3