[libgfbgraph] Created getters for node properties



commit 24aee1d99159f26bac6ac754d9b1dc6c00c7d05d
Author: Álvaro Peña <alvaropg gmail com>
Date:   Tue Jun 4 13:26:24 2013 +0200

    Created getters for node properties

 gfbgraph/gfbgraph-node.c |   50 ++++++++++++++++++++++++++++++++++++++++++++++
 gfbgraph/gfbgraph-node.h |    5 ++++
 2 files changed, 55 insertions(+), 0 deletions(-)
---
diff --git a/gfbgraph/gfbgraph-node.c b/gfbgraph/gfbgraph-node.c
index bdf71cd..df4e48e 100644
--- a/gfbgraph/gfbgraph-node.c
+++ b/gfbgraph/gfbgraph-node.c
@@ -288,6 +288,54 @@ gfbgraph_node_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GTyp
 }
 
 /**
+ * gfbgraph_node_get_id:
+ * @node: a #GFBGraphNode.
+ *
+ * Gets the Facebook Graph unique node ID.
+ *
+ * Returns: (transfer none): the node ID.
+ **/
+const gchar*
+gfbgraph_node_get_id (GFBGraphNode *node)
+{
+        g_return_val_if_fail (GFBGRAPH_IS_NODE (node), NULL);
+
+        return g_strdup (node->priv->id);
+}
+
+/**
+ * gfbgraph_node_get_url:
+ * @node: a #GFBGraphNode.
+ *
+ * Gets the node link to the Facebook web page.
+ *
+ * Returns: (transfer none): the URL.
+ **/
+const gchar*
+gfbgraph_node_get_link (GFBGraphNode *node)
+{
+        g_return_val_if_fail (GFBGRAPH_IS_NODE (node), NULL);
+
+        return g_strdup (node->priv->link);
+}
+
+/**
+ * gfbgraph_node_get_created_time:
+ * @node: a #GFBGraphNode.
+ *
+ * Gets a node created time.
+ *
+ * Returns: (transfer none): an ISO 8601 encoded date when the node was initially published.
+ **/
+const gchar*
+gfbgraph_node_get_created_time (GFBGraphNode *node)
+{
+        g_return_val_if_fail (GFBGRAPH_IS_NODE (node), NULL);
+
+        return g_strdup (node->priv->created_time);
+}
+
+/**
  * gfbgraph_node_get_connection_nodes:
  * @node: a #GFBGraphNode object which retrieve the connected nodes.
  * @node_type: a #GFBGraphNode type #GType that determines the kind of nodes to retrieve.
@@ -434,6 +482,8 @@ gfbgraph_node_get_connection_nodes_async_finish (GFBGraphNode *node, GAsyncResul
  *
  * Appends @connect_node to @node. @connect_node must implement the #GFBGraphConnectable interface
  * and be connectable to @node GType.
+ *
+ * Returns: TRUE on sucess, FALSE if an error ocurred.
  **/
 gboolean
 gfbgraph_node_append_connection (GFBGraphNode *node, GFBGraphNode *connect_node, GFBGraphAuthorizer 
*authorizer, GError **error)
diff --git a/gfbgraph/gfbgraph-node.h b/gfbgraph/gfbgraph-node.h
index 247e97e..36618d4 100644
--- a/gfbgraph/gfbgraph-node.h
+++ b/gfbgraph/gfbgraph-node.h
@@ -60,6 +60,11 @@ GFBGraphNode*  gfbgraph_node_new         (void);
 
 GFBGraphNode*  gfbgraph_node_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GType node_type, 
GError **error);
 
+const gchar*   gfbgraph_node_get_id           (GFBGraphNode *node);
+const gchar*   gfbgraph_node_get_link         (GFBGraphNode *node);
+const gchar*   gfbgraph_node_get_created_time (GFBGraphNode *node);
+
+GList*         gfbgraph_node_get_connection_nodes              (GFBGraphNode         *node,
                                                                 GType                 node_type,
                                                                 GFBGraphAuthorizer   *authorizer,
                                                                 GError              **error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]