ulong to string conversion

master
Marc Wäckerlin 15 years ago
parent 7d36acec5b
commit 877ed3777f
  1. 12
      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<<num;
return ss.str();
}
}
}
template <int NUM, typename TYPE> std::vector<TYPE> toVector(TYPE in[NUM]) {
return std::vector<TYPE>(in, in+NUM);
}

Loading…
Cancel
Save