Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

3 lat temu
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ## Strings & Bytes
  2. Miscellaneous string & byte encoding and decoding functionality provided for compatibility across supported versions of V8 and Node. Implemented by NAN to ensure that all encoding types are supported, even for older versions of Node where they are missing.
  3. - <a href="#api_nan_encoding"><b><code>Nan::Encoding</code></b></a>
  4. - <a href="#api_nan_encode"><b><code>Nan::Encode()</code></b></a>
  5. - <a href="#api_nan_decode_bytes"><b><code>Nan::DecodeBytes()</code></b></a>
  6. - <a href="#api_nan_decode_write"><b><code>Nan::DecodeWrite()</code></b></a>
  7. <a name="api_nan_encoding"></a>
  8. ### Nan::Encoding
  9. An enum representing the supported encoding types. A copy of `node::encoding` that is consistent across versions of Node.
  10. Definition:
  11. ```c++
  12. enum Nan::Encoding { ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER }
  13. ```
  14. <a name="api_nan_encode"></a>
  15. ### Nan::Encode()
  16. A wrapper around `node::Encode()` that provides a consistent implementation across supported versions of Node.
  17. Signature:
  18. ```c++
  19. v8::Local<v8::Value> Nan::Encode(const void *buf,
  20. size_t len,
  21. enum Nan::Encoding encoding = BINARY);
  22. ```
  23. <a name="api_nan_decode_bytes"></a>
  24. ### Nan::DecodeBytes()
  25. A wrapper around `node::DecodeBytes()` that provides a consistent implementation across supported versions of Node.
  26. Signature:
  27. ```c++
  28. ssize_t Nan::DecodeBytes(v8::Local<v8::Value> val,
  29. enum Nan::Encoding encoding = BINARY);
  30. ```
  31. <a name="api_nan_decode_write"></a>
  32. ### Nan::DecodeWrite()
  33. A wrapper around `node::DecodeWrite()` that provides a consistent implementation across supported versions of Node.
  34. Signature:
  35. ```c++
  36. ssize_t Nan::DecodeWrite(char *buf,
  37. size_t len,
  38. v8::Local<v8::Value> val,
  39. enum Nan::Encoding encoding = BINARY);
  40. ```