summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_parser.h
diff options
context:
space:
mode:
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;