1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 * Copyright (C) James Liggett 2008 <jrliggett@cox.net>
6 * anjuta is free software.
8 * You may redistribute it and/or modify it under the terms of the
9 * GNU General Public License, as published by the Free Software
10 * Foundation; either version 2 of the License, or (at your option)
13 * anjuta is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 * See the GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with anjuta. If not, write to:
20 * The Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor
22 * Boston, MA 02110-1301, USA.
25 #include "git-stash.h"
34 G_DEFINE_TYPE (GitStash
, git_stash
, G_TYPE_OBJECT
);
37 git_stash_init (GitStash
*self
)
39 self
->priv
= g_new0 (GitStashPriv
, 1);
43 git_stash_finalize (GObject
*object
)
47 self
= GIT_STASH (object
);
49 g_free (self
->priv
->id
);
50 g_free (self
->priv
->message
);
53 G_OBJECT_CLASS (git_stash_parent_class
)->finalize (object
);
57 git_stash_class_init (GitStashClass
*klass
)
59 GObjectClass
* object_class
= G_OBJECT_CLASS (klass
);
61 object_class
->finalize
= git_stash_finalize
;
65 git_stash_new (const gchar
*id
, const gchar
*message
, guint number
)
69 self
= g_object_new (GIT_TYPE_STASH
, NULL
);
71 self
->priv
->id
= g_strdup (id
);
72 self
->priv
->message
= g_strdup (message
);
73 self
->priv
->number
= number
;
79 git_stash_get_id (GitStash
*self
)
81 return g_strdup (self
->priv
->id
);
85 git_stash_get_message (GitStash
*self
)
87 return g_strdup (self
->priv
->message
);
91 git_stash_get_number (GitStash
*self
)
93 return self
->priv
->number
;