Interface RegexEvalCallback

All Superinterfaces:
FunctionPointer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @Generated("org.javagi.JavaGI") public interface RegexEvalCallback extends FunctionPointer

Functional interface declaration of the RegexEvalCallback callback.

See Also:
  • Method Details

    • run

      boolean run(MatchInfo matchInfo, String result)
      Specifies the type of the function passed to g_regex_replace_eval(). It is called for each occurrence of the pattern in the string passed to g_regex_replace_eval(), and it should append the replacement to result.
      Parameters:
      matchInfo - the GMatchInfo generated by the match. Use g_match_info_get_regex() and g_match_info_get_string() if you need the GRegex or the matched string.
      result - a GString containing the new string
      Returns:
      false to continue the replacement process, true to stop it
      Since:
      2.14
    • upcall

      default int upcall(MemorySegment matchInfo, MemorySegment result, MemorySegment userData)
      The upcall method is called from native code. The parameters are marshaled and run(MatchInfo, String) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, MemorySegment, MemorySegment) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer