## FMABoxed FMABoxed — The FMABoxed Structure |

## Functions

#define | FMA_BOXED()
#define | FMA_IS_BOXED()
void | fma_boxed_set_type ()
gboolean | fma_boxed_are_equal ()
FMABoxed * | fma_boxed_copy ()
void | fma_boxed_dump ()
gboolean | fma_boxed_get_boolean ()
gconstpointer | fma_boxed_get_pointer ()
gchar * | fma_boxed_get_string ()
GSList * | fma_boxed_get_string_list ()
guint | fma_boxed_get_uint ()
GList * | fma_boxed_get_uint_list ()
void | fma_boxed_get_as_value ()
void * | fma_boxed_get_as_void ()
FMABoxed * | fma_boxed_new_from_string ()
void | fma_boxed_set_from_boxed ()
void | fma_boxed_set_from_string ()
void | fma_boxed_set_from_value ()
void | fma_boxed_set_from_void ()

## Types and Values

#define | FMA_TYPE_BOXED
| FMABoxed

## Includes

    #include <filemanager-actions/fma-boxed.h>

## Description

The FMABoxed structure is a way of handling various types of data in an opaque structure.

## Functions

### FMA_BOXED()

    #define FMA_BOXED( object )           ( G_TYPE_CHECK_INSTANCE_CAST( object, FMA_TYPE_BOXED, FMABoxed ))

### FMA_IS_BOXED()

    #define FMA_IS_BOXED( object )        ( G_TYPE_CHECK_INSTANCE_TYPE( object, FMA_TYPE_BOXED))

### fma_boxed_set_type ()

    void
    fma_boxed_set_type (FMABoxed *boxed,
                        guint type);

Set the type of the just-allocated `boxed` object.

#### Parameters

boxed | this FMABoxed object. |
type | the required type as defined in fma-data-types.h |

Since: 3.1

### fma_boxed_are_equal ()

    gboolean
    fma_boxed_are_equal (const FMABoxed *a,
                         const FMABoxed *b);

#### Parameters

a | the first FMABoxed object. |
b | the second FMABoxed object. |

#### Returns

`TRUE` if `a` and `b` are equal, `FALSE` else.

Since: 3.1

### fma_boxed_copy ()

    FMABoxed *
    fma_boxed_copy (const FMABoxed *boxed);

#### Parameters

boxed | the source FMABoxed box. |

#### Returns

a copy of `boxed` , as a newly allocated FMABoxed which should be `g_object_unref()` by the caller.

Since: 3.1

### fma_boxed_dump ()

    void
    fma_boxed_dump (const FMABoxed *boxed);

Dumps the `boxed` box.

#### Parameters

boxed | the FMABoxed box to be dumped. |

Since: 3.1

### fma_boxed_get_boolean ()

    gboolean
    fma_boxed_get_boolean (const FMABoxed *boxed);

#### Parameters

boxed | the FMABoxed structure. |

#### Returns

the boolean value if `boxed` is of `FMA_DATA_TYPE_BOOLEAN` type, `FALSE` else.

Since: 3.1

### fma_boxed_get_pointer ()

    gconstpointer
    fma_boxed_get_pointer (const FMABoxed *boxed);

#### Parameters

boxed | the FMABoxed structure. |

#### Returns

a const pointer to the data if `boxed` is of `FMA_DATA_TYPE_POINTER` type, `NULL` else.

Since: 3.1

### fma_boxed_get_string ()

    gchar *
    fma_boxed_get_string (const FMABoxed *boxed);

#### Parameters

boxed | the FMABoxed structure. |

#### Returns

a newly allocated string if `boxed` is of `FMA_DATA_TYPE_STRING` type, which should be `g_free()` by the caller, `NULL` else.

Since: 3.1

### fma_boxed_get_string_list ()

    GSList *
    fma_boxed_get_string_list (const FMABoxed *boxed);

#### Parameters

