![]() |
wxPdfDocument
1.4.0
Library for generating PDF documents from wxWidgets applications
|
Class representing a tokenizer for parsing PDF documents. More...
#include <pdfparser.h>
Public Member Functions | |
| wxPdfTokenizer (wxInputStream *inputStream) | |
| Constructor. | |
| virtual | ~wxPdfTokenizer () |
| Destructor. | |
| off_t | Seek (off_t pos) |
| Set current offset position in stream. | |
| off_t | Tell () |
| Get current offset position in stream. | |
| void | BackOnePosition (int ch) |
| Go back one position in the stream. | |
| off_t | GetLength () |
| Get length of stream. | |
| int | ReadChar () |
| Read one byte from stream. | |
| wxMemoryOutputStream * | ReadBuffer (size_t size) |
| Read size bytes from stream. | |
| off_t | GetStartXRef () |
| Find the offset of the startxref tag. | |
| wxString | ReadString (int size) |
| Read a string. | |
| wxString | CheckPdfHeader () |
| Check the header of the document stream. | |
| bool | NextToken () |
| Get the next token. | |
| void | NextValidToken () |
| Get the next valid token. | |
| int | GetTokenType () const |
| Get the type of the last token. | |
| wxString | GetStringValue () const |
| Get the token value as a string. | |
| int | GetIntValue () const |
| Get the token value as an integer. | |
| bool | IsHexString () const |
| Check whether the token is a hexadecimal string. | |
| int | GetReference () const |
| Get object reference. | |
| int | GetGeneration () const |
| Get object generation. | |
Static Public Member Functions | |
| static bool | IsWhitespace (int ch) |
| Check byte whether it represents a white space character. | |
| static bool | IsDelimiter (int ch) |
| Check byte whether it is a delimiter. | |
| static bool | IsDelimiterOrWhitespace (int ch) |
| Check byte whether it is a delimiter or a whitespace character. | |
| static int | GetHex (int v) |
| Get hexadecimal character. | |
Class representing a tokenizer for parsing PDF documents.
The tokenizer reads a PDF stream and breaks it into tokens like strings, names, numbers, etc. It also handles identifying the XRef (Cross-Reference) table, which contains the byte offsets of all indirect objects in the PDF file.
| wxPdfTokenizer::wxPdfTokenizer | ( | wxInputStream * | inputStream | ) |
Constructor.
| inputStream | The stream to tokenize |
|
virtual |
Destructor.
| void wxPdfTokenizer::BackOnePosition | ( | int | ch | ) |
Go back one position in the stream.
| ch | The character to put back |
| wxString wxPdfTokenizer::CheckPdfHeader | ( | ) |
Check the header of the document stream.
| int wxPdfTokenizer::GetGeneration | ( | ) | const |
Get object generation.
|
static |
Get hexadecimal character.
| v | The integer value |
| int wxPdfTokenizer::GetIntValue | ( | ) | const |
Get the token value as an integer.
| off_t wxPdfTokenizer::GetLength | ( | ) |
Get length of stream.
| int wxPdfTokenizer::GetReference | ( | ) | const |
Get object reference.
| off_t wxPdfTokenizer::GetStartXRef | ( | ) |
Find the offset of the startxref tag.
| wxString wxPdfTokenizer::GetStringValue | ( | ) | const |
Get the token value as a string.
| int wxPdfTokenizer::GetTokenType | ( | ) | const |
Get the type of the last token.
TOKEN_STRING, TOKEN_NUMBER)
|
static |
Check byte whether it is a delimiter.
| ch | The character to check |
true if it is a delimiter, false otherwise
|
static |
Check byte whether it is a delimiter or a whitespace character.
| ch | The character to check |
true if it is a delimiter or whitespace, false otherwise
|
inline |
Check whether the token is a hexadecimal string.
true if it is a hex string, false otherwise
|
static |
Check byte whether it represents a white space character.
| ch | The character to check |
true if it is whitespace, false otherwise | bool wxPdfTokenizer::NextToken | ( | ) |
Get the next token.
true if a token was found, false otherwise | void wxPdfTokenizer::NextValidToken | ( | ) |
Get the next valid token.
Skips comments and whitespace to find the next meaningful token.
| wxMemoryOutputStream * wxPdfTokenizer::ReadBuffer | ( | size_t | size | ) |
Read size bytes from stream.
| size | The number of bytes to read |
| int wxPdfTokenizer::ReadChar | ( | ) |
Read one byte from stream.
| wxString wxPdfTokenizer::ReadString | ( | int | size | ) |
Read a string.
| size | The number of characters to read |
| off_t wxPdfTokenizer::Seek | ( | off_t | pos | ) |
Set current offset position in stream.
| pos | The offset to seek to |
| off_t wxPdfTokenizer::Tell | ( | ) |
Get current offset position in stream.