Code tidy - Clang-Tidy rule modernize-use-override

This commit is contained in:
m-holger 2023-06-01 15:21:32 +01:00
parent ae3642ce42
commit 0ac005f0d9
63 changed files with 199 additions and 199 deletions

View File

@ -32,21 +32,21 @@ class QPDF_DLL_CLASS BufferInputSource: public InputSource
QPDF_DLL QPDF_DLL
BufferInputSource(std::string const& description, std::string const& contents); BufferInputSource(std::string const& description, std::string const& contents);
QPDF_DLL QPDF_DLL
virtual ~BufferInputSource(); ~BufferInputSource() override;
QPDF_DLL QPDF_DLL
virtual qpdf_offset_t findAndSkipNextEOL(); qpdf_offset_t findAndSkipNextEOL() override;
QPDF_DLL QPDF_DLL
virtual std::string const& getName() const; std::string const& getName() const override;
QPDF_DLL QPDF_DLL
virtual qpdf_offset_t tell(); qpdf_offset_t tell() override;
QPDF_DLL QPDF_DLL
virtual void seek(qpdf_offset_t offset, int whence); void seek(qpdf_offset_t offset, int whence) override;
QPDF_DLL QPDF_DLL
virtual void rewind(); void rewind() override;
QPDF_DLL QPDF_DLL
virtual size_t read(char* buffer, size_t length); size_t read(char* buffer, size_t length) override;
QPDF_DLL QPDF_DLL
virtual void unreadCh(char ch); void unreadCh(char ch) override;
private: private:
bool own_memory; bool own_memory;

View File

@ -37,21 +37,21 @@ class QPDF_DLL_CLASS ClosedFileInputSource: public InputSource
QPDF_DLL QPDF_DLL
ClosedFileInputSource(char const* filename); ClosedFileInputSource(char const* filename);
QPDF_DLL QPDF_DLL
virtual ~ClosedFileInputSource(); ~ClosedFileInputSource() override;
QPDF_DLL QPDF_DLL
virtual qpdf_offset_t findAndSkipNextEOL(); qpdf_offset_t findAndSkipNextEOL() override;
QPDF_DLL QPDF_DLL
virtual std::string const& getName() const; std::string const& getName() const override;
QPDF_DLL QPDF_DLL
virtual qpdf_offset_t tell(); qpdf_offset_t tell() override;
QPDF_DLL QPDF_DLL
virtual void seek(qpdf_offset_t offset, int whence); void seek(qpdf_offset_t offset, int whence) override;
QPDF_DLL QPDF_DLL
virtual void rewind(); void rewind() override;
QPDF_DLL QPDF_DLL
virtual size_t read(char* buffer, size_t length); size_t read(char* buffer, size_t length) override;
QPDF_DLL 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 // 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 // surround multiple operations on a single ClosedFileInputSource to reduce the overhead of a

View File

@ -35,21 +35,21 @@ class QPDF_DLL_CLASS FileInputSource: public InputSource
QPDF_DLL QPDF_DLL
void setFile(char const* description, FILE* filep, bool close_file); void setFile(char const* description, FILE* filep, bool close_file);
QPDF_DLL QPDF_DLL
virtual ~FileInputSource(); ~FileInputSource() override;
QPDF_DLL QPDF_DLL
virtual qpdf_offset_t findAndSkipNextEOL(); qpdf_offset_t findAndSkipNextEOL() override;
QPDF_DLL QPDF_DLL
virtual std::string const& getName() const; std::string const& getName() const override;
QPDF_DLL QPDF_DLL
virtual qpdf_offset_t tell(); qpdf_offset_t tell() override;
QPDF_DLL QPDF_DLL
virtual void seek(qpdf_offset_t offset, int whence); void seek(qpdf_offset_t offset, int whence) override;
QPDF_DLL QPDF_DLL
virtual void rewind(); void rewind() override;
QPDF_DLL QPDF_DLL
virtual size_t read(char* buffer, size_t length); size_t read(char* buffer, size_t length) override;
QPDF_DLL QPDF_DLL
virtual void unreadCh(char ch); void unreadCh(char ch) override;
private: private:
FileInputSource(FileInputSource const&) = delete; FileInputSource(FileInputSource const&) = delete;

View File

@ -32,13 +32,13 @@ class QPDF_DLL_CLASS Pl_Concatenate: public Pipeline
QPDF_DLL QPDF_DLL
Pl_Concatenate(char const* identifier, Pipeline* next); Pl_Concatenate(char const* identifier, Pipeline* next);
QPDF_DLL QPDF_DLL
virtual ~Pl_Concatenate(); ~Pl_Concatenate() override;
QPDF_DLL QPDF_DLL
virtual void write(unsigned char const* data, size_t len); void write(unsigned char const* data, size_t len) override;
QPDF_DLL QPDF_DLL
virtual void finish(); void finish() override;
// At the very end, call manualFinish to actually finish the rest of the pipeline. // At the very end, call manualFinish to actually finish the rest of the pipeline.
QPDF_DLL QPDF_DLL

View File

@ -30,11 +30,11 @@ class QPDF_DLL_CLASS Pl_Count: public Pipeline
QPDF_DLL QPDF_DLL
Pl_Count(char const* identifier, Pipeline* next); Pl_Count(char const* identifier, Pipeline* next);
QPDF_DLL QPDF_DLL
virtual ~Pl_Count(); ~Pl_Count() override;
QPDF_DLL QPDF_DLL
virtual void write(unsigned char const*, size_t); void write(unsigned char const*, size_t) override;
QPDF_DLL QPDF_DLL
virtual void finish(); void finish() override;
// Returns the number of bytes written // Returns the number of bytes written
QPDF_DLL QPDF_DLL
qpdf_offset_t getCount() const; qpdf_offset_t getCount() const;

View File

@ -56,12 +56,12 @@ class QPDF_DLL_CLASS Pl_DCT: public Pipeline
CompressConfig* config_callback = nullptr); CompressConfig* config_callback = nullptr);
QPDF_DLL QPDF_DLL
virtual ~Pl_DCT(); ~Pl_DCT() override;
QPDF_DLL QPDF_DLL
virtual void write(unsigned char const* data, size_t len); void write(unsigned char const* data, size_t len) override;
QPDF_DLL QPDF_DLL
virtual void finish(); void finish() override;
private: private:
QPDF_DLL_PRIVATE QPDF_DLL_PRIVATE

View File

@ -31,11 +31,11 @@ class QPDF_DLL_CLASS Pl_Discard: public Pipeline
QPDF_DLL QPDF_DLL
Pl_Discard(); Pl_Discard();
QPDF_DLL QPDF_DLL
virtual ~Pl_Discard(); ~Pl_Discard() override;
QPDF_DLL QPDF_DLL
virtual void write(unsigned char const*, size_t); void write(unsigned char const*, size_t) override;
QPDF_DLL QPDF_DLL
virtual void finish(); void finish() override;
private: private:
class QPDF_DLL_PRIVATE Members class QPDF_DLL_PRIVATE Members

View File

@ -40,12 +40,12 @@ class QPDF_DLL_CLASS Pl_Flate: public Pipeline
action_e action, action_e action,
unsigned int out_bufsize = def_bufsize); unsigned int out_bufsize = def_bufsize);
QPDF_DLL QPDF_DLL
virtual ~Pl_Flate(); ~Pl_Flate() override;
QPDF_DLL QPDF_DLL
virtual void write(unsigned char const* data, size_t len); void write(unsigned char const* data, size_t len) override;
QPDF_DLL QPDF_DLL
virtual void finish(); void finish() override;
// Globally set compression level from 1 (fastest, least // Globally set compression level from 1 (fastest, least
// compression) to 9 (slowest, most compression). Use -1 to set // compression) to 9 (slowest, most compression). Use -1 to set

View File

@ -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); Pl_Function(char const* identifier, Pipeline* next, writer_c_char_t fn, void* udata);
QPDF_DLL QPDF_DLL
virtual ~Pl_Function(); ~Pl_Function() override;
QPDF_DLL QPDF_DLL
virtual void write(unsigned char const* buf, size_t len); void write(unsigned char const* buf, size_t len) override;
QPDF_DLL QPDF_DLL
virtual void finish(); void finish() override;
private: private:
class QPDF_DLL_PRIVATE Members class QPDF_DLL_PRIVATE Members

View File

@ -36,12 +36,12 @@ class QPDF_DLL_CLASS Pl_OStream: public Pipeline
QPDF_DLL QPDF_DLL
Pl_OStream(char const* identifier, std::ostream& os); Pl_OStream(char const* identifier, std::ostream& os);
QPDF_DLL QPDF_DLL
virtual ~Pl_OStream(); ~Pl_OStream() override;
QPDF_DLL QPDF_DLL
virtual void write(unsigned char const* buf, size_t len); void write(unsigned char const* buf, size_t len) override;
QPDF_DLL QPDF_DLL
virtual void finish(); void finish() override;
private: private:
class QPDF_DLL_PRIVATE Members class QPDF_DLL_PRIVATE Members

View File

@ -45,11 +45,11 @@ class QPDF_DLL_CLASS Pl_QPDFTokenizer: public Pipeline
Pl_QPDFTokenizer( Pl_QPDFTokenizer(
char const* identifier, QPDFObjectHandle::TokenFilter* filter, Pipeline* next = nullptr); char const* identifier, QPDFObjectHandle::TokenFilter* filter, Pipeline* next = nullptr);
QPDF_DLL QPDF_DLL
virtual ~Pl_QPDFTokenizer(); ~Pl_QPDFTokenizer() override;
QPDF_DLL QPDF_DLL
virtual void write(unsigned char const* buf, size_t len); void write(unsigned char const* buf, size_t len) override;
QPDF_DLL QPDF_DLL
virtual void finish(); void finish() override;
private: private:
class QPDF_DLL_PRIVATE Members class QPDF_DLL_PRIVATE Members

View File

@ -29,12 +29,12 @@ class QPDF_DLL_CLASS Pl_RunLength: public Pipeline
QPDF_DLL QPDF_DLL
Pl_RunLength(char const* identifier, Pipeline* next, action_e action); Pl_RunLength(char const* identifier, Pipeline* next, action_e action);
QPDF_DLL QPDF_DLL
virtual ~Pl_RunLength(); ~Pl_RunLength() override;
QPDF_DLL QPDF_DLL
virtual void write(unsigned char const* data, size_t len); void write(unsigned char const* data, size_t len) override;
QPDF_DLL QPDF_DLL
virtual void finish(); void finish() override;
private: private:
QPDF_DLL_PRIVATE QPDF_DLL_PRIVATE

