![]() |
![]() |
![]() |
API Documentation for the Zeitgeist Client Library | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
ZeitgeistTimeRangeZeitgeistTimeRange — Immutable representation of an interval in time, marked by a beginning and an end |
#include <zeitgeist.h> ZeitgeistTimeRange; struct ZeitgeistTimeRangeClass; gint64 zeitgeist_time_range_get_end (ZeitgeistTimeRange *time_range
); gchar * zeitgeist_time_range_get_end_iso8601 (ZeitgeistTimeRange *time_range
); gint64 zeitgeist_time_range_get_start (ZeitgeistTimeRange *time_range
); gchar * zeitgeist_time_range_get_start_iso8601 (ZeitgeistTimeRange *time_range
); ZeitgeistTimeRange * zeitgeist_time_range_new (gint64 start_msec
,gint64 end_msec
); ZeitgeistTimeRange * zeitgeist_time_range_new_anytime (void
); ZeitgeistTimeRange * zeitgeist_time_range_new_from_now (void
); ZeitgeistTimeRange* zeitgeist_time_range_new_from_variant (GVariant *time_range
); ZeitgeistTimeRange * zeitgeist_time_range_new_to_now (void
); GVariant * zeitgeist_time_range_to_variant (ZeitgeistTimeRange *time_range
);
ZeitgeistTimeRange is a light, immutable, encapsulation of an interval in time, marked by a beginning and an end.
Time ranges are sub classes of GInitiallyUnowned which means that you may pass them directly to methods provided by the Zeitgeist library and forget about them. The callee will own the floating reference.
struct ZeitgeistTimeRangeClass { GInitiallyUnownedClass parent_class; };
gint64 zeitgeist_time_range_get_end (ZeitgeistTimeRange *time_range
);
|
The time range to inspect |
Returns : |
The ending timestamp of the time range in miiliseconds since the Unix Epoch |
gchar * zeitgeist_time_range_get_end_iso8601
(ZeitgeistTimeRange *time_range
);
Converts the a timestamp to a human readable format. Eg. 1970-01-01T00:00:00Z or 2010-04-09T07:24:08.082000Z. Note that the timezone of the formatted string will always be UTC disregarding locale.
|
The time range to extract the end timestamp from |
Returns : |
A newly allocated string containing the timestamp formatted
according to ISO-8601. Free with g_free() . |
gint64 zeitgeist_time_range_get_start (ZeitgeistTimeRange *time_range
);
|
The time range to inspect |
Returns : |
The starting timestamp of the time range in miiliseconds since the Unix Epoch |
gchar * zeitgeist_time_range_get_start_iso8601
(ZeitgeistTimeRange *time_range
);
Converts the a timestamp to a human readable format. Eg. 1970-01-01T00:00:00Z or 2010-04-09T07:24:08.082000Z. Note that the timezone of the formatted string will always be UTC disregarding locale.
|
The time range to extract the start timestamp from |
Returns : |
A newly allocated string containing the timestamp formatted
according to ISO-8601. Free with g_free() . |
ZeitgeistTimeRange * zeitgeist_time_range_new (gint64 start_msec
,gint64 end_msec
);
|
Starting timestamp in number of milliseconds since the Unix Epoch |
|
Ending timestamp in number of milliseconds since the Unix Epoch |
Returns : |
A newly allocated ZeitgeistTimeRange. Free with g_object_unref() . |
ZeitgeistTimeRange * zeitgeist_time_range_new_anytime (void
);
Returns : |
A new time range starting from the beginning of the Unix Epoch stretching to the end of time |
ZeitgeistTimeRange * zeitgeist_time_range_new_from_now (void
);
Returns : |
A new time range starting from the moment of invocation to the end of time |
ZeitgeistTimeRange* zeitgeist_time_range_new_from_variant
(GVariant *time_range
);
Create a ZeitgeistTimeRange from a GVariant
|
A GVariant with signature
ZEITGEIST_TIME_RANGE_VARIANT_SIGNATURE. If time_range is
a floating reference this method will assume ownership of it |
Returns : |
A floating reference to a newly created ZeitgeistTimeRange |
ZeitgeistTimeRange * zeitgeist_time_range_new_to_now (void
);
Returns : |
A new time range starting from the beginning of the Unix Epoch ending at the moment of invocation |
GVariant * zeitgeist_time_range_to_variant (ZeitgeistTimeRange *time_range
);
|
A ZeitgeistTimeRange. If the reference is floating this method will assume ownership of it |
Returns : |
A floating reference to a GVariant with signature ZEITGEIST_TIME_RANGE_VARIANT_SIGNATURE |