summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_parser.h
diff options
context:
space:
mode:
authorArtem Strygin <art-snake@yandex-team.ru>2017-07-20 21:38:39 +0300
committerChromium commit bot <commit-bot@chromium.org>2017-07-20 19:30:01 +0000
commitbba6b77b6b35da6b5884248d768f12615f62a003 (patch)
tree2259a6529e066d2f3ebc4b4310beeb479282a11e /core/fpdfapi/parser/cpdf_parser.h
parentc760024a54b92a2e091cfcae4d9bbb7d52e66374 (diff)
downloadpdfium-bba6b77b6b35da6b5884248d768f12615f62a003.tar.xz
Use enum for pdf object type
Replace uint8_t type to enum for ObjectType variables Change-Id: Ie33c8c9413c5082397a2c6fbf73e03f08b7d8658 Reviewed-on: https://pdfium-review.googlesource.com/8470 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
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;
};