Commit 9eba9f7f authored by Philip Withnall's avatar Philip Withnall Committed by Philip Withnall
Browse files

bounding-box: Add equality method

Add a method for checking that two #GeocodeBoundingBox instances are
equal. This will be used in upcoming commits.

https://bugzilla.gnome.org/show_bug.cgi?id=774631
parent c1042732
......@@ -274,6 +274,32 @@ geocode_bounding_box_new (gdouble top,
NULL);
}
/**
* geocode_bounding_box_equal:
* @a: a bounding box
* @b: another bounding box
*
* Compare two #GeocodeBoundingBox instances for equality. This compares all
* fields and only returns %TRUE if the instances are exactly equal.
*
* Both instances must be non-%NULL.
*
* Returns: %TRUE if the instances are equal, %FALSE otherwise
* Since: UNRELEASED
*/
gboolean
geocode_bounding_box_equal (GeocodeBoundingBox *a,
GeocodeBoundingBox *b)
{
g_return_val_if_fail (GEOCODE_IS_BOUNDING_BOX (a), FALSE);
g_return_val_if_fail (GEOCODE_IS_BOUNDING_BOX (b), FALSE);
return (a->priv->top == b->priv->top &&
a->priv->bottom == b->priv->bottom &&
a->priv->left == b->priv->left &&
a->priv->right == b->priv->right);
}
/**
* geocode_bounding_box_get_top:
* @bbox: a #GeocodeBoundingBox
......
......@@ -71,6 +71,9 @@ GeocodeBoundingBox *geocode_bounding_box_new (gdouble top,
gdouble left,
gdouble right);
gboolean geocode_bounding_box_equal (GeocodeBoundingBox *a,
GeocodeBoundingBox *b);
gdouble geocode_bounding_box_get_top (GeocodeBoundingBox *bbox);
gdouble geocode_bounding_box_get_bottom (GeocodeBoundingBox *bbox);
gdouble geocode_bounding_box_get_left (GeocodeBoundingBox *bbox);
......
......@@ -77,6 +77,7 @@ geocode_place_get_osm_id
geocode_place_get_osm_type
geocode_bounding_box_get_type
geocode_bounding_box_new
geocode_bounding_box_equal
geocode_bounding_box_get_top
geocode_bounding_box_get_bottom
geocode_bounding_box_get_left
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment