Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Converter

[17:7] extends: object

GConverter is an interface for streaming conversions. GConverter is implemented by objects that convert binary data in various ways. The conversion can be stateful and may fail at any place. Some example conversions are: character set conversion, compression, decompression and regular expression replace.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Converter (Handle = null)

    Creates a new Converter by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • convert_bytes (object bytes)

    Applies @converter to the data in @bytes.

    • @p bytes is the data to convert.
  • reset ()

    Resets all internal state in the converter, making it behave as if it was just created. If the converter has any internal state that would produce output then that output is lost.

    • @r None.