Eric.Yang
2014-04-24 02:07:48 UTC
Hi all,
I have a class called Security and it is used for data encryption.
I want to use embind to export functions for js.
class Security {
public:
Security ();
bool encryptData(int encryptType, char * data, int dataLen);
bool decryptData(int encryptType, char * data, int dataLen);
}
EMSCRIPTEN_BINDING(test) {
class_<Security>("Security")
.constructor<>()
.function("encrypData",&CSecurity::encrypData,allow_raw_pointer<arg<1>>())
.function("decrypData",&CSecurity::decrypData,allow_raw_pointer<arg<1>>())
}
1. Do i write correct binding function? ex: allow_raw_pointer
2. How do I use encrypData/decrypData in JS ?
var data = "dataString";
var sec = new Module.Security();
sec.encrypData(1, data, data.length);
Thanks a lot.
I have a class called Security and it is used for data encryption.
I want to use embind to export functions for js.
class Security {
public:
Security ();
bool encryptData(int encryptType, char * data, int dataLen);
bool decryptData(int encryptType, char * data, int dataLen);
}
EMSCRIPTEN_BINDING(test) {
class_<Security>("Security")
.constructor<>()
.function("encrypData",&CSecurity::encrypData,allow_raw_pointer<arg<1>>())
.function("decrypData",&CSecurity::decrypData,allow_raw_pointer<arg<1>>())
}
1. Do i write correct binding function? ex: allow_raw_pointer
2. How do I use encrypData/decrypData in JS ?
var data = "dataString";
var sec = new Module.Security();
sec.encrypData(1, data, data.length);
Thanks a lot.
--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.