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 Summary
Modifier and TypeMethodDescriptionbooleanSpecifies the type of the function passed to g_regex_replace_eval().default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(MemorySegment, MemorySegment, MemorySegment)method.default intupcall(MemorySegment matchInfo, MemorySegment result, MemorySegment userData) Theupcallmethod is called from native code.
-
Method Details
-
run
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 toresult.- Parameters:
matchInfo- theGMatchInfogenerated by the match. Use g_match_info_get_regex() and g_match_info_get_string() if you need theGRegexor the matched string.result- aGStringcontaining the new string- Returns:
falseto continue the replacement process,trueto stop it- Since:
- 2.14
-
upcall
Theupcallmethod is called from native code. The parameters are marshaled andrun(MatchInfo, String)is executed. -
toCallback
Creates a native function pointer to theupcall(MemorySegment, MemorySegment, MemorySegment)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-