From 877ed3777ff0fd029a2cf74239e96d5f3cf0d8ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Wed, 9 Sep 2009 16:14:01 +0000 Subject: [PATCH] ulong to string conversion --- src/cryptoki.hxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/cryptoki.hxx b/src/cryptoki.hxx index cf00096..9f2d02e 100644 --- a/src/cryptoki.hxx +++ b/src/cryptoki.hxx @@ -62,6 +62,18 @@ namespace cryptoki { return data; } + inline std::string string(CK_ULONG num) { + switch (num) { + case CK_UNAVAILABLE_INFORMATION: return "-"; + case CK_EFFECTIVELY_INFINITE: return "∞"; + default: { + std::stringstream ss; + ss< std::vector toVector(TYPE in[NUM]) { return std::vector(in, in+NUM); }