ZeitgeistTimeRange

ZeitgeistTimeRange — Immutable representation of an interval in time, marked by a beginning and an end

Synopsis

#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);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ZeitgeistTimeRange

Description

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.

Details

ZeitgeistTimeRange

typedef struct _ZeitgeistTimeRange ZeitgeistTimeRange;


struct ZeitgeistTimeRangeClass

struct ZeitgeistTimeRangeClass {
  GInitiallyUnownedClass parent_class;
};


zeitgeist_time_range_get_end ()

gint64              zeitgeist_time_range_get_end        (ZeitgeistTimeRange *time_range);

time_range :

The time range to inspect

Returns :

The ending timestamp of the time range in miiliseconds since the Unix Epoch

zeitgeist_time_range_get_end_iso8601 ()

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.

time_range :

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().

zeitgeist_time_range_get_start ()

gint64              zeitgeist_time_range_get_start      (ZeitgeistTimeRange *time_range);

time_range :

The time range to inspect

Returns :

The starting timestamp of the time range in miiliseconds since the Unix Epoch

zeitgeist_time_range_get_start_iso8601 ()

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.

time_range :

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().

zeitgeist_time_range_new ()

ZeitgeistTimeRange * zeitgeist_time_range_new           (gint64 start_msec,
                                                         gint64 end_msec);

start_msec :

Starting timestamp in number of milliseconds since the Unix Epoch

end_msec :

Ending timestamp in number of milliseconds since the Unix Epoch

Returns :

A newly allocated ZeitgeistTimeRange. Free with g_object_unref().

zeitgeist_time_range_new_anytime ()

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

zeitgeist_time_range_new_from_now ()

ZeitgeistTimeRange * zeitgeist_time_range_new_from_now  (void);

Returns :

A new time range starting from the moment of invocation to the end of time

zeitgeist_time_range_new_from_variant ()

ZeitgeistTimeRange* zeitgeist_time_range_new_from_variant
                                                        (GVariant *time_range);

Create a ZeitgeistTimeRange from a GVariant

time_range :

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

zeitgeist_time_range_new_to_now ()

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

zeitgeist_time_range_to_variant ()

GVariant *          zeitgeist_time_range_to_variant     (ZeitgeistTimeRange *time_range);

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