GXml.Enumeration – GXml-0.20 – Vala Binding Reference

GXml.Enumeration – GXml-0.20 Reference Manual

# Enumeration

## Object Hierarchy:

## Description:

public class Enumeration

Convenient static methods for enumeration serialization to string.

Enumerations have a set of utility methods to better represent on serialisation/deserialization.

Enumerations could be converted to string using its definition on GLib.EnumClass, by taking its nick name directly or converting to its camel case representation.

Any enumeration value type in a <code>GLib.Object</code>'s property could be deserialized from its definition given on GLib.EnumClass (name and nick) or from its camel case representation.

Namespace: GXml
Package: GXml-0.20

## Content:

### Static methods:

- public static string get_nick (Type enumeration, int val) throws Error
  Introspect an enumeration to get value's nick name.
- public static string get_nick_camelcase (Type enumeration, int val) throws Error
  Introspect an enumeration to get value's nick name and transform to camel case representation.
- public static string get_string (Type enumeration, int val, bool use_nick = false, bool camelcase = false) throws Error
  Transform enumeration's value to its string representation.
- public static EnumValue? parse (Type enumeration, string val) throws Error
  Parse @val to an enumeration's value.
- public static EnumValue? parse_integer (Type enumeration, int val)
  From a integer valuer calculates a valid GLib.EnumValue for a GLib.Type.
- public static unowned EnumValue[] to_array (Type enumeration)
  Transform an enumeration in an array of GLib.EnumValue.
- public static string[] to_string_array (Type enumeration) throws Error
  Transform an enumeration in an array of strings representing enumeration values.

### Creation methods:

- public Enumeration ()