Package org.gnome.soup
Class MessageHeadersIter
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.soup.MessageHeadersIter
- All Implemented Interfaces:
Proxy
An opaque type used to iterate over a
SoupMessageHeaders
structure.
After intializing the iterator with init(org.gnome.soup.MessageHeadersIter, org.gnome.soup.MessageHeaders)
, call
next(io.github.jwharm.javagi.base.Out<java.lang.String>, io.github.jwharm.javagi.base.Out<java.lang.String>)
to fetch data from it.
You may not modify the headers while iterating over them.
-
Constructor Summary
ConstructorDescriptionAllocate a new MessageHeadersIter.MessageHeadersIter
(Arena arena) Allocate a new MessageHeadersIter.MessageHeadersIter
(MemorySegment address) Create a MessageHeadersIter proxy instance for the provided memory address.MessageHeadersIter
(MemorySegment[] dummy) Allocate a new MessageHeadersIter with the fields set to the provided values.MessageHeadersIter
(MemorySegment[] dummy, Arena arena) Allocate a new MessageHeadersIter with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayout
The memory layout of the native struct.static void
init
(MessageHeadersIter iter, MessageHeaders hdrs) Initializesiter
for iteratinghdrs
.boolean
Yields the next name/value pair in theMessageHeaders
being iterated by this MessageHeadersIter.Read the value of the fielddummy
.void
writeDummy
(MemorySegment[] dummy, Arena _arena) Write a value in the fielddummy
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
MessageHeadersIter
Create a MessageHeadersIter proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
MessageHeadersIter
Allocate a new MessageHeadersIter.- Parameters:
arena
- to control the memory allocation scope
-
MessageHeadersIter
public MessageHeadersIter()Allocate a new MessageHeadersIter. The memory is allocated withArena.ofAuto()
. -
MessageHeadersIter
Allocate a new MessageHeadersIter with the fields set to the provided values.- Parameters:
dummy
- value for the fielddummy
arena
- to control the memory allocation scope
-
MessageHeadersIter
Allocate a new MessageHeadersIter with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
dummy
- value for the fielddummy
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readDummy
Read the value of the fielddummy
.- Returns:
- The value of the field
dummy
-
writeDummy
Write a value in the fielddummy
.- Parameters:
dummy
- The new value for the fielddummy
_arena
- to control the memory allocation scope
-
init
public static void init(MessageHeadersIter iter, MessageHeaders hdrs) throws UnsupportedPlatformException Initializesiter
for iteratinghdrs
.- Parameters:
iter
- a pointer to aSoupMessageHeadersIter
structurehdrs
- aSoupMessageHeaders
- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
next
Yields the next name/value pair in theMessageHeaders
being iterated by this MessageHeadersIter.If this MessageHeadersIter has already yielded the last header, then
next(io.github.jwharm.javagi.base.Out<java.lang.String>, io.github.jwharm.javagi.base.Out<java.lang.String>)
will returnfalse
andname
andvalue
will be unchanged.- Parameters:
name
- pointer to a variable to return the header name invalue
- pointer to a variable to return the header value in- Returns:
true
if another name and value were returned,false
if the end of the headers has been reached.
-