File indexing completed on 2024-04-28 16:01:33

0001 /******************************************************************************
0002  * This file is part of the libqgit2 library
0003  * Copyright (c) 2011 Laszlo Papp <djszapi@archlinux.us>
0004  * Copyright (C) 2013 Leonardo Giordani
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Lesser General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2.1 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Lesser General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Lesser General Public
0017  * License along with this library; if not, write to the Free Software
0018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
0019  */
0020 
0021 #include "qgittag.h"
0022 #include "qgitoid.h"
0023 #include "qgitsignature.h"
0024 #include "qgitexception.h"
0025 
0026 namespace LibQGit2
0027 {
0028 
0029 Tag::Tag(git_tag *tag)
0030     : Object(reinterpret_cast<git_object*>(tag))
0031 {
0032 }
0033 
0034 Tag::Tag(const Tag& other)
0035     : Object(other)
0036 {
0037 }
0038 
0039 Tag::~Tag()
0040 {
0041 }
0042 
0043 OId Tag::oid() const
0044 {
0045     return OId(git_tag_id(data()));
0046 }
0047 
0048 Object Tag::target() const
0049 {
0050     git_object *obj;
0051     qGitThrow(git_tag_target(&obj, data()));
0052     return Object(obj);
0053 }
0054 
0055 const QString Tag::name() const
0056 {
0057     return git_tag_name(data());
0058 }
0059 
0060 Signature Tag::tagger() const
0061 {
0062     return Signature(git_tag_tagger(data()));
0063 }
0064 
0065 const QString Tag::message()
0066 {
0067     return git_tag_message(data());
0068 }
0069 
0070 git_tag* Tag::data() const
0071 {
0072     return reinterpret_cast<git_tag*>(Object::data());
0073 }
0074 
0075 const git_tag* Tag::constData() const
0076 {
0077     return reinterpret_cast<git_tag*>(Object::data());
0078 }
0079 
0080 } // namespace LibQGit2