Package org.gnome.glib
Class LogField
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.glib.LogField
- All Implemented Interfaces:
Proxy
Structure representing a single field in a structured log entry. See
g_log_structured() for details.
Log fields may contain arbitrary values, including binary with embedded nul
bytes. If the field contains a string, the string must be UTF-8 encoded and
have a trailing nul byte. Otherwise, length
must be set to a non-negative
value.
-
Constructor Summary
ConstructorDescriptionLogField()
Allocate a new LogField.Allocate a new LogField.LogField
(MemorySegment address) Create a LogField proxy instance for the provided memory address.LogField
(String key, MemorySegment value, long length) Allocate a new LogField with the fields set to the provided values.LogField
(String key, MemorySegment value, long length, Arena arena) Allocate a new LogField with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayout
The memory layout of the native struct.readKey()
Read the value of the fieldkey
.long
Read the value of the fieldlength
.Read the value of the fieldvalue
.void
Write a value in the fieldkey
.void
writeLength
(long length) Write a value in the fieldlength
.void
writeValue
(MemorySegment value) Write a value in the fieldvalue
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
LogField
Create a LogField proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
LogField
Allocate a new LogField.- Parameters:
arena
- to control the memory allocation scope
-
LogField
public LogField()Allocate a new LogField. The memory is allocated withArena.ofAuto()
. -
LogField
Allocate a new LogField with the fields set to the provided values.- Parameters:
key
- value for the fieldkey
value
- value for the fieldvalue
length
- value for the fieldlength
arena
- to control the memory allocation scope
-
LogField
Allocate a new LogField with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
key
- value for the fieldkey
value
- value for the fieldvalue
length
- value for the fieldlength
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readKey
-
writeKey
-
readValue
Read the value of the fieldvalue
.- Returns:
- The value of the field
value
-
writeValue
Write a value in the fieldvalue
.- Parameters:
value
- The new value for the fieldvalue
-
readLength
public long readLength()Read the value of the fieldlength
.- Returns:
- The value of the field
length
-
writeLength
public void writeLength(long length) Write a value in the fieldlength
.- Parameters:
length
- The new value for the fieldlength
-