File indexing completed on 2024-04-28 16:01:33
0001 /****************************************************************************** 0002 * This file is part of the libqgit2 library 0003 * Copyright (C) 2013 Leonardo Giordani 0004 * 0005 * This library is free software; you can redistribute it and/or 0006 * modify it under the terms of the GNU Lesser General Public 0007 * License as published by the Free Software Foundation; either 0008 * version 2.1 of the License, or (at your option) any later version. 0009 * 0010 * This library is distributed in the hope that it will be useful, 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0013 * Lesser General Public License for more details. 0014 * 0015 * You should have received a copy of the GNU Lesser General Public 0016 * License along with this library; if not, write to the Free Software 0017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 0018 */ 0019 0020 #ifndef LIBQGIT2_STATUS_LIST_H 0021 #define LIBQGIT2_STATUS_LIST_H 0022 0023 #include <QtCore/QSharedPointer> 0024 0025 #include "git2.h" 0026 0027 #include "libqgit2_export.h" 0028 #include "qgitstatusentry.h" 0029 0030 namespace LibQGit2 0031 { 0032 /** 0033 * @brief Wrapper class for git_status_list. 0034 * 0035 * Represents a list of status entries in a Git repository. This is not a simple QList of StatusEntry, 0036 * it wraps the underlying libgit2 functions. 0037 * 0038 * @ingroup LibQGit2 0039 * @{ 0040 */ 0041 class LIBQGIT2_EXPORT StatusList 0042 { 0043 public: 0044 explicit StatusList(git_status_list *status_list = 0); 0045 0046 StatusList(const StatusList& other); 0047 0048 ~StatusList(); 0049 0050 /** 0051 * Returns the number of entries in the status list. 0052 */ 0053 size_t entryCount(); 0054 0055 /** 0056 * Returns the entry with the given index. 0057 */ 0058 const StatusEntry entryByIndex(size_t idx); 0059 0060 git_status_list* data() const; 0061 const git_status_list* constData() const; 0062 0063 private: 0064 typedef QSharedPointer<git_status_list> ptr_type; 0065 ptr_type d; 0066 0067 }; 0068 0069 0070 /**@}*/ 0071 } 0072 0073 #endif // LIBQGIT2_STATUS_LIST_H