diff options
author | Jeffrey Walton <noloader@gmail.com> | 2017-05-12 19:52:42 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2017-05-12 19:52:42 -0400 |
commit | 78db20d9395f05a2b41774e103011eaca467e31a (patch) | |
tree | dff5188de33f3a475d4673a387886bcd00cc502e /gzip.cpp | |
parent | e3ae7000eaf92cf1cfa6f546ec1a0f6d84543f34 (diff) | |
download | cryptopp-git-78db20d9395f05a2b41774e103011eaca467e31a.tar.gz |
Add FileName, FileTime and Comment to argnames.h
Add self tests to verify handling of filenames, filetimes and comments
Diffstat (limited to 'gzip.cpp')
-rw-r--r-- | gzip.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -2,6 +2,7 @@ #include "pch.h"
#include "gzip.h"
+#include "argnames.h"
NAMESPACE_BEGIN(CryptoPP)
@@ -11,6 +12,16 @@ static inline bool Is8859Character(char c) { return (cc >= 32 && cc <= 126) || (cc >= 160 && cc <= 255);
}
+void Gzip::IsolatedInitialize(const NameValuePairs ¶meters)
+{
+ ConstByteArrayParameter v;
+ if (parameters.GetValue(Name::FileName(), v))
+ m_filename.assign(reinterpret_cast<const char*>(v.begin()), v.size());
+ if (parameters.GetValue(Name::Comment(), v))
+ m_comment.assign(reinterpret_cast<const char*>(v.begin()), v.size());
+ m_filetime = parameters.GetIntValueWithDefault(Name::FileTime(), 0);
+}
+
void Gzip::WritePrestreamHeader()
{
m_totalLen = 0;
|