Skip to content

Instantly share code, notes, and snippets.

@gabrielschulhof
Last active November 7, 2018 15:51
Show Gist options
  • Save gabrielschulhof/0e6e15aa7949461c0224a8b413475db4 to your computer and use it in GitHub Desktop.
Save gabrielschulhof/0e6e15aa7949461c0224a8b413475db4 to your computer and use it in GitHub Desktop.
struct IconvObject : public Napi::ObjectWrap<IconvObject> {
IconvObject(const Napi::CallbackInfo& info):
Napi::ObjectWrap<IconvObject>(info) {
conv_ = info[0].As<Napi::External<iconv_t>>().Data();
}
iconv_t conv_;
~IconvObject() {
iconv_close(conv_);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment