|  |  |  | Caja-Actions™ Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
#include <caja-actions/na-boxed.h> #define NA_TYPE_BOXED #define NA_BOXED (object) #define NA_IS_BOXED (object) NABoxed; void na_boxed_set_type (NABoxed *boxed,guint type); gboolean na_boxed_are_equal (const NABoxed *a,const NABoxed *b); NABoxed * na_boxed_copy (const NABoxed *boxed); void na_boxed_dump (const NABoxed *boxed); gboolean na_boxed_get_boolean (const NABoxed *boxed); gconstpointer na_boxed_get_pointer (const NABoxed *boxed); gchar * na_boxed_get_string (const NABoxed *boxed); GSList * na_boxed_get_string_list (const NABoxed *boxed); guint na_boxed_get_uint (const NABoxed *boxed); GList * na_boxed_get_uint_list (const NABoxed *boxed); void na_boxed_get_as_value (const NABoxed *boxed,GValue *value); void * na_boxed_get_as_void (const NABoxed *boxed); NABoxed * na_boxed_new_from_string (guint type,const gchar *string); void na_boxed_set_from_boxed (NABoxed *boxed,const NABoxed *value); void na_boxed_set_from_string (NABoxed *boxed,const gchar *value); void na_boxed_set_from_value (NABoxed *boxed,const GValue *value); void na_boxed_set_from_void (NABoxed *boxed,const void *value);
The NABoxed structure is a way of handling various types of data in an opaque structure.
#define NA_BOXED( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_BOXED, NABoxed ))
void na_boxed_set_type (NABoxed *boxed,guint type);
Set the type of the just-allocated boxed object.
| 
 | this NABoxed object. | 
| 
 | the required type as defined in na-data-types.h | 
Since 3.1
gboolean na_boxed_are_equal (const NABoxed *a,const NABoxed *b);
| 
 | the first NABoxed object. | 
| 
 | the second NABoxed object. | 
| Returns : | TRUEifaandbare equal,FALSEelse. | 
Since 3.1
NABoxed *           na_boxed_copy                       (const NABoxed *boxed);
| 
 | the source NABoxed box. | 
| Returns : | a copy of boxed, as a newly allocated NABoxed which should
beg_object_unref()by the caller. | 
Since 3.1
void                na_boxed_dump                       (const NABoxed *boxed);
Dumps the boxed box.
| 
 | the NABoxed box to be dumped. | 
Since 3.1
gboolean            na_boxed_get_boolean                (const NABoxed *boxed);
| 
 | the NABoxed structure. | 
| Returns : | the boolean value if boxedis ofNA_DATA_TYPE_BOOLEANtype,FALSEelse. | 
Since 3.1
gconstpointer       na_boxed_get_pointer                (const NABoxed *boxed);
| 
 | the NABoxed structure. | 
| Returns : | a const pointer to the data if boxedis ofNA_DATA_TYPE_POINTERtype,NULLelse. | 
Since 3.1
gchar *             na_boxed_get_string                 (const NABoxed *boxed);
| 
 | the NABoxed structure. | 
| Returns : | a newly allocated string if boxedis ofNA_DATA_TYPE_STRINGtype, which should beg_free()by the caller,NULLelse. | 
Since 3.1
GSList *            na_boxed_get_string_list            (const NABoxed *boxed);
| 
 | the NABoxed structure. | 
| Returns : | a newly allocated string list if boxedis ofNA_DATA_TYPE_STRING_LISTtype, which should bena_core_utils_slist_free()by the caller,NULLelse. | 
Since 3.1
guint               na_boxed_get_uint                   (const NABoxed *boxed);
| 
 | the NABoxed structure. | 
| Returns : | an unsigned integer if boxedis ofNA_DATA_TYPE_UINTtype,
zero else. | 
Since 3.1
GList *             na_boxed_get_uint_list              (const NABoxed *boxed);
| 
 | the NABoxed structure. | 
| Returns : | a newly allocated list if boxedis ofNA_DATA_TYPE_UINT_LISTtype, which should beg_list_free()by the caller,FALSEelse. | 
Since 3.1
void na_boxed_get_as_value (const NABoxed *boxed,GValue *value);
Setup value with the content of the boxed.
Since 3.1
void *              na_boxed_get_as_void                (const NABoxed *boxed);
| 
 | the NABoxed whose value is to be got. | 
| Returns : | the content of the boxed.
If of type NA_DATA_TYPE_STRING (resp. NA_DATA_TYPE_LOCALE_STRING,
NA_DATA_TYPE_STRING_LIST or NA_DATA_TYPE_UINT_LIST), then the content
is returned in a newly allocated value, which should beg_free()(resp.g_free(),na_core_utils_slist_free(),g_list_free()) by the caller. | 
Since 3.1
NABoxed * na_boxed_new_from_string (guint type,const gchar *string);
Allocates a new NABoxed of the specified type, and initializes it
with string.
If the type is a list, then the last separator is automatically stripped.
| 
 | the type of the NABoxed to be allocated. | 
| 
 | the initial value of the NABoxed as a string. | 
| Returns : | a newly allocated NABoxed, which should be g_object_unref()by the caller, orNULLif the type is unknowned, or does not provide
the 'from_string' function. | 
Since 3.1
void na_boxed_set_from_boxed (NABoxed *boxed,const NABoxed *value);
Copy value from value to boxed.
Since 3.1
void na_boxed_set_from_string (NABoxed *boxed,const gchar *value);
Evaluates the value and set it to the boxed.
| 
 | the NABoxed whose value is to be set. | 
| 
 | the string to be set. | 
Since 3.1
void na_boxed_set_from_value (NABoxed *boxed,const GValue *value);
Evaluates the value and set it to the boxed.
| 
 | the NABoxed whose value is to be set. | 
| 
 | the value whose content is to be got. | 
Since 3.1