boxed | the FMABoxed structure. |

#### Returns

a newly allocated string list if `boxed` is of `FMA_DATA_TYPE_STRING_LIST` type, which should be `fma_core_utils_slist_free()` by the caller, `NULL` else.

Since: 3.1

### fma_boxed_get_uint ()

    guint
    fma_boxed_get_uint (const FMABoxed *boxed);

#### Parameters

boxed | the FMABoxed structure. |

#### Returns

an unsigned integer if `boxed` is of `FMA_DATA_TYPE_UINT` type, zero else.

Since: 3.1

### fma_boxed_get_uint_list ()

    GList *
    fma_boxed_get_uint_list (const FMABoxed *boxed);

#### Parameters

boxed | the FMABoxed structure. |

#### Returns

a newly allocated list if `boxed` is of `FMA_DATA_TYPE_UINT_LIST` type, which should be `g_list_free()` by the caller, `FALSE` else.

Since: 3.1

### fma_boxed_get_as_value ()

    void
    fma_boxed_get_as_value (const FMABoxed *boxed,
                            GValue *value);

Setup `value` with the content of the `boxed` .

#### Parameters

boxed | the FMABoxed whose value is to be got. |
value | the GValue which holds the string to be set. |

Since: 3.1

### fma_boxed_get_as_void ()

    void *
    fma_boxed_get_as_void (const FMABoxed *boxed);

#### Parameters

boxed | the FMABoxed whose value is to be got. |

#### Returns

the content of the `boxed` .

If of type FMA_DATA_TYPE_STRING (resp. FMA_DATA_TYPE_LOCALE_STRING, FMA_DATA_TYPE_STRING_LIST or FMA_DATA_TYPE_UINT_LIST), then the content is returned in a newly allocated value, which should be `g_free()` (resp. `g_free()`, `fma_core_utils_slist_free()`, `g_list_free()`) by the caller.

Since: 3.1

### fma_boxed_new_from_string ()

    FMABoxed *
    fma_boxed_new_from_string (guint type,
                               const gchar *string);

Allocates a new FMABoxed of the specified `type` , and initializes it with `string` .

If the type is a list, then the last separator is automatically stripped.

#### Parameters

type | the type of the FMABoxed to be allocated. |
string | the initial value of the FMABoxed as a string. |

#### Returns

a newly allocated FMABoxed, which should be `g_object_unref()` by the caller, or `NULL` if the type is unknowned, or does not provide the 'from_string' function.

Since: 3.1

### fma_boxed_set_from_boxed ()

    void
    fma_boxed_set_from_boxed (FMABoxed *boxed,
                              const FMABoxed *value);

Copy value from `value` to `boxed` .

#### Parameters

boxed | the FMABoxed whose value is to be set. |
value | the source FMABoxed. |

Since: 3.1

### fma_boxed_set_from_string ()

    void
    fma_boxed_set_from_string (FMABoxed *boxed,
                               const gchar *value);

Evaluates the `value` and set it to the `boxed` .

#### Parameters

boxed | the FMABoxed whose value is to be set. |
value | the string to be set. |

Since: 3.1

### fma_boxed_set_from_value ()

    void
    fma_boxed_set_from_value (FMABoxed *boxed,
                              const GValue *value);

Evaluates the `value` and set it to the `boxed` .

#### Parameters

boxed | the FMABoxed whose value is to be set. |
value | the value whose content is to be got. |

Since: 3.1

### fma_boxed_set_from_void ()

    void
    fma_boxed_set_from_void (FMABoxed *boxed,
                             const void *value);

Evaluates the `value` and set it to the `boxed` .

#### Parameters

boxed | the FMABoxed whose value is to be set. |
value | the value whose content is to be got. |

Since: 3.1

## Types and Values

### FMA_TYPE_BOXED

    #define FMA_TYPE_BOXED                ( fma_boxed_get_type())

### FMABoxed

    typedef struct {
    } FMABoxed;