Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdf_linearized_header.h
Go to the documentation of this file.
1// Copyright 2016 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_HEADER_H_
8#define CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_HEADER_H_
9
10#include <stdint.h>
11
12#include <memory>
13
14#include "core/fxcrt/fx_types.h"
15
16class CPDF_Dictionary;
18
20 public:
23 CPDF_SyntaxParser* parser);
24
25 // Will only return values > 0.
26 FX_FILESIZE GetFileSize() const { return m_szFileSize; }
27 uint32_t GetFirstPageNo() const { return m_dwFirstPageNo; }
28 // Will only return values > 0.
30 return m_szMainXRefTableFirstEntryOffset;
31 }
32 uint32_t GetPageCount() const { return m_PageCount; }
33 // Will only return values > 0.
34 FX_FILESIZE GetFirstPageEndOffset() const { return m_szFirstPageEndOffset; }
35 // Will only return values in the range [1, `CPDF_Parser::kMaxObjectNumber`).
36 uint32_t GetFirstPageObjNum() const { return m_FirstPageObjNum; }
37 // Will only return values > 0.
38 FX_FILESIZE GetLastXRefOffset() const { return m_szLastXRefOffset; }
39
40 bool HasHintTable() const;
41 // Will only return values > 0.
42 FX_FILESIZE GetHintStart() const { return m_szHintStart; }
43 uint32_t GetHintLength() const { return m_HintLength; }
44
45 protected:
46 CPDF_LinearizedHeader(const CPDF_Dictionary* pDict,
47 FX_FILESIZE szLastXRefOffset);
48
49 private:
50 const FX_FILESIZE m_szFileSize;
51 const uint32_t m_dwFirstPageNo;
52 const FX_FILESIZE m_szMainXRefTableFirstEntryOffset;
53 const uint32_t m_PageCount;
54 const FX_FILESIZE m_szFirstPageEndOffset;
55 const uint32_t m_FirstPageObjNum;
56 const FX_FILESIZE m_szLastXRefOffset;
57 FX_FILESIZE m_szHintStart = 0;
58 uint32_t m_HintLength = 0;
59};
60
61#endif // CORE_FPDFAPI_PARSER_CPDF_LINEARIZED_HEADER_H_
CPDF_DataAvail(FileAvail *pFileAvail, RetainPtr< IFX_SeekableReadStream > pFileRead)
~CPDF_DataAvail() override
DocAvailStatus IsPageAvail(uint32_t dwPage, DownloadHints *pHints)
std::pair< CPDF_Parser::Error, std::unique_ptr< CPDF_Document > > ParseDocument(std::unique_ptr< CPDF_Document::RenderDataIface > pRenderData, std::unique_ptr< CPDF_Document::PageDataIface > pPageData, const ByteString &password)
RetainPtr< const CPDF_Dictionary > GetPageDictionary(int index) const
RetainPtr< CPDF_ReadValidator > GetValidator() const
DocAvailStatus IsDocAvail(DownloadHints *pHints)
void OnObservableDestroyed() override
DocLinearizationStatus IsLinearizedPDF()
int GetPageCount() const
DocFormStatus IsFormAvail(DownloadHints *pHints)
FX_FILESIZE page_offset() const
void set_page_offset(FX_FILESIZE offset)
void AddIdentifier(uint32_t Identifier)
const std::vector< uint32_t > & Identifiers() const
void set_start_obj_num(uint32_t start_obj_num)
uint32_t start_obj_num() const
void set_page_length(uint32_t length)
void set_objects_count(uint32_t objects_count)
uint32_t objects_count() const
CPDF_DataAvail::DocAvailStatus CheckPage(uint32_t index)
virtual ~CPDF_HintTables()
FX_FILESIZE GetFirstPageObjOffset() const
bool GetPagePos(uint32_t index, FX_FILESIZE *szPageStartPos, FX_FILESIZE *szPageLength, uint32_t *dwObjNum) const
static std::unique_ptr< CPDF_HintTables > Parse(CPDF_SyntaxParser *parser, const CPDF_LinearizedHeader *pLinearized)
bool LoadHintStream(CPDF_Stream *pHintStream)
bool ReadSharedObjHintTable(CFX_BitStream *hStream, uint32_t offset)
CPDF_HintTables(CPDF_ReadValidator *pValidator, const CPDF_LinearizedHeader *pLinearized)
const std::vector< SharedObjGroupInfo > & SharedGroupInfos() const
bool ReadPageHintTable(CFX_BitStream *hStream)
const std::vector< PageInfo > & PageInfos() const
FX_FILESIZE GetHintStart() const
uint32_t GetFirstPageObjNum() const
FX_FILESIZE GetLastXRefOffset() const
FX_FILESIZE GetFirstPageEndOffset() const
static std::unique_ptr< CPDF_LinearizedHeader > Parse(CPDF_SyntaxParser *parser)
FX_FILESIZE GetMainXRefTableFirstEntryOffset() const
FX_FILESIZE GetFileSize() const
CPDF_LinearizedHeader(const CPDF_Dictionary *pDict, FX_FILESIZE szLastXRefOffset)
CPDF_DataAvail::DocAvailStatus CheckAvail()
static constexpr uint32_t kInvalidObjNum
Definition cpdf_object.h:52
uint32_t GetRefObjNum() const
FX_FILESIZE GetPos() const
void SetPos(FX_FILESIZE pos)
bool operator==(const char *ptr) const
bool operator!=(const char *ptr) const
Definition bytestring.h:130
#define FX_FILESIZE
Definition fx_types.h:19