attributes are on the way
This commit is contained in:
@@ -2,7 +2,20 @@
|
||||
#include <cryptoki.hxx>
|
||||
#include <iostream>
|
||||
|
||||
template <int NUM, typename TYPE> std::vector<TYPE> toVector(TYPE in[NUM]) {
|
||||
return std::vector<TYPE>(in, in+NUM);
|
||||
}
|
||||
#define VECTOR(ARRAY) toVector<sizeof(ARRAY)/sizeof(ARRAY[0])>(ARRAY)
|
||||
|
||||
template <typename Array> void print(const std::vector<Array>& v) {
|
||||
for (typename std::vector<Array>::const_iterator it(v.begin()); it!=v.end(); ++it)
|
||||
std::cout<<"Item: "<<*it<<std::endl;
|
||||
}
|
||||
|
||||
int main(int argc, char const*const*const argv) try {
|
||||
//std::vector<int> v(toVector<4>((int[]){1,2,3,4}));
|
||||
std::vector<int> v(VECTOR(((int[]){1,2,3,4})));
|
||||
print(v);
|
||||
cryptoki::Init init(argc==2?argv[1]:"onepin-opensc-pkcs11.so");
|
||||
cryptoki::Info inf(init.info());
|
||||
std::cout<<"##################### INFO #####################"<<std::endl
|
||||
|
Reference in New Issue
Block a user