2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 19:08:59 +00:00

Replace 'virtual' specifier with 'override'

This commit is contained in:
m-holger 2023-05-20 14:25:46 +01:00
parent ba5a3567a2
commit e6577a1323
29 changed files with 107 additions and 107 deletions

View File

@ -30,9 +30,9 @@ class StringCounter: public QPDFObjectHandle::TokenFilter
count(0) count(0)
{ {
} }
virtual ~StringCounter() = default; ~StringCounter() override = default;
virtual void handleToken(QPDFTokenizer::Token const&); void handleToken(QPDFTokenizer::Token const&) override;
virtual void handleEOF(); void handleEOF() override;
int getCount() const; int getCount() const;
private: private:

View File

@ -26,8 +26,8 @@ class ImageProvider: public QPDFObjectHandle::StreamDataProvider
{ {
public: public:
ImageProvider(std::string const& color_space, std::string const& filter); ImageProvider(std::string const& color_space, std::string const& filter);
virtual ~ImageProvider() = default; ~ImageProvider() override = default;
virtual void provideStreamData(QPDFObjGen const&, Pipeline* pipeline); void provideStreamData(QPDFObjGen const&, Pipeline* pipeline) override;
size_t getWidth() const; size_t getWidth() const;
size_t getHeight() const; size_t getHeight() const;

View File

@ -48,7 +48,7 @@ class Pl_XOR: public Pipeline
public: public:
Pl_XOR(char const* identifier, Pipeline* next, unsigned char key); Pl_XOR(char const* identifier, Pipeline* next, unsigned char key);
virtual ~Pl_XOR() = default; ~Pl_XOR() override = default;
void write(unsigned char const* data, size_t len) override; void write(unsigned char const* data, size_t len) override;
void finish() override; void finish() override;
@ -91,7 +91,7 @@ class SF_XORDecode: public QPDFStreamFilter
// filter, which just means QPDF assumes that it should not // filter, which just means QPDF assumes that it should not
// "uncompress" the stream by default. // "uncompress" the stream by default.
public: public:
virtual ~SF_XORDecode() = default; ~SF_XORDecode() override = default;
bool setDecodeParms(QPDFObjectHandle decode_parms) override; bool setDecodeParms(QPDFObjectHandle decode_parms) override;
Pipeline* getDecodePipeline(Pipeline* next) override; Pipeline* getDecodePipeline(Pipeline* next) override;
bool isSpecializedCompression() override; bool isSpecializedCompression() override;
@ -199,7 +199,7 @@ class StreamReplacer: public QPDFObjectHandle::StreamDataProvider
public: public:
StreamReplacer(QPDF* pdf); StreamReplacer(QPDF* pdf);
virtual ~StreamReplacer() = default; ~StreamReplacer() override = default;
void void
provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override; provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override;

View File

@ -33,8 +33,8 @@ usage()
class StringReverser: public QPDFObjectHandle::TokenFilter class StringReverser: public QPDFObjectHandle::TokenFilter
{ {
public: public:
virtual ~StringReverser() = default; ~StringReverser() override = default;
virtual void handleToken(QPDFTokenizer::Token const&); void handleToken(QPDFTokenizer::Token const&) override;
}; };
void void
@ -66,9 +66,9 @@ StringReverser::handleToken(QPDFTokenizer::Token const& token)
class ColorToGray: public QPDFObjectHandle::TokenFilter class ColorToGray: public QPDFObjectHandle::TokenFilter
{ {
public: public:
virtual ~ColorToGray() = default; ~ColorToGray() override = default;
virtual void handleToken(QPDFTokenizer::Token const&); void handleToken(QPDFTokenizer::Token const&) override;
virtual void handleEOF(); void handleEOF() override;
private: private:
bool isNumeric(QPDFTokenizer::token_type_e); bool isNumeric(QPDFTokenizer::token_type_e);

View File

@ -33,7 +33,7 @@ usage()
class ImageInverter: public QPDFObjectHandle::StreamDataProvider class ImageInverter: public QPDFObjectHandle::StreamDataProvider
{ {
public: public:
virtual ~ImageInverter() = default; ~ImageInverter() override = default;
void void
provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override; provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override;

View File

@ -22,10 +22,10 @@ usage()
class ParserCallbacks: public QPDFObjectHandle::ParserCallbacks class ParserCallbacks: public QPDFObjectHandle::ParserCallbacks
{ {
public: public:
virtual ~ParserCallbacks() = default; ~ParserCallbacks() override = default;
virtual void contentSize(size_t); void contentSize(size_t) override;
virtual void handleObject(QPDFObjectHandle, size_t offset, size_t length); void handleObject(QPDFObjectHandle, size_t offset, size_t length) override;
virtual void handleEOF(); void handleEOF() override;
}; };
void void

View File

@ -14,13 +14,13 @@
class DiscardContents: public QPDFObjectHandle::ParserCallbacks class DiscardContents: public QPDFObjectHandle::ParserCallbacks
{ {
public: public:
virtual ~DiscardContents() = default; ~DiscardContents() override = default;
virtual void void
handleObject(QPDFObjectHandle) handleObject(QPDFObjectHandle) override
{ {
} }
virtual void void
handleEOF() handleEOF() override
{ {
} }
}; };

View File

@ -369,8 +369,8 @@ class JSON
JSON_value(vt_dictionary) JSON_value(vt_dictionary)
{ {
} }
virtual ~JSON_dictionary() = default; ~JSON_dictionary() override = default;
virtual void write(Pipeline*, size_t depth) const; void write(Pipeline*, size_t depth) const override;
std::map<std::string, JSON> members; std::map<std::string, JSON> members;
std::set<std::string> parsed_keys; std::set<std::string> parsed_keys;
}; };
@ -380,15 +380,15 @@ class JSON
JSON_value(vt_array) JSON_value(vt_array)
{ {
} }
virtual ~JSON_array() = default; ~JSON_array() override = default;
virtual void write(Pipeline*, size_t depth) const; void write(Pipeline*, size_t depth) const override;
std::vector<JSON> elements; std::vector<JSON> elements;
}; };
struct JSON_string: public JSON_value struct JSON_string: public JSON_value
{ {
JSON_string(std::string const& utf8); JSON_string(std::string const& utf8);
virtual ~JSON_string() = default; ~JSON_string() override = default;
virtual void write(Pipeline*, size_t depth) const; void write(Pipeline*, size_t depth) const override;
std::string utf8; std::string utf8;
std::string encoded; std::string encoded;
}; };
@ -397,15 +397,15 @@ class JSON
JSON_number(long long val); JSON_number(long long val);
JSON_number(double val); JSON_number(double val);
JSON_number(std::string const& val); JSON_number(std::string const& val);
virtual ~JSON_number() = default; ~JSON_number() override = default;
virtual void write(Pipeline*, size_t depth) const; void write(Pipeline*, size_t depth) const override;
std::string encoded; std::string encoded;
}; };
struct JSON_bool: public JSON_value struct JSON_bool: public JSON_value
{ {
JSON_bool(bool val); JSON_bool(bool val);
virtual ~JSON_bool() = default; ~JSON_bool() override = default;
virtual void write(Pipeline*, size_t depth) const; void write(Pipeline*, size_t depth) const override;
bool value; bool value;
}; };
struct JSON_null: public JSON_value struct JSON_null: public JSON_value
@ -414,14 +414,14 @@ class JSON
JSON_value(vt_null) JSON_value(vt_null)
{ {
} }
virtual ~JSON_null() = default; ~JSON_null() override = default;
virtual void write(Pipeline*, size_t depth) const; void write(Pipeline*, size_t depth) const override;
}; };
struct JSON_blob: public JSON_value struct JSON_blob: public JSON_value
{ {
JSON_blob(std::function<void(Pipeline*)> fn); JSON_blob(std::function<void(Pipeline*)> fn);
virtual ~JSON_blob() = default; ~JSON_blob() override = default;
virtual void write(Pipeline*, size_t depth) const; void write(Pipeline*, size_t depth) const override;
std::function<void(Pipeline*)> fn; std::function<void(Pipeline*)> fn;
}; };

View File

@ -45,11 +45,11 @@ class QPDF_DLL_CLASS Pl_Buffer: public Pipeline
QPDF_DLL QPDF_DLL
Pl_Buffer(char const* identifier, Pipeline* next = nullptr); Pl_Buffer(char const* identifier, Pipeline* next = nullptr);
QPDF_DLL QPDF_DLL
virtual ~Pl_Buffer(); ~Pl_Buffer() 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;
// Each call to getBuffer() resets this object -- see notes above. // Each call to getBuffer() resets this object -- see notes above.
// The caller is responsible for deleting the returned Buffer // The caller is responsible for deleting the returned Buffer

View File

@ -60,7 +60,7 @@ namespace
class InvalidInputSource: public InputSource class InvalidInputSource: public InputSource
{ {
public: public:
virtual ~InvalidInputSource() = default; ~InvalidInputSource() override = default;
qpdf_offset_t qpdf_offset_t
findAndSkipNextEOL() override findAndSkipNextEOL() override
{ {

View File

@ -515,9 +515,9 @@ namespace
std::vector<std::string> const& opt, std::vector<std::string> const& opt,
double tf, double tf,
QPDFObjectHandle::Rectangle const& bbox); QPDFObjectHandle::Rectangle const& bbox);
virtual ~ValueSetter() = default; ~ValueSetter() override = default;
virtual void handleToken(QPDFTokenizer::Token const&); void handleToken(QPDFTokenizer::Token const&) override;
virtual void handleEOF(); void handleEOF() override;
void writeAppearance(); void writeAppearance();
private: private:
@ -706,10 +706,10 @@ namespace
{ {
public: public:
TfFinder(); TfFinder();
virtual ~TfFinder() ~TfFinder() override
{ {
} }
virtual void handleToken(QPDFTokenizer::Token const&); void handleToken(QPDFTokenizer::Token const&) override;
double getTf(); double getTf();
std::string getFontName(); std::string getFontName();
std::string getDA(); std::string getDA();

View File

@ -48,8 +48,8 @@ namespace
size_t oi_min_height, size_t oi_min_height,
size_t oi_min_area, size_t oi_min_area,
QPDFObjectHandle& image); QPDFObjectHandle& image);
virtual ~ImageOptimizer() = default; ~ImageOptimizer() override = default;
virtual void provideStreamData(QPDFObjGen const&, Pipeline* pipeline); void provideStreamData(QPDFObjGen const&, Pipeline* pipeline) override;
std::shared_ptr<Pipeline> std::shared_ptr<Pipeline>
makePipeline(std::string const& description, Pipeline* next); makePipeline(std::string const& description, Pipeline* next);
bool evaluate(std::string const& description); bool evaluate(std::string const& description);
@ -65,13 +65,13 @@ namespace
class DiscardContents: public QPDFObjectHandle::ParserCallbacks class DiscardContents: public QPDFObjectHandle::ParserCallbacks
{ {
public: public:
virtual ~DiscardContents() = default; ~DiscardContents() override = default;
virtual void void
handleObject(QPDFObjectHandle) handleObject(QPDFObjectHandle) override
{ {
} }
virtual void void
handleEOF() handleEOF() override
{ {
} }
}; };
@ -98,8 +98,8 @@ namespace
filename(filename) filename(filename)
{ {
} }
virtual ~ProgressReporter() = default; ~ProgressReporter() override = default;
virtual void reportProgress(int); void reportProgress(int) override;
private: private:
Pipeline& p; Pipeline& p;

View File

@ -111,8 +111,8 @@ namespace
old_contents(old_contents) old_contents(old_contents)
{ {
} }
virtual ~CoalesceProvider() = default; ~CoalesceProvider() override = default;
virtual void provideStreamData(QPDFObjGen const&, Pipeline* pipeline); void provideStreamData(QPDFObjGen const&, Pipeline* pipeline) override;
private: private:
QPDFObjectHandle containing_page; QPDFObjectHandle containing_page;
@ -200,9 +200,9 @@ namespace
{ {
public: public:
LastChar(Pipeline* next); LastChar(Pipeline* next);
virtual ~LastChar() = default; ~LastChar() 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;
unsigned char getLastChar(); unsigned char getLastChar();
private: private:

View File

@ -35,8 +35,8 @@ namespace
str(str) str(str)
{ {
} }
virtual ~QPDFWordTokenFinder() = default; ~QPDFWordTokenFinder() override = default;
virtual bool check(); bool check() override;
private: private:
std::shared_ptr<InputSource> is; std::shared_ptr<InputSource> is;

View File

@ -27,10 +27,10 @@ namespace
{ {
public: public:
SF_Crypt() = default; SF_Crypt() = default;
virtual ~SF_Crypt() = default; ~SF_Crypt() override = default;
virtual bool bool
setDecodeParms(QPDFObjectHandle decode_parms) setDecodeParms(QPDFObjectHandle decode_parms) override
{ {
if (decode_parms.isNull()) { if (decode_parms.isNull()) {
return true; return true;
@ -49,8 +49,8 @@ namespace
return filterable; return filterable;
} }
virtual Pipeline* Pipeline*
getDecodePipeline(Pipeline*) getDecodePipeline(Pipeline*) override
{ {
// Not used -- handled by pipeStreamData // Not used -- handled by pipeStreamData
return nullptr; return nullptr;

View File

@ -7,8 +7,8 @@ class ContentNormalizer: public QPDFObjectHandle::TokenFilter
{ {
public: public:
ContentNormalizer(); ContentNormalizer();
virtual ~ContentNormalizer() = default; ~ContentNormalizer() override = default;
virtual void handleToken(QPDFTokenizer::Token const&); void handleToken(QPDFTokenizer::Token const&) override;
bool anyBadTokens() const; bool anyBadTokens() const;
bool lastTokenWasBad() const; bool lastTokenWasBad() const;

View File

@ -7,8 +7,8 @@ class CryptoRandomDataProvider: public RandomDataProvider
{ {
public: public:
CryptoRandomDataProvider() = default; CryptoRandomDataProvider() = default;
virtual ~CryptoRandomDataProvider() = default; ~CryptoRandomDataProvider() 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

@ -7,8 +7,8 @@ class InsecureRandomDataProvider: public RandomDataProvider
{ {
public: public:
InsecureRandomDataProvider(); InsecureRandomDataProvider();
virtual ~InsecureRandomDataProvider() = default; ~InsecureRandomDataProvider() 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();
private: private:

View File

@ -11,15 +11,15 @@ class OffsetInputSource: public InputSource
public: public:
OffsetInputSource( OffsetInputSource(
std::shared_ptr<InputSource>, qpdf_offset_t global_offset); std::shared_ptr<InputSource>, qpdf_offset_t global_offset);
virtual ~OffsetInputSource() = default; ~OffsetInputSource() override = default;
virtual qpdf_offset_t findAndSkipNextEOL(); qpdf_offset_t findAndSkipNextEOL() override;
virtual std::string const& getName() const; std::string const& getName() const override;
virtual qpdf_offset_t tell(); qpdf_offset_t tell() override;
virtual void seek(qpdf_offset_t offset, int whence); void seek(qpdf_offset_t offset, int whence) override;
virtual void rewind(); void rewind() override;
virtual size_t read(char* buffer, size_t length); size_t read(char* buffer, size_t length) override;
virtual void unreadCh(char ch); void unreadCh(char ch) override;
private: private:
std::shared_ptr<InputSource> proxied; std::shared_ptr<InputSource> proxied;

View File

@ -18,10 +18,10 @@ class Pl_AES_PDF: public Pipeline
bool encrypt, bool encrypt,
unsigned char const* key, unsigned char const* key,
size_t key_bytes); size_t key_bytes);
virtual ~Pl_AES_PDF() = default; ~Pl_AES_PDF() 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;
// Use zero initialization vector; needed for AESV3 // Use zero initialization vector; needed for AESV3
void useZeroIV(); void useZeroIV();

View File

@ -7,9 +7,9 @@ class Pl_ASCII85Decoder: public Pipeline
{ {
public: public:
Pl_ASCII85Decoder(char const* identifier, Pipeline* next); Pl_ASCII85Decoder(char const* identifier, Pipeline* next);
virtual ~Pl_ASCII85Decoder() = default; ~Pl_ASCII85Decoder() 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 flush(); void flush();

View File

@ -7,9 +7,9 @@ class Pl_ASCIIHexDecoder: public Pipeline
{ {
public: public:
Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next); Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next);
virtual ~Pl_ASCIIHexDecoder() = default; ~Pl_ASCIIHexDecoder() 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 flush(); void flush();

View File

@ -8,7 +8,7 @@ class Pl_Base64: public Pipeline
public: public:
enum action_e { a_encode, a_decode }; enum action_e { a_encode, a_decode };
Pl_Base64(char const* identifier, Pipeline* next, action_e); Pl_Base64(char const* identifier, Pipeline* next, action_e);
virtual ~Pl_Base64() = default; ~Pl_Base64() override = default;
void write(unsigned char const* buf, size_t len) override; void write(unsigned char const* buf, size_t len) override;
void finish() override; void finish() override;

View File

@ -22,10 +22,10 @@ class Pl_PNGFilter: public Pipeline
unsigned int columns, unsigned int columns,
unsigned int samples_per_pixel = 1, unsigned int samples_per_pixel = 1,
unsigned int bits_per_sample = 8); unsigned int bits_per_sample = 8);
virtual ~Pl_PNGFilter() = default; ~Pl_PNGFilter() 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:
void decodeSub(); void decodeSub();

View File

@ -17,10 +17,10 @@ class Pl_RC4: public Pipeline
unsigned char const* key_data, unsigned char const* key_data,
int key_len = -1, int key_len = -1,
size_t out_bufsize = def_bufsize); size_t out_bufsize = def_bufsize);
virtual ~Pl_RC4() = default; ~Pl_RC4() 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:
std::shared_ptr<unsigned char> outbuf; std::shared_ptr<unsigned char> outbuf;

View File

@ -21,9 +21,9 @@ class Pl_SHA2: public Pipeline
{ {
public: public:
Pl_SHA2(int bits = 0, Pipeline* next = nullptr); Pl_SHA2(int bits = 0, Pipeline* next = nullptr);
virtual ~Pl_SHA2() = default; ~Pl_SHA2() override = default;
virtual void write(unsigned char const*, size_t); void write(unsigned char const*, size_t) override;
virtual void finish(); void finish() override;
void resetBits(int bits); void resetBits(int bits);
std::string getHexDigest(); std::string getHexDigest();
std::string getRawDigest(); std::string getRawDigest();

View File

@ -18,10 +18,10 @@ class Pl_TIFFPredictor: public Pipeline
unsigned int columns, unsigned int columns,
unsigned int samples_per_pixel = 1, unsigned int samples_per_pixel = 1,
unsigned int bits_per_sample = 8); unsigned int bits_per_sample = 8);
virtual ~Pl_TIFFPredictor() = default; ~Pl_TIFFPredictor() 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:
void processRow(); void processRow();

View File

@ -22,8 +22,8 @@ class Callback: public Pl_DCT::CompressConfig
called(false) called(false)
{ {
} }
virtual ~Callback() = default; ~Callback() override = default;
virtual void apply(jpeg_compress_struct*); void apply(jpeg_compress_struct*) override;
bool called; bool called;
}; };

View File

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