Class Variant
- Namespace
- GLib
- Assembly
- GLib-2.0.dll
public sealed class Variant : IDisposable
- Inheritance
-
Variant
- Implements
- Inherited Members
Constructors
Variant(VariantOwnedHandle)
public Variant(VariantOwnedHandle handle)
Parameters
handle
VariantOwnedHandle
Properties
Handle
public VariantOwnedHandle Handle { get; }
Property Value
Methods
Byteswap()
[Version("2.24")]
public Variant Byteswap()
Returns
CheckFormatString(string, bool)
[Version("2.34")]
public bool CheckFormatString(string formatString, bool copyOnly)
Parameters
Returns
Classify()
[Version("2.24")]
public VariantClass Classify()
Returns
Compare(Variant)
[Version("2.26")]
public int Compare(Variant two)
Parameters
two
Variant
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
DupBytestringArray(out nuint)
[Version("2.26")]
public string[] DupBytestringArray(out nuint length)
Parameters
length
nuint
Returns
- string[]
DupObjv(out nuint)
[Version("2.30")]
public string[] DupObjv(out nuint length)
Parameters
length
nuint
Returns
- string[]
DupString(out nuint)
[Version("2.24")]
public string DupString(out nuint length)
Parameters
length
nuint
Returns
DupStrv(out nuint)
[Version("2.24")]
public string[] DupStrv(out nuint length)
Parameters
length
nuint
Returns
- string[]
Equal(Variant)
[Version("2.24")]
public bool Equal(Variant two)
Parameters
two
Variant
Returns
Equals(Variant?)
public bool Equals(Variant? other)
Parameters
other
Variant
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetBoolean()
[Version("2.24")]
public bool GetBoolean()
Returns
GetByte()
[Version("2.24")]
public byte GetByte()
Returns
GetBytestringArray(out nuint)
[Version("2.26")]
public string[] GetBytestringArray(out nuint length)
Parameters
length
nuint
Returns
- string[]
GetChildValue(nuint)
[Version("2.24")]
public Variant GetChildValue(nuint index)
Parameters
index
nuint
Returns
GetData()
[Version("2.24")]
public IntPtr GetData()
Returns
GetDataAsBytes()
[Version("2.36")]
public Bytes GetDataAsBytes()
Returns
GetDouble()
[Version("2.24")]
public double GetDouble()
Returns
GetHandle()
[Version("2.24")]
public int GetHandle()
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
GetInt16()
[Version("2.24")]
public short GetInt16()
Returns
GetInt32()
[Version("2.24")]
public int GetInt32()
Returns
GetInt64()
[Version("2.24")]
public long GetInt64()
Returns
GetMaybe()
[Version("2.24")]
public Variant? GetMaybe()
Returns
GetNormalForm()
[Version("2.24")]
public Variant GetNormalForm()
Returns
GetObjv(out nuint)
[Version("2.30")]
public string[] GetObjv(out nuint length)
Parameters
length
nuint
Returns
- string[]
GetSize()
[Version("2.24")]
public nuint GetSize()
Returns
GetString(out nuint)
[Version("2.24")]
public string GetString(out nuint length)
Parameters
length
nuint
Returns
GetStrv(out nuint)
[Version("2.24")]
public string[] GetStrv(out nuint length)
Parameters
length
nuint
Returns
- string[]
GetType()
[Version("2.24")]
public VariantType GetType()
Returns
GetTypeString()
[Version("2.24")]
public string GetTypeString()
Returns
GetUint16()
[Version("2.24")]
public ushort GetUint16()
Returns
GetUint32()
[Version("2.24")]
public uint GetUint32()
Returns
GetUint64()
[Version("2.24")]
public ulong GetUint64()
Returns
GetVa(string, string?, IntPtr)
[Version("2.24")]
public void GetVa(string formatString, string? endptr, IntPtr app)
Parameters
GetVariant()
[Version("2.24")]
public Variant GetVariant()
Returns
Hash()
[Version("2.24")]
public uint Hash()
Returns
IsContainer()
[Version("2.24")]
public bool IsContainer()
Returns
IsFloating()
[Version("2.26")]
public bool IsFloating()
Returns
IsNormalForm()
[Version("2.24")]
public bool IsNormalForm()
Returns
IsObjectPath(string)
[Version("2.24")]
public static bool IsObjectPath(string @string)
Parameters
string
string
Returns
IsOfType(VariantType)
[Version("2.24")]
public bool IsOfType(VariantType type)
Parameters
type
VariantType
Returns
IsSignature(string)
[Version("2.24")]
public static bool IsSignature(string @string)
Parameters
string
string
Returns
IterNew()
[Version("2.24")]
public VariantIter IterNew()
Returns
LookupValue(string, VariantType?)
[Version("2.28")]
public Variant LookupValue(string key, VariantType? expectedType)
Parameters
key
stringexpectedType
VariantType
Returns
NChildren()
[Version("2.24")]
public nuint NChildren()
Returns
NewArray(VariantType?, Variant[]?)
[Version("2.24")]
public static Variant NewArray(VariantType? childType, Variant[]? children)
Parameters
childType
VariantTypechildren
Variant[]
Returns
NewBoolean(bool)
[Version("2.24")]
public static Variant NewBoolean(bool value)
Parameters
value
bool
Returns
NewByte(byte)
[Version("2.24")]
public static Variant NewByte(byte value)
Parameters
value
byte
Returns
NewBytestringArray(string[], long)
[Version("2.26")]
public static Variant NewBytestringArray(string[] strv, long length)
Parameters
Returns
NewDictEntry(Variant, Variant)
[Version("2.24")]
public static Variant NewDictEntry(Variant key, Variant value)
Parameters
Returns
NewDouble(double)
[Version("2.24")]
public static Variant NewDouble(double value)
Parameters
value
double
Returns
NewFixedArray(VariantType, IntPtr, nuint, nuint)
[Version("2.32")]
public static Variant NewFixedArray(VariantType elementType, IntPtr elements, nuint nElements, nuint elementSize)
Parameters
elementType
VariantTypeelements
IntPtrnElements
nuintelementSize
nuint
Returns
NewFromBytes(VariantType, Bytes, bool)
[Version("2.36")]
public static Variant NewFromBytes(VariantType type, Bytes bytes, bool trusted)
Parameters
type
VariantTypebytes
Bytestrusted
bool
Returns
NewHandle(int)
[Version("2.24")]
public static Variant NewHandle(int value)
Parameters
value
int
Returns
NewInt16(short)
[Version("2.24")]
public static Variant NewInt16(short value)
Parameters
value
short
Returns
NewInt32(int)
[Version("2.24")]
public static Variant NewInt32(int value)
Parameters
value
int
Returns
NewInt64(long)
[Version("2.24")]
public static Variant NewInt64(long value)
Parameters
value
long
Returns
NewMaybe(VariantType?, Variant?)
[Version("2.24")]
public static Variant NewMaybe(VariantType? childType, Variant? child)
Parameters
childType
VariantTypechild
Variant
Returns
NewObjectPath(string)
[Version("2.24")]
public static Variant NewObjectPath(string objectPath)
Parameters
objectPath
string
Returns
NewObjv(string[], long)
[Version("2.30")]
public static Variant NewObjv(string[] strv, long length)
Parameters
Returns
NewParsedVa(string, IntPtr)
public static Variant NewParsedVa(string format, IntPtr app)
Parameters
Returns
NewSignature(string)
[Version("2.24")]
public static Variant NewSignature(string signature)
Parameters
signature
string
Returns
NewString(string)
[Version("2.24")]
public static Variant NewString(string @string)
Parameters
string
string
Returns
NewStrv(string[], long)
[Version("2.24")]
public static Variant NewStrv(string[] strv, long length)
Parameters
Returns
NewTakeString(string)
[Version("2.38")]
public static Variant NewTakeString(string @string)
Parameters
string
string
Returns
NewTuple(Variant[])
[Version("2.24")]
public static Variant NewTuple(Variant[] children)
Parameters
children
Variant[]
Returns
NewUint16(ushort)
[Version("2.24")]
public static Variant NewUint16(ushort value)
Parameters
value
ushort
Returns
NewUint32(uint)
[Version("2.24")]
public static Variant NewUint32(uint value)
Parameters
value
uint
Returns
NewUint64(ulong)
[Version("2.24")]
public static Variant NewUint64(ulong value)
Parameters
value
ulong
Returns
NewVa(string, string?, IntPtr)
[Version("2.24")]
public static Variant NewVa(string formatString, string? endptr, IntPtr app)
Parameters
Returns
NewVariant(Variant)
[Version("2.24")]
public static Variant NewVariant(Variant value)
Parameters
value
Variant
Returns
Parse(VariantType?, string, string?, string?)
public static Variant Parse(VariantType? type, string text, string? limit, string? endptr)
Parameters
type
VariantTypetext
stringlimit
stringendptr
string
Returns
ParseErrorPrintContext(Error, string)
[Version("2.40")]
public static string ParseErrorPrintContext(Error error, string sourceStr)
Parameters
Returns
ParseErrorQuark()
public static Quark ParseErrorQuark()
Returns
ParserGetErrorQuark()
public static Quark ParserGetErrorQuark()
Returns
Print(bool)
[Version("2.24")]
public string Print(bool typeAnnotate)
Parameters
typeAnnotate
bool
Returns
PrintString(String?, bool)
[Version("2.24")]
public String PrintString(String? @string, bool typeAnnotate)
Parameters
Returns
Ref()
[Version("2.24")]
public Variant Ref()
Returns
RefSink()
[Version("2.24")]
public Variant RefSink()
Returns
Store(IntPtr)
[Version("2.24")]
public void Store(IntPtr data)
Parameters
data
IntPtr
TakeRef()
public Variant TakeRef()
Returns
Unref()
[Version("2.24")]
public void Unref()