diff options
author | Jack Lloyd <[email protected]> | 2017-09-30 11:28:02 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-30 11:28:02 -0400 |
commit | f6dc3db8bb7e31569ed1a6042771e3f529aefab8 (patch) | |
tree | 9604495c046e1e52cc1d8e552879f04fe8599631 /src/lib/filters | |
parent | e6dfcaa00d82a2fff5973bd2721dc09562d64199 (diff) |
Use class instead of struct for objects with member functions
Flagged by Sonar and quite reasonable
Diffstat (limited to 'src/lib/filters')
-rw-r--r-- | src/lib/filters/basefilt.h | 7 | ||||
-rw-r--r-- | src/lib/filters/pipe.h | 19 |
2 files changed, 14 insertions, 12 deletions
diff --git a/src/lib/filters/basefilt.h b/src/lib/filters/basefilt.h index 40ce0ec6e..01bcad756 100644 --- a/src/lib/filters/basefilt.h +++ b/src/lib/filters/basefilt.h @@ -20,11 +20,12 @@ namespace Botan { /** * BitBucket is a filter which simply discards all inputs */ -struct BOTAN_PUBLIC_API(2,0) BitBucket final : public Filter +class BOTAN_PUBLIC_API(2,0) BitBucket final : public Filter { - void write(const uint8_t[], size_t) override {} + public: + void write(const uint8_t[], size_t) override {} - std::string name() const override { return "BitBucket"; } + std::string name() const override { return "BitBucket"; } }; /** diff --git a/src/lib/filters/pipe.h b/src/lib/filters/pipe.h index 060b5c1ca..cd446bd7e 100644 --- a/src/lib/filters/pipe.h +++ b/src/lib/filters/pipe.h @@ -38,16 +38,17 @@ class BOTAN_PUBLIC_API(2,0) Pipe final : public DataSource * Exception if you use an invalid message as an argument to * read, remaining, etc */ - struct BOTAN_PUBLIC_API(2,0) Invalid_Message_Number final : public Invalid_Argument + class BOTAN_PUBLIC_API(2,0) Invalid_Message_Number final : public Invalid_Argument { - /** - * @param where the error occurred - * @param msg the invalid message id that was used - */ - Invalid_Message_Number(const std::string& where, message_id msg) : - Invalid_Argument("Pipe::" + where + ": Invalid message number " + - std::to_string(msg)) - {} + public: + /** + * @param where the error occurred + * @param msg the invalid message id that was used + */ + Invalid_Message_Number(const std::string& where, message_id msg) : + Invalid_Argument("Pipe::" + where + ": Invalid message number " + + std::to_string(msg)) + {} }; /** |