2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 02:49:00 +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)
{
}
virtual ~StringCounter() = default;
virtual void handleToken(QPDFTokenizer::Token const&);
virtual void handleEOF();
~StringCounter() override = default;
void handleToken(QPDFTokenizer::Token const&) override;
void handleEOF() override;
int getCount() const;
private:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -111,8 +111,8 @@ namespace
old_contents(old_contents)
{
}
virtual ~CoalesceProvider() = default;
virtual void provideStreamData(QPDFObjGen const&, Pipeline* pipeline);
~CoalesceProvider() override = default;
void provideStreamData(QPDFObjGen const&, Pipeline* pipeline) override;
private:
QPDFObjectHandle containing_page;
@ -200,9 +200,9 @@ namespace
{
public:
LastChar(Pipeline* next);
virtual ~LastChar() = default;
virtual void write(unsigned char const* data, size_t len);
virtual void finish();
~LastChar() override = default;
void write(unsigned char const* data, size_t len) override;
void finish() override;
unsigned char getLastChar();
private:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,10 +18,10 @@ class Pl_AES_PDF: public Pipeline
bool encrypt,
unsigned char const* key,
size_t key_bytes);
virtual ~Pl_AES_PDF() = default;
~Pl_AES_PDF() override = default;
virtual void write(unsigned char const* data, size_t len);
virtual void finish();
void write(unsigned char const* data, size_t len) override;
void finish() override;
// Use zero initialization vector; needed for AESV3
void useZeroIV();

View File

@ -7,9 +7,9 @@ class Pl_ASCII85Decoder: public Pipeline
{
public:
Pl_ASCII85Decoder(char const* identifier, Pipeline* next);
virtual ~Pl_ASCII85Decoder() = default;
virtual void write(unsigned char const* buf, size_t len);
virtual void finish();
~Pl_ASCII85Decoder() override = default;
void write(unsigned char const* buf, size_t len) override;
void finish() override;
private:
void flush();

View File

@ -7,9 +7,9 @@ class Pl_ASCIIHexDecoder: public Pipeline
{
public:
Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next);
virtual ~Pl_ASCIIHexDecoder() = default;
virtual void write(unsigned char const* buf, size_t len);
virtual void finish();
~Pl_ASCIIHexDecoder() override = default;
void write(unsigned char const* buf, size_t len) override;
void finish() override;
private:
void flush();

View File

@ -8,7 +8,7 @@ class Pl_Base64: public Pipeline
public:
enum action_e { a_encode, a_decode };
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 finish() override;

View File

@ -22,10 +22,10 @@ class Pl_PNGFilter: public Pipeline
unsigned int columns,
unsigned int samples_per_pixel = 1,
unsigned int bits_per_sample = 8);
virtual ~Pl_PNGFilter() = default;
~Pl_PNGFilter() override = default;
virtual void write(unsigned char const* data, size_t len);
virtual void finish();
void write(unsigned char const* data, size_t len) override;
void finish() override;
private:
void decodeSub();

View File

@ -17,10 +17,10 @@ class Pl_RC4: public Pipeline
unsigned char const* key_data,
int key_len = -1,
size_t out_bufsize = def_bufsize);
virtual ~Pl_RC4() = default;
~Pl_RC4() override = default;
virtual void write(unsigned char const* data, size_t len);
virtual void finish();
void write(unsigned char const* data, size_t len) override;
void finish() override;
private:
std::shared_ptr<unsigned char> outbuf;

View File

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

View File

@ -18,10 +18,10 @@ class Pl_TIFFPredictor: public Pipeline
unsigned int columns,
unsigned int samples_per_pixel = 1,
unsigned int bits_per_sample = 8);
virtual ~Pl_TIFFPredictor() = default;
~Pl_TIFFPredictor() override = default;
virtual void write(unsigned char const* data, size_t len);
virtual void finish();
void write(unsigned char const* data, size_t len) override;
void finish() override;
private:
void processRow();

View File

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

View File

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