Top |
Functions
GQuark | ianjuta_iterable_error_quark () |
void | ianjuta_iterable_assign () |
IAnjutaIterable * | ianjuta_iterable_clone () |
gint | ianjuta_iterable_compare () |
gint | ianjuta_iterable_diff () |
gboolean | ianjuta_iterable_first () |
void | ianjuta_iterable_foreach () |
gint | ianjuta_iterable_get_length () |
gint | ianjuta_iterable_get_position () |
gboolean | ianjuta_iterable_last () |
gboolean | ianjuta_iterable_next () |
gboolean | ianjuta_iterable_previous () |
gboolean | ianjuta_iterable_set_position () |
Functions
ianjuta_iterable_assign ()
void ianjuta_iterable_assign (IAnjutaIterable *obj
,IAnjutaIterable *src_iter
,GError **err
);
Assigns the iter position from src_iter
.
ianjuta_iterable_clone ()
IAnjutaIterable * ianjuta_iterable_clone (IAnjutaIterable *obj
,GError **err
);
Clones the iterable. The returned iterable object must be unreffed when done.
ianjuta_iterable_compare ()
gint ianjuta_iterable_compare (IAnjutaIterable *obj
,IAnjutaIterable *iter2
,GError **err
);
Compares the position of iter2
with this obj
. Returns -1
value if this obj
is smaller than iter2
. Returns +1 value
if this obj
is larger than iter2
. And returns 0 if both are equal.
If you want difference of the iter positions, use
ianjuta_iterable_diff()
. This method is meant for fast comparision.
ianjuta_iterable_diff ()
gint ianjuta_iterable_diff (IAnjutaIterable *obj
,IAnjutaIterable *iter2
,GError **err
);
Compares the position of iter2
with this obj
and returns difference
in position of the two (obj
- iter2
).
ianjuta_iterable_first ()
gboolean ianjuta_iterable_first (IAnjutaIterable *obj
,GError **err
);
Set iter to first element position. Returns FALSE if there is no element in the iterable (hence does not have first). The iter points to the first valid item.
ianjuta_iterable_foreach ()
void ianjuta_iterable_foreach (IAnjutaIterable *obj
,GFunc callback
,gpointer user_data
,GError **err
);
Call callback for each element in the list. Call back is passed the same iter, but with different position set (from first to last). This method does not affect current position. i.e. current position is restored at the end of this method.
ianjuta_iterable_get_length ()
gint ianjuta_iterable_get_length (IAnjutaIterable *obj
,GError **err
);
Length of the iterable (number of elements indexable by it).
ianjuta_iterable_get_position ()
gint ianjuta_iterable_get_position (IAnjutaIterable *obj
,GError **err
);
Index of the current iter in the iterable. It will be
from 0 to length - 1 (ianjuta_iter_get_length()
) if iter is pointed
at valid element. It will return -1 if iter is pointed at end-iter.
ianjuta_iterable_last ()
gboolean ianjuta_iterable_last (IAnjutaIterable *obj
,GError **err
);
Set iter position to end-iter (one past last element) position. Returns FALSE if there is no element in the iterable (already at end-iter).
ianjuta_iterable_next ()
gboolean ianjuta_iterable_next (IAnjutaIterable *obj
,GError **err
);
Set the iter position to next element position. Iter can go until one item past the last item and lands in end-iter. end-iter does not point to any valid item and signifies end of the list. Returns FALSE if iter was already at end-iter (iter can not go past it) and remains pointed to the end-iter.
ianjuta_iterable_previous ()
gboolean ianjuta_iterable_previous (IAnjutaIterable *obj
,GError **err
);
Set the iter position to previous element position. Returns FALSE if there is no previous element and the iter remains pointed to the first element.
ianjuta_iterable_set_position ()
gboolean ianjuta_iterable_set_position (IAnjutaIterable *obj
,gint position
,GError **err
);
Sets the current position of the iter to position
. The given position
must be from 0 to length - 1 (
) to point to
a valid element. Passing ianjuta_iter_get_length()
position
< 0 will set it to end-iter. It
returns TRUE for the above cases. FLASE will be returned, if
out-of-range position
is passed (position
> length - 1) and iter is
set to end-iter.