StormByte C++ Library: Crypto module 0.0.9999
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
exception.hxx
1#pragma once
2
3#include <StormByte/crypto/visibility.h>
4#include <StormByte/exception.hxx>
5
10namespace StormByte::Crypto {
15 class STORMBYTE_CRYPTO_PUBLIC Exception: public StormByte::Exception {
16 public:
21 inline Exception(const std::string& message):
22 StormByte::Exception("Crypto", message) {}
23
30 template <typename... Args>
31 inline Exception(const std::string& component, std::format_string<Args...> fmt, Args&&... args):
32 StormByte::Exception("Crypto::" + component, fmt, std::forward<Args>(args)...) {}
33
34 // Intentionally do not inherit base constructors to avoid MSVC overload ambiguities
35 };
36
41 class STORMBYTE_CRYPTO_PUBLIC CompressorException: public Exception {
42 public:
47 inline CompressorException(const std::string& message): Exception(std::string("Compressor: ") + message) {}
48
55 template <typename... Args>
56 inline CompressorException(std::format_string<Args...> fmt, Args&&... args):
57 Exception("Compressor: ", fmt, std::forward<Args>(args)...) {}
58
59 // Intentionally do not inherit base constructors to avoid MSVC overload ambiguities
60 };
61
66 class STORMBYTE_CRYPTO_PUBLIC CrypterException: public Exception {
67 public:
72 inline CrypterException(const std::string& message): Exception(std::string("Crypter: ") + message) {}
73
80 template <typename... Args>
81 inline CrypterException(std::format_string<Args...> fmt, Args&&... args):
82 Exception("Crypter: ", fmt, std::forward<Args>(args)...) {}
83
84 // Intentionally do not inherit base constructors to avoid MSVC overload ambiguities
85 };
86
91 class STORMBYTE_CRYPTO_PUBLIC HasherException: public Exception {
92 public:
97 inline HasherException(const std::string& message): Exception(std::string("Hasher: ") + message) {}
98
105 template <typename... Args>
106 inline HasherException(std::format_string<Args...> fmt, Args&&... args):
107 Exception("Hasher: ", fmt, std::forward<Args>(args)...) {}
108
109 // Intentionally do not inherit base constructors to avoid MSVC overload ambiguities
110 };
111
116 class STORMBYTE_CRYPTO_PUBLIC KeyPairException: public Exception {
117 public:
122 inline KeyPairException(const std::string& message): Exception(std::string("KeyPair: ") + message) {}
123
130 template <typename... Args>
131 inline KeyPairException(std::format_string<Args...> fmt, Args&&... args):
132 Exception("KeyPair: ", fmt, std::forward<Args>(args)...) {}
133
134 // Intentionally do not inherit base constructors to avoid MSVC overload ambiguities
135 };
136
141 class STORMBYTE_CRYPTO_PUBLIC SecretException: public Exception {
142 public:
147 inline SecretException(const std::string& message): Exception(std::string("Secret: ") + message) {}
148
155 template <typename... Args>
156 inline SecretException(std::format_string<Args...> fmt, Args&&... args):
157 Exception("Secret: ", fmt, std::forward<Args>(args)...) {}
158
159 // Intentionally do not inherit base constructors to avoid MSVC overload ambiguities
160 };
161
166 class STORMBYTE_CRYPTO_PUBLIC SignerException: public Exception {
167 public:
172 inline SignerException(const std::string& message): Exception(std::string("Signer: ") + message) {}
173
180 template <typename... Args>
181 inline SignerException(std::format_string<Args...> fmt, Args&&... args):
182 Exception("Signer: ", fmt, std::forward<Args>(args)...) {}
183
184 // Intentionally do not inherit base constructors to avoid MSVC overload ambiguities
185 };
186}
A class representing an exception in the compressor component of the crypto module.
Definition exception.hxx:41
CompressorException(std::format_string< Args... > fmt, Args &&... args)
Constructor.
Definition exception.hxx:56
CompressorException(const std::string &message)
Non-templated constructor for plain string messages. This resolves MSVC overload ambiguities when pas...
Definition exception.hxx:47
A class representing an exception in the crypter component of the crypto module.
Definition exception.hxx:66
CrypterException(const std::string &message)
Non-templated constructor for plain string messages. This resolves MSVC overload ambiguities when pas...
Definition exception.hxx:72
CrypterException(std::format_string< Args... > fmt, Args &&... args)
Constructor.
Definition exception.hxx:81
A class representing an exception in the crypto module.
Definition exception.hxx:15
Exception(const std::string &component, std::format_string< Args... > fmt, Args &&... args)
Constructor.
Definition exception.hxx:31
Exception(const std::string &message)
Constructor.
Definition exception.hxx:21
A class representing an exception in the hasher component of the crypto module.
Definition exception.hxx:91
HasherException(std::format_string< Args... > fmt, Args &&... args)
Constructor.
Definition exception.hxx:106
HasherException(const std::string &message)
Non-templated constructor for plain string messages. This resolves MSVC overload ambiguities when pas...
Definition exception.hxx:97
A class representing an exception in the keypair component of the crypto module.
Definition exception.hxx:116
KeyPairException(std::format_string< Args... > fmt, Args &&... args)
Constructor.
Definition exception.hxx:131
KeyPairException(const std::string &message)
Non-templated constructor for plain string messages. This resolves MSVC overload ambiguities when pas...
Definition exception.hxx:122
A class representing an exception in the secret component of the crypto module.
Definition exception.hxx:141
SecretException(const std::string &message)
Non-templated constructor for plain string messages. This resolves MSVC overload ambiguities when pas...
Definition exception.hxx:147
SecretException(std::format_string< Args... > fmt, Args &&... args)
Constructor.
Definition exception.hxx:156
A class representing an exception in the signer component of the crypto module.
Definition exception.hxx:166
SignerException(std::format_string< Args... > fmt, Args &&... args)
Constructor.
Definition exception.hxx:181
SignerException(const std::string &message)
Non-templated constructor for plain string messages. This resolves MSVC overload ambiguities when pas...
Definition exception.hxx:172