summaryrefslogtreecommitdiff
path: root/gzip.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-05-12 19:52:42 -0400
committerJeffrey Walton <noloader@gmail.com>2017-05-12 19:52:42 -0400
commit78db20d9395f05a2b41774e103011eaca467e31a (patch)
treedff5188de33f3a475d4673a387886bcd00cc502e /gzip.cpp
parente3ae7000eaf92cf1cfa6f546ec1a0f6d84543f34 (diff)
downloadcryptopp-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.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/gzip.cpp b/gzip.cpp
index 4b4869b4..331ce019 100644
--- a/gzip.cpp
+++ b/gzip.cpp
@@ -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 &parameters)
+{
+ 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;