View File

@ -36,12 +36,12 @@ class QPDF_DLL_CLASS Pl_StdioFile: public Pipeline
QPDF_DLL QPDF_DLL
Pl_StdioFile(char const* identifier, FILE* f); Pl_StdioFile(char const* identifier, FILE* f);
QPDF_DLL QPDF_DLL
virtual ~Pl_StdioFile(); ~Pl_StdioFile() override;
QPDF_DLL QPDF_DLL
virtual void write(unsigned char const* buf, size_t len); void write(unsigned char const* buf, size_t len) override;
QPDF_DLL QPDF_DLL
virtual void finish(); void finish() override;
private: private:
class QPDF_DLL_PRIVATE Members class QPDF_DLL_PRIVATE Members

View File

@ -41,12 +41,12 @@ class QPDF_DLL_CLASS Pl_String: public Pipeline
QPDF_DLL QPDF_DLL
Pl_String(char const* identifier, Pipeline* next, std::string& s); Pl_String(char const* identifier, Pipeline* next, std::string& s);
QPDF_DLL QPDF_DLL
virtual ~Pl_String(); ~Pl_String() override;
QPDF_DLL QPDF_DLL
virtual void write(unsigned char const* buf, size_t len); void write(unsigned char const* buf, size_t len) override;
QPDF_DLL QPDF_DLL
virtual void finish(); void finish() override;
private: private:
class QPDF_DLL_PRIVATE Members class QPDF_DLL_PRIVATE Members

View File

