summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_parser.h
diff options
context:
space:
mode:
authorArtem Strygin <art-snake@yandex-team.ru>2017-10-02 19:23:28 +0300
committerChromium commit bot <commit-bot@chromium.org>2017-10-02 16:36:31 +0000
commit1cfdb58521aa96f6c0cc39a8e8fa31f2ee6ad4a9 (patch)
tree24cc7990715938ab9b57d545958cf8492e4d6aef /core/fpdfapi/parser/cpdf_parser.h
parentd8169d7607b5084cdeceee3eaffca0ab16d2c14d (diff)
downloadpdfium-1cfdb58521aa96f6c0cc39a8e8fa31f2ee6ad4a9.tar.xz
Move CPDF_Parser::ObjectType into protected section
Change-Id: I2a26647359a7d14d7d1269fe2835e0b3184f2ca8 Reviewed-on: https://pdfium-review.googlesource.com/13732 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.h')
-rw-r--r--core/fpdfapi/parser/cpdf_parser.h20
1 files changed, 12 insertions, 8 deletions
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<CPDF_CryptoHandler> GetCryptoHandler() const;
RetainPtr<IFX_SeekableReadStream> 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<CPDF_Document> 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;