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_cross_ref_avail.h
Go to the documentation of this file.
1// Copyright 2017 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#ifndef CORE_FPDFAPI_PARSER_CPDF_CROSS_REF_AVAIL_H_
6#define CORE_FPDFAPI_PARSER_CPDF_CROSS_REF_AVAIL_H_
7
8#include <queue>
9#include <set>
10
11#include "core/fpdfapi/parser/cpdf_data_avail.h"
12#include "core/fxcrt/retain_ptr.h"
13#include "core/fxcrt/unowned_ptr.h"
14
16
18 public:
20 FX_FILESIZE last_crossref_offset);
22
23 FX_FILESIZE last_crossref_offset() const { return last_crossref_offset_; }
24
25 CPDF_DataAvail::DocAvailStatus CheckAvail();
26
27 private:
28 enum class State {
29 kCrossRefCheck,
30 kCrossRefV4ItemCheck,
31 kCrossRefV4TrailerCheck,
32 kDone,
33 };
34
35 bool CheckReadProblems();
36 bool CheckCrossRef();
37 bool CheckCrossRefV4();
38 bool CheckCrossRefV4Item();
39 bool CheckCrossRefV4Trailer();
40 bool CheckCrossRefStream();
41
42 void AddCrossRefForCheck(FX_FILESIZE crossref_offset);
43
44 RetainPtr<CPDF_ReadValidator> GetValidator();
45
46 UnownedPtr<CPDF_SyntaxParser> const parser_;
47 const FX_FILESIZE last_crossref_offset_;
48 CPDF_DataAvail::DocAvailStatus status_ = CPDF_DataAvail::kDataNotAvailable;
49 State state_ = State::kCrossRefCheck;
50 FX_FILESIZE offset_ = 0;
51 std::queue<FX_FILESIZE> cross_refs_for_check_;
52 std::set<FX_FILESIZE> registered_crossrefs_;
53};
54
55#endif // CORE_FPDFAPI_PARSER_CPDF_CROSS_REF_AVAIL_H_
FX_FILESIZE last_crossref_offset() const
CPDF_CrossRefAvail(CPDF_SyntaxParser *parser, FX_FILESIZE last_crossref_offset)
CPDF_DataAvail::DocAvailStatus CheckAvail()
bool operator==(const char *ptr) const
bool IsEmpty() const
Definition bytestring.h:119
bool operator!=(const char *ptr) const
Definition bytestring.h:130
#define FX_FILESIZE
Definition fx_types.h:19