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_SyntaxParser Class Reference

#include <cpdf_syntax_parser.h>

+ Collaboration diagram for CPDF_SyntaxParser:

Classes

struct  WordResult
 

Public Types

enum class  ParseType : bool { kStrict , kLoose }
 

Public Member Functions

 CPDF_SyntaxParser (RetainPtr< IFX_SeekableReadStream > pFileAccess)
 
 CPDF_SyntaxParser (RetainPtr< CPDF_ReadValidator > pValidator, FX_FILESIZE HeaderOffset)
 
 ~CPDF_SyntaxParser ()
 
void SetReadBufferSize (uint32_t read_buffer_size)
 
FX_FILESIZE GetPos () const
 
void SetPos (FX_FILESIZE pos)
 
RetainPtr< CPDF_ObjectGetObjectBody (CPDF_IndirectObjectHolder *pObjList)
 
RetainPtr< CPDF_ObjectGetIndirectObject (CPDF_IndirectObjectHolder *pObjList, ParseType parse_type)
 
ByteString GetKeyword ()
 
void ToNextLine ()
 
void ToNextWord ()
 
void RecordingToNextWord ()
 
bool BackwardsSearchToWord (ByteStringView word, FX_FILESIZE limit)
 
FX_FILESIZE FindTag (ByteStringView tag)
 
bool ReadBlock (pdfium::span< uint8_t > buffer)
 
bool GetCharAt (FX_FILESIZE pos, uint8_t &ch)
 
WordResult GetNextWord ()
 
ByteString PeekNextWord ()
 
RetainPtr< CPDF_ReadValidatorGetValidator () const
 
uint32_t GetDirectNum ()
 
bool GetNextChar (uint8_t &ch)
 
FX_FILESIZE GetDocumentSize () const
 
ByteString ReadString ()
 
ByteString ReadHexString ()
 
void SetTrailerEnds (std::vector< unsigned int > *trailer_ends)
 

Static Public Member Functions

static std::unique_ptr< CPDF_SyntaxParserCreateForTesting (RetainPtr< IFX_SeekableReadStream > pFileAccess, FX_FILESIZE HeaderOffset)
 

Friends

class CPDF_DataAvail
 
class cpdf_syntax_parser_ReadHexString_Test
 

Detailed Description

Definition at line 31 of file cpdf_syntax_parser.h.

Member Enumeration Documentation

◆ ParseType

enum class CPDF_SyntaxParser::ParseType : bool
strong
Enumerator
kStrict 
kLoose 

Definition at line 33 of file cpdf_syntax_parser.h.

Constructor & Destructor Documentation

◆ CPDF_SyntaxParser() [1/2]

CPDF_SyntaxParser::CPDF_SyntaxParser ( RetainPtr< IFX_SeekableReadStream > pFileAccess)
explicit

Definition at line 90 of file cpdf_syntax_parser.cpp.

◆ CPDF_SyntaxParser() [2/2]

CPDF_SyntaxParser::CPDF_SyntaxParser ( RetainPtr< CPDF_ReadValidator > pValidator,
FX_FILESIZE HeaderOffset )

Definition at line 97 of file cpdf_syntax_parser.cpp.

References CPDF_SyntaxParser().

Referenced by CPDF_SyntaxParser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~CPDF_SyntaxParser()

CPDF_SyntaxParser::~CPDF_SyntaxParser ( )
default

Member Function Documentation

◆ BackwardsSearchToWord()

bool CPDF_SyntaxParser::BackwardsSearchToWord ( ByteStringView word,
FX_FILESIZE limit )

Definition at line 867 of file cpdf_syntax_parser.cpp.

◆ CreateForTesting()

std::unique_ptr< CPDF_SyntaxParser > CPDF_SyntaxParser::CreateForTesting ( RetainPtr< IFX_SeekableReadStream > pFileAccess,
FX_FILESIZE HeaderOffset )
static

Definition at line 82 of file cpdf_syntax_parser.cpp.

◆ FindTag()

FX_FILESIZE CPDF_SyntaxParser::FindTag ( ByteStringView tag)

Definition at line 901 of file cpdf_syntax_parser.cpp.

References GetNextChar(), and GetPos().

+ Here is the call graph for this function:

◆ GetCharAt()

bool CPDF_SyntaxParser::GetCharAt ( FX_FILESIZE pos,
uint8_t & ch )

Definition at line 107 of file cpdf_syntax_parser.cpp.

References GetNextChar().

+ Here is the call graph for this function:

◆ GetDirectNum()

uint32_t CPDF_SyntaxParser::GetDirectNum ( )

Definition at line 827 of file cpdf_syntax_parser.cpp.

References FXSYS_atoui().

+ Here is the call graph for this function:

◆ GetDocumentSize()

FX_FILESIZE CPDF_SyntaxParser::GetDocumentSize ( ) const

Definition at line 145 of file cpdf_syntax_parser.cpp.

Referenced by CPDF_LinearizedHeader::Parse().

+ Here is the caller graph for this function:

◆ GetIndirectObject()

RetainPtr< CPDF_Object > CPDF_SyntaxParser::GetIndirectObject ( CPDF_IndirectObjectHolder * pObjList,
ParseType parse_type )

Definition at line 608 of file cpdf_syntax_parser.cpp.