@ -942,8 +942,8 @@ class QPDF
{ {
public: public:
CopiedStreamDataProvider(QPDF& destination_qpdf); CopiedStreamDataProvider(QPDF& destination_qpdf);
virtual ~CopiedStreamDataProvider() = default; ~CopiedStreamDataProvider() override = default;
virtual bool provideStreamData( bool provideStreamData(
QPDFObjGen const& og, QPDFObjGen const& og,
Pipeline* pipeline, Pipeline* pipeline,
bool suppress_warnings, bool suppress_warnings,
@ -963,8 +963,8 @@ class QPDF
public: public:
StringDecrypter(QPDF* qpdf, QPDFObjGen const& og); StringDecrypter(QPDF* qpdf, QPDFObjGen const& og);
virtual ~StringDecrypter() = default; ~StringDecrypter() override = default;
virtual void decryptString(std::string& val); void decryptString(std::string& val) override;
private: private:
QPDF* qpdf; QPDF* qpdf;
@ -1308,9 +1308,9 @@ class QPDF
checker(checker) checker(checker)
{ {
} }
virtual ~PatternFinder() = default; ~PatternFinder() override = default;
virtual bool bool
check() check() override
{ {
return (this->qpdf.*checker)(); return (this->qpdf.*checker)();
} }

View File

@ -71,7 +71,7 @@ class QPDFAcroFormDocumentHelper: public QPDFDocumentHelper
QPDF_DLL QPDF_DLL
QPDFAcroFormDocumentHelper(QPDF&); QPDFAcroFormDocumentHelper(QPDF&);
QPDF_DLL QPDF_DLL
virtual ~QPDFAcroFormDocumentHelper() = default; ~QPDFAcroFormDocumentHelper() override = default;
// This class lazily creates an internal cache of the mapping among form fields, annotations, // 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 // and pages. Methods within this class preserve the validity of this cache. However, if you

View File

@ -30,7 +30,7 @@ class QPDFAnnotationObjectHelper: public QPDFObjectHelper
QPDF_DLL QPDF_DLL
QPDFAnnotationObjectHelper(QPDFObjectHandle); QPDFAnnotationObjectHelper(QPDFObjectHandle);
QPDF_DLL QPDF_DLL
virtual ~QPDFAnnotationObjectHelper() = default; ~QPDFAnnotationObjectHelper() override = default;
// This class provides helper methods for annotations. More functionality will likely be added // This class provides helper methods for annotations. More functionality will likely be added
// in the future. // in the future.

View File

@ -35,7 +35,7 @@ class QPDFEFStreamObjectHelper: public QPDFObjectHelper
QPDF_DLL QPDF_DLL
QPDFEFStreamObjectHelper(QPDFObjectHandle); QPDFEFStreamObjectHelper(QPDFObjectHandle);
QPDF_DLL QPDF_DLL
virtual ~QPDFEFStreamObjectHelper() = default; ~QPDFEFStreamObjectHelper() override = default;
// Date parameters are strings that conform to the PDF spec for date/time strings, which is // 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 // "D:yyyymmddhhmmss<z>" where <z> is either "Z" for UTC or "-hh'mm'" or "+hh'mm'" for timezone

View File

@ -39,7 +39,7 @@ class QPDFEmbeddedFileDocumentHelper: public QPDFDocumentHelper
QPDF_DLL QPDF_DLL
QPDFEmbeddedFileDocumentHelper(QPDF&); QPDFEmbeddedFileDocumentHelper(QPDF&);
QPDF_DLL QPDF_DLL
virtual ~QPDFEmbeddedFileDocumentHelper() = default; ~QPDFEmbeddedFileDocumentHelper() override = default;
QPDF_DLL QPDF_DLL
bool hasEmbeddedFiles() const; bool hasEmbeddedFiles() const;

View File

@ -37,7 +37,7 @@ class QPDF_DLL_CLASS QPDFExc: public std::runtime_error
qpdf_offset_t offset, qpdf_offset_t offset,
std::string const& message); std::string const& message);
QPDF_DLL 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 // 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 // return the original values used to create the exception. Only the error code and message are

View File

@ -35,7 +35,7 @@ class QPDFFileSpecObjectHelper: public QPDFObjectHelper
QPDF_DLL QPDF_DLL
QPDFFileSpecObjectHelper(QPDFObjectHandle); QPDFFileSpecObjectHelper(QPDFObjectHandle);
QPDF_DLL QPDF_DLL
virtual ~QPDFFileSpecObjectHelper() = default; ~QPDFFileSpecObjectHelper() override = default;
QPDF_DLL QPDF_DLL
std::string getDescription(); std::string getDescription();

View File

@ -37,7 +37,7 @@ class QPDFFormFieldObjectHelper: public QPDFObjectHelper
QPDF_DLL QPDF_DLL
QPDFFormFieldObjectHelper(QPDFObjectHandle); QPDFFormFieldObjectHelper(QPDFObjectHandle);
QPDF_DLL QPDF_DLL
virtual ~QPDFFormFieldObjectHelper() = default; ~QPDFFormFieldObjectHelper() override = default;
QPDF_DLL QPDF_DLL
bool isNull(); bool isNull();

View File

@ -50,7 +50,7 @@ class QPDF_DLL_CLASS QPDFNameTreeObjectHelper: public QPDFObjectHelper
static QPDFNameTreeObjectHelper newEmpty(QPDF&, bool auto_repair = true); static QPDFNameTreeObjectHelper newEmpty(QPDF&, bool auto_repair = true);
QPDF_DLL QPDF_DLL
virtual ~QPDFNameTreeObjectHelper(); ~QPDFNameTreeObjectHelper() override;
// Return whether the name tree has an explicit entry for this name. // Return whether the name tree has an explicit entry for this name.
QPDF_DLL QPDF_DLL

View File

@ -44,7 +44,7 @@ class QPDF_DLL_CLASS QPDFNumberTreeObjectHelper: public QPDFObjectHelper
QPDFNumberTreeObjectHelper(QPDFObjectHandle, QPDF&, bool auto_repair = true); QPDFNumberTreeObjectHelper(QPDFObjectHandle, QPDF&, bool auto_repair = true);
QPDF_DLL QPDF_DLL
virtual ~QPDFNumberTreeObjectHelper(); ~QPDFNumberTreeObjectHelper() override;
// Create an empty number tree // Create an empty number tree
QPDF_DLL QPDF_DLL

View File

@ -41,7 +41,7 @@ class QPDFOutlineDocumentHelper: public QPDFDocumentHelper
QPDF_DLL QPDF_DLL
QPDFOutlineDocumentHelper(QPDF&); QPDFOutlineDocumentHelper(QPDF&);
QPDF_DLL QPDF_DLL
virtual ~QPDFOutlineDocumentHelper() = default; ~QPDFOutlineDocumentHelper() override = default;
QPDF_DLL QPDF_DLL
bool hasOutlines(); bool hasOutlines();

View File

@ -34,7 +34,7 @@ class QPDFOutlineObjectHelper: public QPDFObjectHelper
{ {
public: public:
QPDF_DLL QPDF_DLL
virtual ~QPDFOutlineObjectHelper() ~QPDFOutlineObjectHelper() override
{ {
// This must be cleared explicitly to avoid circular references that prevent cleanup of // This must be cleared explicitly to avoid circular references that prevent cleanup of
// shared pointers. // shared pointers.

View File

@ -37,7 +37,7 @@ class QPDFPageDocumentHelper: public QPDFDocumentHelper
QPDF_DLL QPDF_DLL
QPDFPageDocumentHelper(QPDF&); QPDFPageDocumentHelper(QPDF&);
QPDF_DLL QPDF_DLL
virtual ~QPDFPageDocumentHelper() = default; ~QPDFPageDocumentHelper() override = default;
// Traverse page tree, and return all /Page objects wrapped in QPDFPageObjectHelper objects. // 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 // Unlike with QPDF::getAllPages, the vector of pages returned by this call is not affected by

View File

@ -44,7 +44,7 @@ class QPDFPageLabelDocumentHelper: public QPDFDocumentHelper
QPDF_DLL QPDF_DLL
QPDFPageLabelDocumentHelper(QPDF&); QPDFPageLabelDocumentHelper(QPDF&);
QPDF_DLL QPDF_DLL
virtual ~QPDFPageLabelDocumentHelper() = default; ~QPDFPageLabelDocumentHelper() override = default;
QPDF_DLL QPDF_DLL
bool hasPageLabels(); bool hasPageLabels();

View File

@ -39,7 +39,7 @@ class QPDFPageObjectHelper: public QPDFObjectHelper
QPDF_DLL QPDF_DLL
QPDFPageObjectHelper(QPDFObjectHandle); QPDFPageObjectHelper(QPDFObjectHandle);
QPDF_DLL QPDF_DLL
virtual ~QPDFPageObjectHelper() = default; ~QPDFPageObjectHelper() override = default;
// PAGE ATTRIBUTES // PAGE ATTRIBUTES

View File

@ -32,7 +32,7 @@ class QPDF_DLL_CLASS QPDFSystemError: public std::runtime_error
QPDF_DLL QPDF_DLL
QPDFSystemError(std::string const& description, int system_errno); QPDFSystemError(std::string const& description, int system_errno);
QPDF_DLL 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 // To get a complete error string, call what(), provided by std::exception. The accessors below
// return the original values used to create the exception. // return the original values used to create the exception.

View File

@ -30,7 +30,7 @@ class QPDF_DLL_CLASS QPDFUsage: public std::runtime_error
QPDF_DLL QPDF_DLL
QPDFUsage(std::string const& msg); QPDFUsage(std::string const& msg);
QPDF_DLL QPDF_DLL
virtual ~QPDFUsage() noexcept = default; ~QPDFUsage() noexcept override = default;
}; };
#endif // QPDFUSAGE_HH #endif // QPDFUSAGE_HH

View File

@ -92,7 +92,7 @@ class QPDFWriter
QPDF_DLL QPDF_DLL
FunctionProgressReporter(std::function<void(int)>); FunctionProgressReporter(std::function<void(int)>);
QPDF_DLL QPDF_DLL
virtual ~FunctionProgressReporter(); ~FunctionProgressReporter() override;
QPDF_DLL QPDF_DLL
void reportProgress(int) override; void reportProgress(int) override;

View File

@ -469,8 +469,8 @@ namespace
ResourceReplacer( ResourceReplacer(
std::map<std::string, std::map<std::string, std::string>> const& dr_map, 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); std::map<std::string, std::map<std::string, std::set<size_t>>> const& rnames);
virtual ~ResourceReplacer() = default; ~ResourceReplacer() override = default;
virtual void handleToken(QPDFTokenizer::Token const&) override; void handleToken(QPDFTokenizer::Token const&) override;
private: private:
size_t offset{0}; size_t offset{0};

View File

@ -20,8 +20,8 @@ namespace
from_page(from_page) from_page(from_page)
{ {
} }
virtual ~ContentProvider() = default; ~ContentProvider() override = default;
virtual void provideStreamData(QPDFObjGen const&, Pipeline* pipeline); void provideStreamData(QPDFObjGen const&, Pipeline* pipeline) override;
private: private:
QPDFObjectHandle from_page; QPDFObjectHandle from_page;
@ -44,8 +44,8 @@ namespace
{ {
public: public:
InlineImageTracker(QPDF*, size_t min_size, QPDFObjectHandle resources); InlineImageTracker(QPDF*, size_t min_size, QPDFObjectHandle resources);
virtual ~InlineImageTracker() = default; ~InlineImageTracker() override = default;
virtual void handleToken(QPDFTokenizer::Token const&); void handleToken(QPDFTokenizer::Token const&) override;
QPDFObjectHandle convertIIDict(QPDFObjectHandle odict); QPDFObjectHandle convertIIDict(QPDFObjectHandle odict);
QPDF* qpdf; QPDF* qpdf;

View File

@ -238,7 +238,7 @@ class QPDF::JSONReactor: public JSON::Reactor
} }
} }
} }
virtual ~JSONReactor() = default; ~JSONReactor() override = default;
void dictionaryStart() override; void dictionaryStart() override;
void arrayStart() override; void arrayStart() override;
void containerEnd(JSON const& value) override; void containerEnd(JSON const& value) override;

