summaryrefslogtreecommitdiff
path: root/base32.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-11-20 19:15:33 -0500
committerJeffrey Walton <noloader@gmail.com>2015-11-20 19:15:33 -0500
commitc45435812225aa68d122c7de246e5f60b509766c (patch)
treed834edb16c82beed38291b896cfb3ac145dd5aae /base32.h
parent5f70a7c85e02f3c3392930d32682a500d7258b8c (diff)
downloadcryptopp-git-c45435812225aa68d122c7de246e5f60b509766c.tar.gz
Crypto++ 5.6.3 check-in
Diffstat (limited to 'base32.h')
-rw-r--r--base32.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/base32.h b/base32.h
index ad4da97c..6790e59d 100644
--- a/base32.h
+++ b/base32.h
@@ -18,12 +18,32 @@ NAMESPACE_BEGIN(CryptoPP)
class Base32Encoder : public SimpleProxyFilter
{
public:
- Base32Encoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int outputGroupSize = 0, const std::string &separator = ":", const std::string &terminator = "")
+ //! \brief Construct a Base32Encoder
+ //! \param attachment a BufferedTrasformation to attach to this object
+ //! \param uppercase a flag indicating uppercase output
+ //! \param groupSize the size of the grouping
+ //! \param separator the separator to use between groups
+ //! \param terminator the terminator appeand after processing
+ //! \details Base32Encoder() constructs a default encoder. The constructor lacks fields for padding and
+ //! line breaks. You must use IsolatedInitialize() to change the default padding character or suppress it.
+ //! \sa IsolatedInitialize() for an example of modifying a Base32Encoder after construction.
+ Base32Encoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int groupSize = 0, const std::string &separator = ":", const std::string &terminator = "")
: SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
{
- IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), outputGroupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator)));
+ IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), groupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator)));
}
+ //! \brief Initialize or reinitialize this object, without signal propagation
+ //! \param parameters a set of NameValuePairs used to initialize this object
+ //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
+ //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
+ //! transformations. If initialization should be propagated, then use the Initialize() function.
+ //! \details The following code modifies the padding and line break parameters for an encoder:
+ //! <pre>
+ //! Base32Encoder encoder;
+ //! AlgorithmParameters params = MakeParameters(Pad(), false)(InsertLineBreaks(), false);
+ //! encoder.IsolatedInitialize(params);
+ //! </pre>
void IsolatedInitialize(const NameValuePairs &parameters);
};
@@ -34,6 +54,8 @@ public:
class Base32Decoder : public BaseN_Decoder
{
public:
+ //! \brief Construct a Base32Decoder
+ //! \param attachment a BufferedTrasformation to attach to this object
Base32Decoder(BufferedTransformation *attachment = NULL)
: BaseN_Decoder(GetDefaultDecodingLookupArray(), 5, attachment) {}