diff options
author | Jeffrey Walton <noloader@gmail.com> | 2015-11-20 19:15:33 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2015-11-20 19:15:33 -0500 |
commit | c45435812225aa68d122c7de246e5f60b509766c (patch) | |
tree | d834edb16c82beed38291b896cfb3ac145dd5aae /base32.h | |
parent | 5f70a7c85e02f3c3392930d32682a500d7258b8c (diff) | |
download | cryptopp-git-c45435812225aa68d122c7de246e5f60b509766c.tar.gz |
Crypto++ 5.6.3 check-in
Diffstat (limited to 'base32.h')
-rw-r--r-- | base32.h | 26 |
1 files changed, 24 insertions, 2 deletions
@@ -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 ¶meters);
};
@@ -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) {}
|