View File

@ -10,9 +10,9 @@ class Pl_LZWDecoder: public Pipeline
{ {
public: public:
Pl_LZWDecoder(char const* identifier, Pipeline* next, bool early_code_change); Pl_LZWDecoder(char const* identifier, Pipeline* next, bool early_code_change);
virtual ~Pl_LZWDecoder() = default; ~Pl_LZWDecoder() override = default;
virtual void write(unsigned char const* buf, size_t len); void write(unsigned char const* buf, size_t len) override;
virtual void finish(); void finish() override;
private: private:
void sendNextCode(); void sendNextCode();

View File

@ -14,9 +14,9 @@ class Pl_MD5: public Pipeline
{ {
public: public:
Pl_MD5(char const* identifier, Pipeline* next); Pl_MD5(char const* identifier, Pipeline* next);
virtual ~Pl_MD5() = default; ~Pl_MD5() override = default;
virtual void write(unsigned char const*, size_t); void write(unsigned char const*, size_t) override;
virtual void finish(); void finish() override;
std::string getHexDigest(); std::string getHexDigest();
// Enable/disable. Disabling the pipeline causes it to become a pass-through. This makes it // 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 // possible to stick an MD5 pipeline in a pipeline when it may or may not be required. Disabling

View File

@ -9,14 +9,14 @@
class QPDF_Array: public QPDFValue class QPDF_Array: public QPDFValue
{ {
public: 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<QPDFObjectHandle> const& items);
static std::shared_ptr<QPDFObject> static std::shared_ptr<QPDFObject>
create(std::vector<std::shared_ptr<QPDFObject>>&& items, bool sparse); create(std::vector<std::shared_ptr<QPDFObject>>&& items, bool sparse);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
virtual void disconnect(); void disconnect() override;
int int
size() const noexcept size() const noexcept

View File

@ -6,11 +6,11 @@
class QPDF_Bool: public QPDFValue class QPDF_Bool: public QPDFValue
{ {
public: public:
virtual ~QPDF_Bool() = default; ~QPDF_Bool() override = default;
static std::shared_ptr<QPDFObject> create(bool val); static std::shared_ptr<QPDFObject> create(bool val);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
bool getVal() const; bool getVal() const;
private: private:

View File

@ -6,10 +6,10 @@
class QPDF_Destroyed: public QPDFValue class QPDF_Destroyed: public QPDFValue
{ {
public: public:
virtual ~QPDF_Destroyed() = default; ~QPDF_Destroyed() override = default;
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
static std::shared_ptr<QPDFValue> getInstance(); static std::shared_ptr<QPDFValue> getInstance();
private: private:

View File

@ -11,13 +11,13 @@
class QPDF_Dictionary: public QPDFValue class QPDF_Dictionary: public QPDFValue
{ {
public: 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> const& items);
static std::shared_ptr<QPDFObject> create(std::map<std::string, QPDFObjectHandle>&& items); static std::shared_ptr<QPDFObject> create(std::map<std::string, QPDFObjectHandle>&& items);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
virtual void disconnect(); void disconnect() override;
// hasKey() and getKeys() treat keys with null values as if they aren't there. getKey() returns // 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. // null for the value of a non-existent key. This is as per the PDF spec.

View File

@ -6,13 +6,13 @@
class QPDF_InlineImage: public QPDFValue class QPDF_InlineImage: public QPDFValue
{ {
public: public:
virtual ~QPDF_InlineImage() = default; ~QPDF_InlineImage() override = default;
static std::shared_ptr<QPDFObject> create(std::string const& val); static std::shared_ptr<QPDFObject> create(std::string const& val);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
virtual std::string std::string
getStringValue() const getStringValue() const override
{ {
return val; return val;
} }

View File

@ -6,11 +6,11 @@
class QPDF_Integer: public QPDFValue class QPDF_Integer: public QPDFValue
{ {
public: public:
virtual ~QPDF_Integer() = default; ~QPDF_Integer() override = default;
static std::shared_ptr<QPDFObject> create(long long value); static std::shared_ptr<QPDFObject> create(long long value);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
long long getVal() const; long long getVal() const;
private: private:

View File

@ -6,16 +6,16 @@
class QPDF_Name: public QPDFValue class QPDF_Name: public QPDFValue
{ {
public: public:
virtual ~QPDF_Name() = default; ~QPDF_Name() override = default;
static std::shared_ptr<QPDFObject> create(std::string const& name); static std::shared_ptr<QPDFObject> create(std::string const& name);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
// Put # into strings with characters unsuitable for name token // Put # into strings with characters unsuitable for name token
static std::string normalizeName(std::string const& name); static std::string normalizeName(std::string const& name);
virtual std::string std::string
getStringValue() const getStringValue() const override
{ {
return name; return name;
} }

View File

@ -6,7 +6,7 @@
class QPDF_Null: public QPDFValue class QPDF_Null: public QPDFValue
{ {
public: public:
virtual ~QPDF_Null() = default; ~QPDF_Null() override = default;
static std::shared_ptr<QPDFObject> create(); static std::shared_ptr<QPDFObject> create();
static std::shared_ptr<QPDFObject> create( static std::shared_ptr<QPDFObject> create(
std::shared_ptr<QPDFObject> parent, std::shared_ptr<QPDFObject> parent,
@ -16,9 +16,9 @@ class QPDF_Null: public QPDFValue
std::shared_ptr<QPDFValue> parent, std::shared_ptr<QPDFValue> parent,
std::string_view const& static_descr, std::string_view const& static_descr,
std::string var_descr); std::string var_descr);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
private: private:
QPDF_Null(); QPDF_Null();

View File

@ -6,13 +6,13 @@
class QPDF_Operator: public QPDFValue class QPDF_Operator: public QPDFValue
{ {
public: public:
virtual ~QPDF_Operator() = default; ~QPDF_Operator() override = default;
static std::shared_ptr<QPDFObject> create(std::string const& val); static std::shared_ptr<QPDFObject> create(std::string const& val);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
virtual std::string std::string
getStringValue() const getStringValue() const override
{ {
return val; return val;
} }

View File

@ -6,15 +6,15 @@
class QPDF_Real: public QPDFValue class QPDF_Real: public QPDFValue
{ {
public: 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(std::string const& val);
static std::shared_ptr<QPDFObject> static std::shared_ptr<QPDFObject>
create(double value, int decimal_places, bool trim_trailing_zeroes); create(double value, int decimal_places, bool trim_trailing_zeroes);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
virtual std::string std::string
getStringValue() const getStringValue() const override
{ {
return val; return val;
} }

View File

@ -6,11 +6,11 @@
class QPDF_Reserved: public QPDFValue class QPDF_Reserved: public QPDFValue
{ {
public: public:
virtual ~QPDF_Reserved() = default; ~QPDF_Reserved() override = default;
static std::shared_ptr<QPDFObject> create(); static std::shared_ptr<QPDFObject> create();
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
private: private:
QPDF_Reserved(); QPDF_Reserved();

View File

@ -16,19 +16,19 @@ class QPDF;
class QPDF_Stream: public QPDFValue class QPDF_Stream: public QPDFValue
{ {
public: public:
virtual ~QPDF_Stream() = default; ~QPDF_Stream() override = default;
static std::shared_ptr<QPDFObject> create( static std::shared_ptr<QPDFObject> create(
QPDF*, QPDF*,
QPDFObjGen const& og, QPDFObjGen const& og,
QPDFObjectHandle stream_dict, QPDFObjectHandle stream_dict,
qpdf_offset_t offset, qpdf_offset_t offset,
size_t length); size_t length);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
virtual void setDescription( void setDescription(
QPDF*, std::shared_ptr<QPDFValue::Description>& description, qpdf_offset_t offset); QPDF*, std::shared_ptr<QPDFValue::Description>& description, qpdf_offset_t offset) override;
virtual void disconnect(); void disconnect() override;
QPDFObjectHandle getDict() const; QPDFObjectHandle getDict() const;
bool isDataModified() const; bool isDataModified() const;
void setFilterOnWrite(bool); void setFilterOnWrite(bool);

View File

@ -10,16 +10,16 @@ class QPDF_String: public QPDFValue
friend class QPDFWriter; friend class QPDFWriter;
public: 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(std::string const& val);
static std::shared_ptr<QPDFObject> create_utf16(std::string const& utf8_val); static std::shared_ptr<QPDFObject> create_utf16(std::string const& utf8_val);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
std::string unparse(bool force_binary); std::string unparse(bool force_binary);
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
std::string getUTF8Val() const; std::string getUTF8Val() const;
virtual std::string std::string
getStringValue() const getStringValue() const override
{ {
return val; return val;
} }

View File

@ -6,11 +6,11 @@
class QPDF_Unresolved: public QPDFValue class QPDF_Unresolved: public QPDFValue
{ {
public: public:
virtual ~QPDF_Unresolved() = default; ~QPDF_Unresolved() override = default;
static std::shared_ptr<QPDFObject> create(QPDF* qpdf, QPDFObjGen const& og); static std::shared_ptr<QPDFObject> create(QPDF* qpdf, QPDFObjGen const& og);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false); std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
virtual std::string unparse(); std::string unparse() override;
virtual JSON getJSON(int json_version); JSON getJSON(int json_version) override;
private: private:
QPDF_Unresolved(QPDF* qpdf, QPDFObjGen const& og); QPDF_Unresolved(QPDF* qpdf, QPDFObjGen const& og);

View File

@ -7,7 +7,7 @@ class ResourceFinder: public QPDFObjectHandle::ParserCallbacks
{ {
public: public:
ResourceFinder(); ResourceFinder();
virtual ~ResourceFinder() = default; ~ResourceFinder() override = default;
void handleObject(QPDFObjectHandle, size_t, size_t) override; void handleObject(QPDFObjectHandle, size_t, size_t) override;
void handleEOF() override; void handleEOF() override;
std::set<std::string> const& getNames() const; std::set<std::string> const& getNames() const;

View File

@ -9,7 +9,7 @@ class SF_ASCII85Decode: public QPDFStreamFilter
{ {
public: public:
SF_ASCII85Decode() = default; SF_ASCII85Decode() = default;
virtual ~SF_ASCII85Decode() = default; ~SF_ASCII85Decode() override = default;
Pipeline* Pipeline*
getDecodePipeline(Pipeline* next) override getDecodePipeline(Pipeline* next) override

View File

@ -9,7 +9,7 @@ class SF_ASCIIHexDecode: public QPDFStreamFilter
{ {
public: public:
SF_ASCIIHexDecode() = default; SF_ASCIIHexDecode() = default;
virtual ~SF_ASCIIHexDecode() = default; ~SF_ASCIIHexDecode() override = default;
Pipeline* Pipeline*
getDecodePipeline(Pipeline* next) override getDecodePipeline(Pipeline* next) override

View File

@ -9,7 +9,7 @@ class SF_DCTDecode: public QPDFStreamFilter
{ {
public: public:
SF_DCTDecode() = default; SF_DCTDecode() = default;
virtual ~SF_DCTDecode() = default; ~SF_DCTDecode() override = default;
Pipeline* Pipeline*
getDecodePipeline(Pipeline* next) override getDecodePipeline(Pipeline* next) override

View File

@ -9,10 +9,10 @@ class SF_FlateLzwDecode: public QPDFStreamFilter
{ {
public: public:
SF_FlateLzwDecode(bool lzw); SF_FlateLzwDecode(bool lzw);
virtual ~SF_FlateLzwDecode() = default; ~SF_FlateLzwDecode() override = default;
virtual bool setDecodeParms(QPDFObjectHandle decode_parms); bool setDecodeParms(QPDFObjectHandle decode_parms) override;
virtual Pipeline* getDecodePipeline(Pipeline* next); Pipeline* getDecodePipeline(Pipeline* next) override;
static std::shared_ptr<QPDFStreamFilter> flate_factory(); static std::shared_ptr<QPDFStreamFilter> flate_factory();
static std::shared_ptr<QPDFStreamFilter> lzw_factory(); static std::shared_ptr<QPDFStreamFilter> lzw_factory();

View File

@ -9,7 +9,7 @@ class SF_RunLengthDecode: public QPDFStreamFilter
{ {
public: public:
SF_RunLengthDecode() = default; SF_RunLengthDecode() = default;
virtual ~SF_RunLengthDecode() = default; ~SF_RunLengthDecode() override = default;
Pipeline* Pipeline*
getDecodePipeline(Pipeline* next) override getDecodePipeline(Pipeline* next) override

View File

@ -7,8 +7,8 @@ class SecureRandomDataProvider: public RandomDataProvider
{ {
public: public:
SecureRandomDataProvider() = default; SecureRandomDataProvider() = default;
virtual ~SecureRandomDataProvider() = default; ~SecureRandomDataProvider() override = default;
virtual void provideRandomData(unsigned char* data, size_t len); void provideRandomData(unsigned char* data, size_t len) override;
static RandomDataProvider* getInstance(); static RandomDataProvider* getInstance();
}; };

View File

@ -10,7 +10,7 @@ namespace
class Reactor: public JSON::Reactor class Reactor: public JSON::Reactor
{ {
public: public:
virtual ~Reactor() = default; ~Reactor() override = default;
void dictionaryStart() override; void dictionaryStart() override;
void arrayStart() override; void arrayStart() override;
void containerEnd(JSON const& value) override; void containerEnd(JSON const& value) override;

View File

@ -6,10 +6,10 @@
class BogusRandomDataProvider: public RandomDataProvider class BogusRandomDataProvider: public RandomDataProvider
{ {
public: public:
virtual ~BogusRandomDataProvider() = default; ~BogusRandomDataProvider() override = default;
BogusRandomDataProvider() = default; BogusRandomDataProvider() = default;
virtual void void
provideRandomData(unsigned char* data, size_t len) provideRandomData(unsigned char* data, size_t len) override
{ {
for (size_t i = 0; i < len; ++i) { for (size_t i = 0; i < len; ++i) {
data[i] = static_cast<unsigned char>(i & 0xff); data[i] = static_cast<unsigned char>(i & 0xff);

View File

@ -51,7 +51,7 @@ class ExtendNameTree: public QPDFNameTreeObjectHelper
{ {
public: public:
ExtendNameTree(QPDFObjectHandle o, QPDF& q); ExtendNameTree(QPDFObjectHandle o, QPDF& q);
virtual ~ExtendNameTree(); ~ExtendNameTree() override;
}; };
ExtendNameTree::ExtendNameTree(QPDFObjectHandle o, QPDF& q) : ExtendNameTree::ExtendNameTree(QPDFObjectHandle o, QPDF& q) :
@ -71,9 +71,9 @@ class Provider: public QPDFObjectHandle::StreamDataProvider
b(b) b(b)
{ {
} }
virtual ~Provider() = default; ~Provider() override = default;
virtual void void
provideStreamData(int objid, int generation, Pipeline* p) provideStreamData(int objid, int generation, Pipeline* p) override
{ {
// Don't change signature to use QPDFObjGen const& to detect problems forwarding to legacy // Don't change signature to use QPDFObjGen const& to detect problems forwarding to legacy
// implementations. // implementations.
@ -98,10 +98,10 @@ class Provider: public QPDFObjectHandle::StreamDataProvider
class ParserCallbacks: public QPDFObjectHandle::ParserCallbacks class ParserCallbacks: public QPDFObjectHandle::ParserCallbacks
{ {
public: public:
virtual ~ParserCallbacks() = default; ~ParserCallbacks() override = default;
virtual void contentSize(size_t size); void contentSize(size_t size) override;
virtual void handleObject(QPDFObjectHandle, size_t, size_t); void handleObject(QPDFObjectHandle, size_t, size_t) override;
virtual void handleEOF(); void handleEOF() override;
}; };
void void
@ -137,9 +137,9 @@ class TokenFilter: public QPDFObjectHandle::TokenFilter
{ {
public: public:
TokenFilter() = default; TokenFilter() = default;
virtual ~TokenFilter() = default; ~TokenFilter() override = default;
virtual void void
handleToken(QPDFTokenizer::Token const& t) handleToken(QPDFTokenizer::Token const& t) override
{ {
if (t == QPDFTokenizer::Token(QPDFTokenizer::tt_string, "Potato")) { if (t == QPDFTokenizer::Token(QPDFTokenizer::tt_string, "Potato")) {
// Exercise unparsing of strings by token constructor // Exercise unparsing of strings by token constructor
@ -148,8 +148,8 @@ class TokenFilter: public QPDFObjectHandle::TokenFilter
writeToken(t); writeToken(t);
} }
} }
virtual void void
handleEOF() handleEOF() override
{ {
writeToken(QPDFTokenizer::Token(QPDFTokenizer::tt_name, "/bye")); writeToken(QPDFTokenizer::Token(QPDFTokenizer::tt_name, "/bye"));
write("\n"); write("\n");

View File

@ -61,9 +61,9 @@ class ImageChecker: public Pipeline
{ {
public: public:
ImageChecker(size_t n); ImageChecker(size_t n);
virtual ~ImageChecker() = default; ~ImageChecker() override = default;
virtual void write(unsigned char const* data, size_t len); void write(unsigned char const* data, size_t len) override;
virtual void finish(); void finish() override;
private: private:
size_t n; size_t n;
@ -102,8 +102,8 @@ class ImageProvider: public QPDFObjectHandle::StreamDataProvider
{ {
public: public:
ImageProvider(size_t n); ImageProvider(size_t n);
virtual ~ImageProvider() = default; ~ImageProvider() override = default;
virtual void provideStreamData(int objid, int generation, Pipeline* pipeline); void provideStreamData(int objid, int generation, Pipeline* pipeline) override;
private: private:
size_t n; size_t n;

View File

@ -28,8 +28,8 @@ class Finder: public InputSource::Finder
str(str) str(str)
{ {
} }
virtual ~Finder() = default; ~Finder() override = default;
virtual bool check(); bool check() override;
private: private:
std::shared_ptr<InputSource> is; std::shared_ptr<InputSource> is;