1 /*
2  * ggit-tree.h
3  * This file is part of libgit2-glib
4  *
5  * Copyright (C) 2012 - Jesse van den Kieboom
6  *
7  * libgit2-glib is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * libgit2-glib is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with libgit2-glib. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __GGIT_TREE_H__
22 #define __GGIT_TREE_H__
23 
24 #include <git2.h>
25 #include <libgit2-glib/ggit-object.h>
26 #include <libgit2-glib/ggit-types.h>
27 #include <libgit2-glib/ggit-tree-entry.h>
28 #include <gio/gio.h>
29 
30 G_BEGIN_DECLS
31 
32 #define GGIT_TYPE_TREE (ggit_tree_get_type ())
33 G_DECLARE_DERIVABLE_TYPE (GgitTree, ggit_tree, GGIT, TREE, GgitObject)
34 
35 /**
36  * GgitTreeClass:
37  * @parent_class: The parent class.
38  *
39  * The class structure for #GgitTreeClass.
40  */
41 struct _GgitTreeClass
42 {
43 	/*< private >*/
44 	GgitObjectClass parent_class;
45 };
46 
47 GgitTree      *_ggit_tree_wrap          (git_tree *tree,
48                                          gboolean  owned);
49 
50 GgitOId       *ggit_tree_get_id         (GgitTree *tree);
51 
52 GgitTreeEntry *ggit_tree_get            (GgitTree *tree,
53                                          guint     i);
54 
55 guint          ggit_tree_size           (GgitTree *tree);
56 
57 GgitTreeEntry *ggit_tree_get_by_name    (GgitTree    *tree,
58                                          const gchar *name);
59 
60 GgitTreeEntry *ggit_tree_get_by_path    (GgitTree     *tree,
61                                          const gchar  *path,
62                                          GError      **error);
63 
64 void           ggit_tree_walk           (GgitTree              *tree,
65                                          GgitTreeWalkMode       mode,
66                                          GgitTreeWalkCallback   callback,
67                                          gpointer               user_data,
68                                          GError               **error);
69 
70 G_END_DECLS
71 
72 #endif /* __GGIT_TREE_H__ */
73 
74 /* ex:set ts=8 noet: */
75