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.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h
index efe10555f7..3acdbbfa6f 100644
--- a/core/fpdfapi/parser/cpdf_parser.h
+++ b/core/fpdfapi/parser/cpdf_parser.h
@@ -38,6 +38,13 @@ 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;
@@ -74,7 +81,7 @@ class CPDF_Parser {
uint32_t GetLastObjNum() const;
bool IsValidObjectNumber(uint32_t objnum) const;
FX_FILESIZE GetObjectPositionOrZero(uint32_t objnum) const;
- uint8_t GetObjectType(uint32_t objnum) const;
+ ObjectType GetObjectType(uint32_t objnum) const;
uint16_t GetObjectGenNum(uint32_t objnum) const;
bool IsVersionUpdated() const { return m_bVersionUpdated; }
bool IsObjectFreeOrNull(uint32_t objnum) const;
@@ -103,10 +110,10 @@ class CPDF_Parser {
protected:
struct ObjectInfo {
- ObjectInfo() : pos(0), type(0), gennum(0) {}
+ ObjectInfo() : pos(0), type(ObjectType::kFree), gennum(0) {}
FX_FILESIZE pos;
- uint8_t type;
+ ObjectType type;
uint16_t gennum;
};