References fxcrt::ByteString::c_str(), FXSYS_atoui(), GetKeyword(), GetNextWord(), GetPos(), GetValidator(), CPDF_SyntaxParser::WordResult::is_number, fxcrt::ByteString::IsEmpty(), fxcrt::ByteString::operator!=(), and SetPos().

Referenced by CPDF_LinearizedHeader::Parse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetKeyword()

ByteString CPDF_SyntaxParser::GetKeyword ( )

Definition at line 477 of file cpdf_syntax_parser.cpp.

References GetNextWord().

Referenced by GetIndirectObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNextChar()

bool CPDF_SyntaxParser::GetNextChar ( uint8_t & ch)

Definition at line 132 of file cpdf_syntax_parser.cpp.

Referenced by FindTag(), GetCharAt(), ReadHexString(), ReadString(), RecordingToNextWord(), ToNextLine(), and ToNextWord().

+ Here is the caller graph for this function:

◆ GetNextWord()

CPDF_SyntaxParser::WordResult CPDF_SyntaxParser::GetNextWord ( )

Definition at line 463 of file cpdf_syntax_parser.cpp.

References GetValidator(), and fxcrt::ByteString::operator=().

Referenced by GetIndirectObject(), GetKeyword(), CPDF_LinearizedHeader::Parse(), PeekNextWord(), and TEST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetObjectBody()

RetainPtr< CPDF_Object > CPDF_SyntaxParser::GetObjectBody ( CPDF_IndirectObjectHolder * pObjList)

Definition at line 486 of file cpdf_syntax_parser.cpp.

References GetValidator(), and kLoose.

+ Here is the call graph for this function:

◆ GetPos()

FX_FILESIZE CPDF_SyntaxParser::GetPos ( ) const
inline

Definition at line 53 of file cpdf_syntax_parser.h.

Referenced by FindTag(), GetIndirectObject(), CPDF_LinearizedHeader::Parse(), and TEST().

+ Here is the caller graph for this function:

◆ GetValidator()

RetainPtr< CPDF_ReadValidator > CPDF_SyntaxParser::GetValidator ( ) const

Definition at line 835 of file cpdf_syntax_parser.cpp.

Referenced by GetIndirectObject(), GetNextWord(), GetObjectBody(), and CPDF_HintTables::Parse().

+ Here is the caller graph for this function:

◆ PeekNextWord()

ByteString CPDF_SyntaxParser::PeekNextWord ( )

Definition at line 472 of file cpdf_syntax_parser.cpp.

References GetNextWord().

Referenced by TEST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReadBlock()

bool CPDF_SyntaxParser::ReadBlock ( pdfium::span< uint8_t > buffer)

Definition at line 165 of file cpdf_syntax_parser.cpp.

◆ ReadHexString()

ByteString CPDF_SyntaxParser::ReadHexString ( )

Definition at line 322 of file cpdf_syntax_parser.cpp.

References fxcrt::ByteString::ByteString(), FXSYS_HexCharToInt(), GetNextChar(), and fxcrt::ByteString::operator+=().

Referenced by TEST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReadString()

ByteString CPDF_SyntaxParser::ReadString ( )

Definition at line 236 of file cpdf_syntax_parser.cpp.

References fxcrt::ByteString::ByteString(), fxcrt::ByteString::ByteString(), FXSYS_DecimalCharToInt(), FXSYS_IsOctalDigit(), GetNextChar(), and fxcrt::ByteString::operator+=().

+ Here is the call graph for this function:

◆ RecordingToNextWord()

void CPDF_SyntaxParser::RecordingToNextWord ( )

Definition at line 409 of file cpdf_syntax_parser.cpp.

References GetNextChar(), kE, kF, kInitial, kInvalid, kNonPercent, kO, kPercent, PDFCharIsLineEnding(), and PDFCharIsWhitespace().

Referenced by ToNextWord().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetPos()

void CPDF_SyntaxParser::SetPos ( FX_FILESIZE pos)

Definition at line 481 of file cpdf_syntax_parser.cpp.

Referenced by GetIndirectObject(), CPDF_HintTables::Parse(), CPDF_LinearizedHeader::Parse(), and TEST().

+ Here is the caller graph for this function:

◆ SetReadBufferSize()

void CPDF_SyntaxParser::SetReadBufferSize ( uint32_t read_buffer_size)
inline

Definition at line 49 of file cpdf_syntax_parser.h.

◆ SetTrailerEnds()

void CPDF_SyntaxParser::SetTrailerEnds ( std::vector< unsigned int > * trailer_ends)
inline

Definition at line 86 of file cpdf_syntax_parser.h.

◆ ToNextLine()

void CPDF_SyntaxParser::ToNextLine ( )

Definition at line 354 of file cpdf_syntax_parser.cpp.

References GetNextChar().

+ Here is the call graph for this function:

◆ ToNextWord()

void CPDF_SyntaxParser::ToNextWord ( )

Definition at line 369 of file cpdf_syntax_parser.cpp.

References GetNextChar(), PDFCharIsLineEnding(), PDFCharIsWhitespace(), and RecordingToNextWord().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ CPDF_DataAvail

friend class CPDF_DataAvail
friend

Definition at line 93 of file cpdf_syntax_parser.h.

◆ cpdf_syntax_parser_ReadHexString_Test

friend class cpdf_syntax_parser_ReadHexString_Test
friend

Definition at line 94 of file cpdf_syntax_parser.h.


The documentation for this class was generated from the following files: