mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-22 02:49:00 +00:00
Code tidy - Clang-Tidy rule modernize-use-override
This commit is contained in:
parent
ae3642ce42
commit
0ac005f0d9
@ -32,21 +32,21 @@ class QPDF_DLL_CLASS BufferInputSource: public InputSource
|
||||
QPDF_DLL
|
||||
BufferInputSource(std::string const& description, std::string const& contents);
|
||||
QPDF_DLL
|
||||
virtual ~BufferInputSource();
|
||||
~BufferInputSource() override;
|
||||
QPDF_DLL
|
||||
virtual qpdf_offset_t findAndSkipNextEOL();
|
||||
qpdf_offset_t findAndSkipNextEOL() override;
|
||||
QPDF_DLL
|
||||
virtual std::string const& getName() const;
|
||||
std::string const& getName() const override;
|
||||
QPDF_DLL
|
||||
virtual qpdf_offset_t tell();
|
||||
qpdf_offset_t tell() override;
|
||||
QPDF_DLL
|
||||
virtual void seek(qpdf_offset_t offset, int whence);
|
||||
void seek(qpdf_offset_t offset, int whence) override;
|
||||
QPDF_DLL
|
||||
virtual void rewind();
|
||||
void rewind() override;
|
||||
QPDF_DLL
|
||||
virtual size_t read(char* buffer, size_t length);
|
||||
size_t read(char* buffer, size_t length) override;
|
||||
QPDF_DLL
|
||||
virtual void unreadCh(char ch);
|
||||
void unreadCh(char ch) override;
|
||||
|
||||
private:
|
||||
bool own_memory;
|
||||
|
@ -37,21 +37,21 @@ class QPDF_DLL_CLASS ClosedFileInputSource: public InputSource
|
||||
QPDF_DLL
|
||||
ClosedFileInputSource(char const* filename);
|
||||
QPDF_DLL
|
||||
virtual ~ClosedFileInputSource();
|
||||
~ClosedFileInputSource() override;
|
||||
QPDF_DLL
|
||||
virtual qpdf_offset_t findAndSkipNextEOL();
|
||||
qpdf_offset_t findAndSkipNextEOL() override;
|
||||
QPDF_DLL
|
||||
virtual std::string const& getName() const;
|
||||
std::string const& getName() const override;
|
||||
QPDF_DLL
|
||||
virtual qpdf_offset_t tell();
|
||||
qpdf_offset_t tell() override;
|
||||
QPDF_DLL
|
||||
virtual void seek(qpdf_offset_t offset, int whence);
|
||||
void seek(qpdf_offset_t offset, int whence) override;
|
||||
QPDF_DLL
|
||||
virtual void rewind();
|
||||
void rewind() override;
|
||||
QPDF_DLL
|
||||
virtual size_t read(char* buffer, size_t length);
|
||||
size_t read(char* buffer, size_t length) override;
|
||||
QPDF_DLL
|
||||
virtual void unreadCh(char ch);
|
||||
void unreadCh(char ch) override;
|
||||
|
||||
// The file stays open between calls to stayOpen(true) and stayOpen(false). You can use this to
|
||||
// surround multiple operations on a single ClosedFileInputSource to reduce the overhead of a
|
||||
|
@ -35,21 +35,21 @@ class QPDF_DLL_CLASS FileInputSource: public InputSource
|
||||
QPDF_DLL
|
||||
void setFile(char const* description, FILE* filep, bool close_file);
|
||||
QPDF_DLL
|
||||
virtual ~FileInputSource();
|
||||
~FileInputSource() override;
|
||||
QPDF_DLL
|
||||
virtual qpdf_offset_t findAndSkipNextEOL();
|
||||
qpdf_offset_t findAndSkipNextEOL() override;
|
||||
QPDF_DLL
|
||||
virtual std::string const& getName() const;
|
||||
std::string const& getName() const override;
|
||||
QPDF_DLL
|
||||
virtual qpdf_offset_t tell();
|
||||
qpdf_offset_t tell() override;
|
||||
QPDF_DLL
|
||||
virtual void seek(qpdf_offset_t offset, int whence);
|
||||
void seek(qpdf_offset_t offset, int whence) override;
|
||||
QPDF_DLL
|
||||
virtual void rewind();
|
||||
void rewind() override;
|
||||
QPDF_DLL
|
||||
virtual size_t read(char* buffer, size_t length);
|
||||
size_t read(char* buffer, size_t length) override;
|
||||
QPDF_DLL
|
||||
virtual void unreadCh(char ch);
|
||||
void unreadCh(char ch) override;
|
||||
|
||||
private:
|
||||
FileInputSource(FileInputSource const&) = delete;
|
||||
|
@ -32,13 +32,13 @@ class QPDF_DLL_CLASS Pl_Concatenate: public Pipeline
|
||||
QPDF_DLL
|
||||
Pl_Concatenate(char const* identifier, Pipeline* next);
|
||||
QPDF_DLL
|
||||
virtual ~Pl_Concatenate();
|
||||
~Pl_Concatenate() override;
|
||||
|
||||
QPDF_DLL
|
||||
virtual void write(unsigned char const* data, size_t len);
|
||||
void write(unsigned char const* data, size_t len) override;
|
||||
|
||||
QPDF_DLL
|
||||
virtual void finish();
|
||||
void finish() override;
|
||||
|
||||
// At the very end, call manualFinish to actually finish the rest of the pipeline.
|
||||
QPDF_DLL
|
||||
|
@ -30,11 +30,11 @@ class QPDF_DLL_CLASS Pl_Count: public Pipeline
|
||||
QPDF_DLL
|
||||
Pl_Count(char const* identifier, Pipeline* next);
|
||||
QPDF_DLL
|
||||
virtual ~Pl_Count();
|
||||
~Pl_Count() override;
|
||||
QPDF_DLL
|
||||
virtual void write(unsigned char const*, size_t);
|
||||
void write(unsigned char const*, size_t) override;
|
||||
QPDF_DLL
|
||||
virtual void finish();
|
||||
void finish() override;
|
||||
// Returns the number of bytes written
|
||||
QPDF_DLL
|
||||
qpdf_offset_t getCount() const;
|
||||
|
@ -56,12 +56,12 @@ class QPDF_DLL_CLASS Pl_DCT: public Pipeline
|
||||
CompressConfig* config_callback = nullptr);
|
||||
|
||||
QPDF_DLL
|
||||
virtual ~Pl_DCT();
|
||||
~Pl_DCT() override;
|
||||
|
||||
QPDF_DLL
|
||||
virtual void write(unsigned char const* data, size_t len);
|
||||
void write(unsigned char const* data, size_t len) override;
|
||||
QPDF_DLL
|
||||
virtual void finish();
|
||||
void finish() override;
|
||||
|
||||
private:
|
||||
QPDF_DLL_PRIVATE
|
||||
|
@ -31,11 +31,11 @@ class QPDF_DLL_CLASS Pl_Discard: public Pipeline
|
||||
QPDF_DLL
|
||||
Pl_Discard();
|
||||
QPDF_DLL
|
||||
virtual ~Pl_Discard();
|
||||
~Pl_Discard() override;
|
||||
QPDF_DLL
|
||||
virtual void write(unsigned char const*, size_t);
|
||||
void write(unsigned char const*, size_t) override;
|
||||
QPDF_DLL
|
||||
virtual void finish();
|
||||
void finish() override;
|
||||
|
||||
private:
|
||||
class QPDF_DLL_PRIVATE Members
|
||||
|
@ -40,12 +40,12 @@ class QPDF_DLL_CLASS Pl_Flate: public Pipeline
|
||||
action_e action,
|
||||
unsigned int out_bufsize = def_bufsize);
|
||||
QPDF_DLL
|
||||
virtual ~Pl_Flate();
|
||||
~Pl_Flate() override;
|
||||
|
||||
QPDF_DLL
|
||||
virtual void write(unsigned char const* data, size_t len);
|
||||
void write(unsigned char const* data, size_t len) override;
|
||||
QPDF_DLL
|
||||
virtual void finish();
|
||||
void finish() override;
|
||||
|
||||
// Globally set compression level from 1 (fastest, least
|
||||
// compression) to 9 (slowest, most compression). Use -1 to set
|
||||
|
@ -54,12 +54,12 @@ class QPDF_DLL_CLASS Pl_Function: public Pipeline
|
||||
Pl_Function(char const* identifier, Pipeline* next, writer_c_char_t fn, void* udata);
|
||||
|
||||
QPDF_DLL
|
||||
virtual ~Pl_Function();
|
||||
~Pl_Function() override;
|
||||
|
||||
QPDF_DLL
|
||||
virtual void write(unsigned char const* buf, size_t len);
|
||||
void write(unsigned char const* buf, size_t len) override;
|
||||
QPDF_DLL
|
||||
virtual void finish();
|
||||
void finish() override;
|
||||
|
||||
private:
|
||||
class QPDF_DLL_PRIVATE Members
|
||||
|
@ -36,12 +36,12 @@ class QPDF_DLL_CLASS Pl_OStream: public Pipeline
|
||||
QPDF_DLL
|
||||
Pl_OStream(char const* identifier, std::ostream& os);
|
||||
QPDF_DLL
|
||||
virtual ~Pl_OStream();
|
||||
~Pl_OStream() override;
|
||||
|
||||
QPDF_DLL
|
||||
virtual void write(unsigned char const* buf, size_t len);
|
||||
void write(unsigned char const* buf, size_t len) override;
|
||||
QPDF_DLL
|
||||
virtual void finish();
|
||||
void finish() override;
|
||||
|
||||
private:
|
||||
class QPDF_DLL_PRIVATE Members
|
||||
|
@ -45,11 +45,11 @@ class QPDF_DLL_CLASS Pl_QPDFTokenizer: public Pipeline
|
||||
Pl_QPDFTokenizer(
|
||||
char const* identifier, QPDFObjectHandle::TokenFilter* filter, Pipeline* next = nullptr);
|
||||
QPDF_DLL
|
||||
virtual ~Pl_QPDFTokenizer();
|
||||
~Pl_QPDFTokenizer() override;
|
||||
QPDF_DLL
|
||||
virtual void write(unsigned char const* buf, size_t len);
|
||||
void write(unsigned char const* buf, size_t len) override;
|
||||
QPDF_DLL
|
||||
virtual void finish();
|
||||
void finish() override;
|
||||
|
||||
private:
|
||||
class QPDF_DLL_PRIVATE Members
|
||||
|
@ -29,12 +29,12 @@ class QPDF_DLL_CLASS Pl_RunLength: public Pipeline
|
||||
QPDF_DLL
|
||||
Pl_RunLength(char const* identifier, Pipeline* next, action_e action);
|
||||
QPDF_DLL
|
||||
virtual ~Pl_RunLength();
|
||||
~Pl_RunLength() override;
|
||||
|
||||
QPDF_DLL
|
||||
virtual void write(unsigned char const* data, size_t len);
|
||||
void write(unsigned char const* data, size_t len) override;
|
||||
QPDF_DLL
|
||||
virtual void finish();
|
||||
void finish() override;
|
||||
|
||||
private:
|
||||
QPDF_DLL_PRIVATE
|
||||
|
@ -36,12 +36,12 @@ class QPDF_DLL_CLASS Pl_StdioFile: public Pipeline
|
||||
QPDF_DLL
|
||||
Pl_StdioFile(char const* identifier, FILE* f);
|
||||
QPDF_DLL
|
||||
virtual ~Pl_StdioFile();
|
||||
~Pl_StdioFile() override;
|
||||
|
||||
QPDF_DLL
|
||||
virtual void write(unsigned char const* buf, size_t len);
|
||||
void write(unsigned char const* buf, size_t len) override;
|
||||
QPDF_DLL
|
||||
virtual void finish();
|
||||
void finish() override;
|
||||
|
||||
private:
|
||||
class QPDF_DLL_PRIVATE Members
|
||||
|
@ -41,12 +41,12 @@ class QPDF_DLL_CLASS Pl_String: public Pipeline
|
||||
QPDF_DLL
|
||||
Pl_String(char const* identifier, Pipeline* next, std::string& s);
|
||||
QPDF_DLL
|
||||
virtual ~Pl_String();
|
||||
~Pl_String() override;
|
||||
|
||||
QPDF_DLL
|
||||
virtual void write(unsigned char const* buf, size_t len);
|
||||
void write(unsigned char const* buf, size_t len) override;
|
||||
QPDF_DLL
|
||||
virtual void finish();
|
||||
void finish() override;
|
||||
|
||||
private:
|
||||
class QPDF_DLL_PRIVATE Members
|
||||
|
@ -942,8 +942,8 @@ class QPDF
|
||||
{
|
||||
public:
|
||||
CopiedStreamDataProvider(QPDF& destination_qpdf);
|
||||
virtual ~CopiedStreamDataProvider() = default;
|
||||
virtual bool provideStreamData(
|
||||
~CopiedStreamDataProvider() override = default;
|
||||
bool provideStreamData(
|
||||
QPDFObjGen const& og,
|
||||
Pipeline* pipeline,
|
||||
bool suppress_warnings,
|
||||
@ -963,8 +963,8 @@ class QPDF
|
||||
|
||||
public:
|
||||
StringDecrypter(QPDF* qpdf, QPDFObjGen const& og);
|
||||
virtual ~StringDecrypter() = default;
|
||||
virtual void decryptString(std::string& val);
|
||||
~StringDecrypter() override = default;
|
||||
void decryptString(std::string& val) override;
|
||||
|
||||
private:
|
||||
QPDF* qpdf;
|
||||
@ -1308,9 +1308,9 @@ class QPDF
|
||||
checker(checker)
|
||||
{
|
||||
}
|
||||
virtual ~PatternFinder() = default;
|
||||
virtual bool
|
||||
check()
|
||||
~PatternFinder() override = default;
|
||||
bool
|
||||
check() override
|
||||
{
|
||||
return (this->qpdf.*checker)();
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ class QPDFAcroFormDocumentHelper: public QPDFDocumentHelper
|
||||
QPDF_DLL
|
||||
QPDFAcroFormDocumentHelper(QPDF&);
|
||||
QPDF_DLL
|
||||
virtual ~QPDFAcroFormDocumentHelper() = default;
|
||||
~QPDFAcroFormDocumentHelper() override = default;
|
||||
|
||||
// This class lazily creates an internal cache of the mapping among form fields, annotations,
|
||||
// and pages. Methods within this class preserve the validity of this cache. However, if you
|
||||
|
@ -30,7 +30,7 @@ class QPDFAnnotationObjectHelper: public QPDFObjectHelper
|
||||
QPDF_DLL
|
||||
QPDFAnnotationObjectHelper(QPDFObjectHandle);
|
||||
QPDF_DLL
|
||||
virtual ~QPDFAnnotationObjectHelper() = default;
|
||||
~QPDFAnnotationObjectHelper() override = default;
|
||||
|
||||
// This class provides helper methods for annotations. More functionality will likely be added
|
||||
// in the future.
|
||||
|
@ -35,7 +35,7 @@ class QPDFEFStreamObjectHelper: public QPDFObjectHelper
|
||||
QPDF_DLL
|
||||
QPDFEFStreamObjectHelper(QPDFObjectHandle);
|
||||
QPDF_DLL
|
||||
virtual ~QPDFEFStreamObjectHelper() = default;
|
||||
~QPDFEFStreamObjectHelper() override = default;
|
||||
|
||||
// Date parameters are strings that conform to the PDF spec for date/time strings, which is
|
||||
// "D:yyyymmddhhmmss<z>" where <z> is either "Z" for UTC or "-hh'mm'" or "+hh'mm'" for timezone
|
||||
|
@ -39,7 +39,7 @@ class QPDFEmbeddedFileDocumentHelper: public QPDFDocumentHelper
|
||||
QPDF_DLL
|
||||
QPDFEmbeddedFileDocumentHelper(QPDF&);
|
||||
QPDF_DLL
|
||||
virtual ~QPDFEmbeddedFileDocumentHelper() = default;
|
||||
~QPDFEmbeddedFileDocumentHelper() override = default;
|
||||
|
||||
QPDF_DLL
|
||||
bool hasEmbeddedFiles() const;
|
||||
|
@ -37,7 +37,7 @@ class QPDF_DLL_CLASS QPDFExc: public std::runtime_error
|
||||
qpdf_offset_t offset,
|
||||
std::string const& message);
|
||||
QPDF_DLL
|
||||
virtual ~QPDFExc() noexcept = default;
|
||||
~QPDFExc() noexcept override = default;
|
||||
|
||||
// To get a complete error string, call what(), provided by std::exception. The accessors below
|
||||
// return the original values used to create the exception. Only the error code and message are
|
||||
|
@ -35,7 +35,7 @@ class QPDFFileSpecObjectHelper: public QPDFObjectHelper
|
||||
QPDF_DLL
|
||||
QPDFFileSpecObjectHelper(QPDFObjectHandle);
|
||||
QPDF_DLL
|
||||
virtual ~QPDFFileSpecObjectHelper() = default;
|
||||
~QPDFFileSpecObjectHelper() override = default;
|
||||
|
||||
QPDF_DLL
|
||||
std::string getDescription();
|
||||
|
@ -37,7 +37,7 @@ class QPDFFormFieldObjectHelper: public QPDFObjectHelper
|
||||
QPDF_DLL
|
||||
QPDFFormFieldObjectHelper(QPDFObjectHandle);
|
||||
QPDF_DLL
|
||||
virtual ~QPDFFormFieldObjectHelper() = default;
|
||||
~QPDFFormFieldObjectHelper() override = default;
|
||||
|
||||
QPDF_DLL
|
||||
bool isNull();
|
||||
|
@ -50,7 +50,7 @@ class QPDF_DLL_CLASS QPDFNameTreeObjectHelper: public QPDFObjectHelper
|
||||
static QPDFNameTreeObjectHelper newEmpty(QPDF&, bool auto_repair = true);
|
||||
|
||||
QPDF_DLL
|
||||
virtual ~QPDFNameTreeObjectHelper();
|
||||
~QPDFNameTreeObjectHelper() override;
|
||||
|
||||
// Return whether the name tree has an explicit entry for this name.
|
||||
QPDF_DLL
|
||||
|
@ -44,7 +44,7 @@ class QPDF_DLL_CLASS QPDFNumberTreeObjectHelper: public QPDFObjectHelper
|
||||
QPDFNumberTreeObjectHelper(QPDFObjectHandle, QPDF&, bool auto_repair = true);
|
||||
|
||||
QPDF_DLL
|
||||
virtual ~QPDFNumberTreeObjectHelper();
|
||||
~QPDFNumberTreeObjectHelper() override;
|
||||
|
||||
// Create an empty number tree
|
||||
QPDF_DLL
|
||||
|
@ -41,7 +41,7 @@ class QPDFOutlineDocumentHelper: public QPDFDocumentHelper
|
||||
QPDF_DLL
|
||||
QPDFOutlineDocumentHelper(QPDF&);
|
||||
QPDF_DLL
|
||||
virtual ~QPDFOutlineDocumentHelper() = default;
|
||||
~QPDFOutlineDocumentHelper() override = default;
|
||||
|
||||
QPDF_DLL
|
||||
bool hasOutlines();
|
||||
|
@ -34,7 +34,7 @@ class QPDFOutlineObjectHelper: public QPDFObjectHelper
|
||||
{
|
||||
public:
|
||||
QPDF_DLL
|
||||
virtual ~QPDFOutlineObjectHelper()
|
||||
~QPDFOutlineObjectHelper() override
|
||||
{
|
||||
// This must be cleared explicitly to avoid circular references that prevent cleanup of
|
||||
// shared pointers.
|
||||
|
@ -37,7 +37,7 @@ class QPDFPageDocumentHelper: public QPDFDocumentHelper
|
||||
QPDF_DLL
|
||||
QPDFPageDocumentHelper(QPDF&);
|
||||
QPDF_DLL
|
||||
virtual ~QPDFPageDocumentHelper() = default;
|
||||
~QPDFPageDocumentHelper() override = default;
|
||||
|
||||
// Traverse page tree, and return all /Page objects wrapped in QPDFPageObjectHelper objects.
|
||||
// Unlike with QPDF::getAllPages, the vector of pages returned by this call is not affected by
|
||||
|
@ -44,7 +44,7 @@ class QPDFPageLabelDocumentHelper: public QPDFDocumentHelper
|
||||
QPDF_DLL
|
||||
QPDFPageLabelDocumentHelper(QPDF&);
|
||||
QPDF_DLL
|
||||
virtual ~QPDFPageLabelDocumentHelper() = default;
|
||||
~QPDFPageLabelDocumentHelper() override = default;
|
||||
|
||||
QPDF_DLL
|
||||
bool hasPageLabels();
|
||||
|
@ -39,7 +39,7 @@ class QPDFPageObjectHelper: public QPDFObjectHelper
|
||||
QPDF_DLL
|
||||
QPDFPageObjectHelper(QPDFObjectHandle);
|
||||
QPDF_DLL
|
||||
virtual ~QPDFPageObjectHelper() = default;
|
||||
~QPDFPageObjectHelper() override = default;
|
||||
|
||||
// PAGE ATTRIBUTES
|
||||
|
||||
|
@ -32,7 +32,7 @@ class QPDF_DLL_CLASS QPDFSystemError: public std::runtime_error
|
||||
QPDF_DLL
|
||||
QPDFSystemError(std::string const& description, int system_errno);
|
||||
QPDF_DLL
|
||||
virtual ~QPDFSystemError() noexcept = default;
|
||||
~QPDFSystemError() noexcept override = default;
|
||||
|
||||
// To get a complete error string, call what(), provided by std::exception. The accessors below
|
||||
// return the original values used to create the exception.
|
||||
|
@ -30,7 +30,7 @@ class QPDF_DLL_CLASS QPDFUsage: public std::runtime_error
|
||||
QPDF_DLL
|
||||
QPDFUsage(std::string const& msg);
|
||||
QPDF_DLL
|
||||
virtual ~QPDFUsage() noexcept = default;
|
||||
~QPDFUsage() noexcept override = default;
|
||||
};
|
||||
|
||||
#endif // QPDFUSAGE_HH
|
||||
|
@ -92,7 +92,7 @@ class QPDFWriter
|
||||
QPDF_DLL
|
||||
FunctionProgressReporter(std::function<void(int)>);
|
||||
QPDF_DLL
|
||||
virtual ~FunctionProgressReporter();
|
||||
~FunctionProgressReporter() override;
|
||||
QPDF_DLL
|
||||
void reportProgress(int) override;
|
||||
|
||||
|
@ -469,8 +469,8 @@ namespace
|
||||
ResourceReplacer(
|
||||
std::map<std::string, std::map<std::string, std::string>> const& dr_map,
|
||||
std::map<std::string, std::map<std::string, std::set<size_t>>> const& rnames);
|
||||
virtual ~ResourceReplacer() = default;
|
||||
virtual void handleToken(QPDFTokenizer::Token const&) override;
|
||||
~ResourceReplacer() override = default;
|
||||
void handleToken(QPDFTokenizer::Token const&) override;
|
||||
|
||||
private:
|
||||
size_t offset{0};
|
||||
|
@ -20,8 +20,8 @@ namespace
|
||||
from_page(from_page)
|
||||
{
|
||||
}
|
||||
virtual ~ContentProvider() = default;
|
||||
virtual void provideStreamData(QPDFObjGen const&, Pipeline* pipeline);
|
||||
~ContentProvider() override = default;
|
||||
void provideStreamData(QPDFObjGen const&, Pipeline* pipeline) override;
|
||||
|
||||
private:
|
||||
QPDFObjectHandle from_page;
|
||||
@ -44,8 +44,8 @@ namespace
|
||||
{
|
||||
public:
|
||||
InlineImageTracker(QPDF*, size_t min_size, QPDFObjectHandle resources);
|
||||
virtual ~InlineImageTracker() = default;
|
||||
virtual void handleToken(QPDFTokenizer::Token const&);
|
||||
~InlineImageTracker() override = default;
|
||||
void handleToken(QPDFTokenizer::Token const&) override;
|
||||
QPDFObjectHandle convertIIDict(QPDFObjectHandle odict);
|
||||
|
||||
QPDF* qpdf;
|
||||
|
@ -238,7 +238,7 @@ class QPDF::JSONReactor: public JSON::Reactor
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual ~JSONReactor() = default;
|
||||
~JSONReactor() override = default;
|
||||
void dictionaryStart() override;
|
||||
void arrayStart() override;
|
||||
void containerEnd(JSON const& value) override;
|
||||
|
@ -10,9 +10,9 @@ class Pl_LZWDecoder: public Pipeline
|
||||
{
|
||||
public:
|
||||
Pl_LZWDecoder(char const* identifier, Pipeline* next, bool early_code_change);
|
||||
virtual ~Pl_LZWDecoder() = default;
|
||||
virtual void write(unsigned char const* buf, size_t len);
|
||||
virtual void finish();
|
||||
~Pl_LZWDecoder() override = default;
|
||||
void write(unsigned char const* buf, size_t len) override;
|
||||
void finish() override;
|
||||
|
||||
private:
|
||||
void sendNextCode();
|
||||
|
@ -14,9 +14,9 @@ class Pl_MD5: public Pipeline
|
||||
{
|
||||
public:
|
||||
Pl_MD5(char const* identifier, Pipeline* next);
|
||||
virtual ~Pl_MD5() = default;
|
||||
virtual void write(unsigned char const*, size_t);
|
||||
virtual void finish();
|
||||
~Pl_MD5() override = default;
|
||||
void write(unsigned char const*, size_t) override;
|
||||
void finish() override;
|
||||
std::string getHexDigest();
|
||||
// Enable/disable. Disabling the pipeline causes it to become a pass-through. This makes it
|
||||
// possible to stick an MD5 pipeline in a pipeline when it may or may not be required. Disabling
|
||||
|
@ -9,14 +9,14 @@
|
||||
class QPDF_Array: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Array() = default;
|
||||
~QPDF_Array() override = default;
|
||||
static std::shared_ptr<QPDFObject> create(std::vector<QPDFObjectHandle> const& items);
|
||||
static std::shared_ptr<QPDFObject>
|
||||
create(std::vector<std::shared_ptr<QPDFObject>>&& items, bool sparse);
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual void disconnect();
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
JSON getJSON(int json_version) override;
|
||||
void disconnect() override;
|
||||
|
||||
int
|
||||
size() const noexcept
|
||||
|
@ -6,11 +6,11 @@
|
||||
class QPDF_Bool: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Bool() = default;
|
||||
~QPDF_Bool() override = default;
|
||||
static std::shared_ptr<QPDFObject> create(bool val);
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
JSON getJSON(int json_version) override;
|
||||
bool getVal() const;
|
||||
|
||||
private:
|
||||
|
@ -6,10 +6,10 @@
|
||||
class QPDF_Destroyed: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Destroyed() = default;
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
~QPDF_Destroyed() override = default;
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
JSON getJSON(int json_version) override;
|
||||
static std::shared_ptr<QPDFValue> getInstance();
|
||||
|
||||
private:
|
||||
|
@ -11,13 +11,13 @@
|
||||
class QPDF_Dictionary: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Dictionary() = default;
|
||||
~QPDF_Dictionary() override = default;
|
||||
static std::shared_ptr<QPDFObject> create(std::map<std::string, QPDFObjectHandle> const& items);
|
||||
static std::shared_ptr<QPDFObject> create(std::map<std::string, QPDFObjectHandle>&& items);
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual void disconnect();
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
JSON getJSON(int json_version) override;
|
||||
void disconnect() override;
|
||||
|
||||
// hasKey() and getKeys() treat keys with null values as if they aren't there. getKey() returns
|
||||
// null for the value of a non-existent key. This is as per the PDF spec.
|
||||
|
@ -6,13 +6,13 @@
|
||||
class QPDF_InlineImage: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_InlineImage() = default;
|
||||
~QPDF_InlineImage() override = default;
|
||||
static std::shared_ptr<QPDFObject> create(std::string const& val);
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual std::string
|
||||
getStringValue() const
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
JSON getJSON(int json_version) override;
|
||||
std::string
|
||||
getStringValue() const override
|
||||
{
|
||||
return val;
|
||||
}
|
||||
|
@ -6,11 +6,11 @@
|
||||
class QPDF_Integer: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Integer() = default;
|
||||
~QPDF_Integer() override = default;
|
||||
static std::shared_ptr<QPDFObject> create(long long value);
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
JSON getJSON(int json_version) override;
|
||||
long long getVal() const;
|
||||
|
||||
private:
|
||||
|
@ -6,16 +6,16 @@
|
||||
class QPDF_Name: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Name() = default;
|
||||
~QPDF_Name() override = default;
|
||||
static std::shared_ptr<QPDFObject> create(std::string const& name);
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
JSON getJSON(int json_version) override;
|
||||
|
||||
// Put # into strings with characters unsuitable for name token
|
||||
static std::string normalizeName(std::string const& name);
|
||||
virtual std::string
|
||||
getStringValue() const
|
||||
std::string
|
||||
getStringValue() const override
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
class QPDF_Null: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Null() = default;
|
||||
~QPDF_Null() override = default;
|
||||
static std::shared_ptr<QPDFObject> create();
|
||||
static std::shared_ptr<QPDFObject> create(
|
||||
std::shared_ptr<QPDFObject> parent,
|
||||
@ -16,9 +16,9 @@ class QPDF_Null: public QPDFValue
|
||||
std::shared_ptr<QPDFValue> parent,
|
||||
std::string_view const& static_descr,
|
||||
std::string var_descr);
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
JSON getJSON(int json_version) override;
|
||||
|
||||
private:
|
||||
QPDF_Null();
|
||||
|
@ -6,13 +6,13 @@
|
||||
class QPDF_Operator: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Operator() = default;
|
||||
~QPDF_Operator() override = default;
|
||||
static std::shared_ptr<QPDFObject> create(std::string const& val);
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual std::string
|
||||
getStringValue() const
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
JSON getJSON(int json_version) override;
|
||||
std::string
|
||||
getStringValue() const override
|
||||
{
|
||||
return val;
|
||||
}
|
||||
|
@ -6,15 +6,15 @@
|
||||
class QPDF_Real: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Real() = default;
|
||||
~QPDF_Real() override = default;
|
||||
static std::shared_ptr<QPDFObject> create(std::string const& val);
|
||||
static std::shared_ptr<QPDFObject>
|
||||
create(double value, int decimal_places, bool trim_trailing_zeroes);
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual std::string
|
||||
getStringValue() const
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
JSON getJSON(int json_version) override;
|
||||
std::string
|
||||
getStringValue() const override
|
||||
{
|
||||
return val;
|
||||
}
|
||||
|
@ -6,11 +6,11 @@
|
||||
class QPDF_Reserved: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Reserved() = default;
|
||||
~QPDF_Reserved() override = default;
|
||||
static std::shared_ptr<QPDFObject> create();
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
JSON getJSON(int json_version) override;
|
||||
|
||||
private:
|
||||
QPDF_Reserved();
|
||||
|
@ -16,19 +16,19 @@ class QPDF;
|
||||
class QPDF_Stream: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Stream() = default;
|
||||
~QPDF_Stream() override = default;
|
||||
static std::shared_ptr<QPDFObject> create(
|
||||
QPDF*,
|
||||
QPDFObjGen const& og,
|
||||
QPDFObjectHandle stream_dict,
|
||||
qpdf_offset_t offset,
|
||||
size_t length);
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual void setDescription(
|
||||
QPDF*, std::shared_ptr<QPDFValue::Description>& description, qpdf_offset_t offset);
|
||||
virtual void disconnect();
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
JSON getJSON(int json_version) override;
|
||||
void setDescription(
|
||||
QPDF*, std::shared_ptr<QPDFValue::Description>& description, qpdf_offset_t offset) override;
|
||||
void disconnect() override;
|
||||
QPDFObjectHandle getDict() const;
|
||||
bool isDataModified() const;
|
||||
void setFilterOnWrite(bool);
|
||||
|
@ -10,16 +10,16 @@ class QPDF_String: public QPDFValue
|
||||
friend class QPDFWriter;
|
||||
|
||||
public:
|
||||
virtual ~QPDF_String() = default;
|
||||
~QPDF_String() override = default;
|
||||
static std::shared_ptr<QPDFObject> create(std::string const& val);
|
||||
static std::shared_ptr<QPDFObject> create_utf16(std::string const& utf8_val);
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
std::string unparse(bool force_binary);
|
||||
virtual JSON getJSON(int json_version);
|
||||
JSON getJSON(int json_version) override;
|
||||
std::string getUTF8Val() const;
|
||||
virtual std::string
|
||||
getStringValue() const
|
||||
std::string
|
||||
getStringValue() const override
|
||||
{
|
||||
return val;
|
||||
}
|
||||
|
@ -6,11 +6,11 @@
|
||||
class QPDF_Unresolved: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Unresolved() = default;
|
||||
~QPDF_Unresolved() override = default;
|
||||
static std::shared_ptr<QPDFObject> create(QPDF* qpdf, QPDFObjGen const& og);
|
||||
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
||||
std::string unparse() override;
|
||||
JSON getJSON(int json_version) override;
|
||||
|
||||
private:
|
||||
QPDF_Unresolved(QPDF* qpdf, QPDFObjGen const& og);
|
||||
|
@ -7,7 +7,7 @@ class ResourceFinder: public QPDFObjectHandle::ParserCallbacks
|
||||
{
|
||||
public:
|
||||
ResourceFinder();
|
||||
virtual ~ResourceFinder() = default;
|
||||
~ResourceFinder() override = default;
|
||||
void handleObject(QPDFObjectHandle, size_t, size_t) override;
|
||||
void handleEOF() override;
|
||||
std::set<std::string> const& getNames() const;
|
||||
|
@ -9,7 +9,7 @@ class SF_ASCII85Decode: public QPDFStreamFilter
|
||||
{
|
||||
public:
|
||||
SF_ASCII85Decode() = default;
|
||||
virtual ~SF_ASCII85Decode() = default;
|
||||
~SF_ASCII85Decode() override = default;
|
||||
|
||||
Pipeline*
|
||||
getDecodePipeline(Pipeline* next) override
|
||||
|
@ -9,7 +9,7 @@ class SF_ASCIIHexDecode: public QPDFStreamFilter
|
||||
{
|
||||
public:
|
||||
SF_ASCIIHexDecode() = default;
|
||||
virtual ~SF_ASCIIHexDecode() = default;
|
||||
~SF_ASCIIHexDecode() override = default;
|
||||
|
||||
Pipeline*
|
||||
getDecodePipeline(Pipeline* next) override
|
||||
|
@ -9,7 +9,7 @@ class SF_DCTDecode: public QPDFStreamFilter
|
||||
{
|
||||
public:
|
||||
SF_DCTDecode() = default;
|
||||
virtual ~SF_DCTDecode() = default;
|
||||
~SF_DCTDecode() override = default;
|
||||
|
||||
Pipeline*
|
||||
getDecodePipeline(Pipeline* next) override
|
||||
|
@ -9,10 +9,10 @@ class SF_FlateLzwDecode: public QPDFStreamFilter
|
||||
{
|
||||
public:
|
||||
SF_FlateLzwDecode(bool lzw);
|
||||
virtual ~SF_FlateLzwDecode() = default;
|
||||
~SF_FlateLzwDecode() override = default;
|
||||
|
||||
virtual bool setDecodeParms(QPDFObjectHandle decode_parms);
|
||||
virtual Pipeline* getDecodePipeline(Pipeline* next);
|
||||
bool setDecodeParms(QPDFObjectHandle decode_parms) override;
|
||||
Pipeline* getDecodePipeline(Pipeline* next) override;
|
||||
|
||||
static std::shared_ptr<QPDFStreamFilter> flate_factory();
|
||||
static std::shared_ptr<QPDFStreamFilter> lzw_factory();
|
||||
|
@ -9,7 +9,7 @@ class SF_RunLengthDecode: public QPDFStreamFilter
|
||||
{
|
||||
public:
|
||||
SF_RunLengthDecode() = default;
|
||||
virtual ~SF_RunLengthDecode() = default;
|
||||
~SF_RunLengthDecode() override = default;
|
||||
|
||||
Pipeline*
|
||||
getDecodePipeline(Pipeline* next) override
|
||||
|
@ -7,8 +7,8 @@ class SecureRandomDataProvider: public RandomDataProvider
|
||||
{
|
||||
public:
|
||||
SecureRandomDataProvider() = default;
|
||||
virtual ~SecureRandomDataProvider() = default;
|
||||
virtual void provideRandomData(unsigned char* data, size_t len);
|
||||
~SecureRandomDataProvider() override = default;
|
||||
void provideRandomData(unsigned char* data, size_t len) override;
|
||||
static RandomDataProvider* getInstance();
|
||||
};
|
||||
|
||||
|
@ -10,7 +10,7 @@ namespace
|
||||
class Reactor: public JSON::Reactor
|
||||
{
|
||||
public:
|
||||
virtual ~Reactor() = default;
|
||||
~Reactor() override = default;
|
||||
void dictionaryStart() override;
|
||||
void arrayStart() override;
|
||||
void containerEnd(JSON const& value) override;
|
||||
|
@ -6,10 +6,10 @@
|
||||
class BogusRandomDataProvider: public RandomDataProvider
|
||||
{
|
||||
public:
|
||||
virtual ~BogusRandomDataProvider() = default;
|
||||
~BogusRandomDataProvider() override = default;
|
||||
BogusRandomDataProvider() = default;
|
||||
virtual void
|
||||
provideRandomData(unsigned char* data, size_t len)
|
||||
void
|
||||
provideRandomData(unsigned char* data, size_t len) override
|
||||
{
|
||||
for (size_t i = 0; i < len; ++i) {
|
||||
data[i] = static_cast<unsigned char>(i & 0xff);
|
||||
|
@ -51,7 +51,7 @@ class ExtendNameTree: public QPDFNameTreeObjectHelper
|
||||
{
|
||||
public:
|
||||
ExtendNameTree(QPDFObjectHandle o, QPDF& q);
|
||||
virtual ~ExtendNameTree();
|
||||
~ExtendNameTree() override;
|
||||
};
|
||||
|
||||
ExtendNameTree::ExtendNameTree(QPDFObjectHandle o, QPDF& q) :
|
||||
@ -71,9 +71,9 @@ class Provider: public QPDFObjectHandle::StreamDataProvider
|
||||
b(b)
|
||||
{
|
||||
}
|
||||
virtual ~Provider() = default;
|
||||
virtual void
|
||||
provideStreamData(int objid, int generation, Pipeline* p)
|
||||
~Provider() override = default;
|
||||
void
|
||||
provideStreamData(int objid, int generation, Pipeline* p) override
|
||||
{
|
||||
// Don't change signature to use QPDFObjGen const& to detect problems forwarding to legacy
|
||||
// implementations.
|
||||
@ -98,10 +98,10 @@ class Provider: public QPDFObjectHandle::StreamDataProvider
|
||||
class ParserCallbacks: public QPDFObjectHandle::ParserCallbacks
|
||||
{
|
||||
public:
|
||||
virtual ~ParserCallbacks() = default;
|
||||
virtual void contentSize(size_t size);
|
||||
virtual void handleObject(QPDFObjectHandle, size_t, size_t);
|
||||
virtual void handleEOF();
|
||||
~ParserCallbacks() override = default;
|
||||
void contentSize(size_t size) override;
|
||||
void handleObject(QPDFObjectHandle, size_t, size_t) override;
|
||||
void handleEOF() override;
|
||||
};
|
||||
|
||||
void
|
||||
@ -137,9 +137,9 @@ class TokenFilter: public QPDFObjectHandle::TokenFilter
|
||||
{
|
||||
public:
|
||||
TokenFilter() = default;
|
||||
virtual ~TokenFilter() = default;
|
||||
virtual void
|
||||
handleToken(QPDFTokenizer::Token const& t)
|
||||
~TokenFilter() override = default;
|
||||
void
|
||||
handleToken(QPDFTokenizer::Token const& t) override
|
||||
{
|
||||
if (t == QPDFTokenizer::Token(QPDFTokenizer::tt_string, "Potato")) {
|
||||
// Exercise unparsing of strings by token constructor
|
||||
@ -148,8 +148,8 @@ class TokenFilter: public QPDFObjectHandle::TokenFilter
|
||||
writeToken(t);
|
||||
}
|
||||
}
|
||||
virtual void
|
||||
handleEOF()
|
||||
void
|
||||
handleEOF() override
|
||||
{
|
||||
writeToken(QPDFTokenizer::Token(QPDFTokenizer::tt_name, "/bye"));
|
||||
write("\n");
|
||||
|
@ -61,9 +61,9 @@ class ImageChecker: public Pipeline
|
||||
{
|
||||
public:
|
||||
ImageChecker(size_t n);
|
||||
virtual ~ImageChecker() = default;
|
||||
virtual void write(unsigned char const* data, size_t len);
|
||||
virtual void finish();
|
||||
~ImageChecker() override = default;
|
||||
void write(unsigned char const* data, size_t len) override;
|
||||
void finish() override;
|
||||
|
||||
private:
|
||||
size_t n;
|
||||
@ -102,8 +102,8 @@ class ImageProvider: public QPDFObjectHandle::StreamDataProvider
|
||||
{
|
||||
public:
|
||||
ImageProvider(size_t n);
|
||||
virtual ~ImageProvider() = default;
|
||||
virtual void provideStreamData(int objid, int generation, Pipeline* pipeline);
|
||||
~ImageProvider() override = default;
|
||||
void provideStreamData(int objid, int generation, Pipeline* pipeline) override;
|
||||
|
||||
private:
|
||||
size_t n;
|
||||
|
@ -28,8 +28,8 @@ class Finder: public InputSource::Finder
|
||||
str(str)
|
||||
{
|
||||
}
|
||||
virtual ~Finder() = default;
|
||||
virtual bool check();
|
||||
~Finder() override = default;
|
||||
bool check() override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<InputSource> is;
|
||||
|
Loading…
Reference in New Issue
Block a user