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 #include "qgitstatusoptions.h"
0021 #include <cstring>
0022 
0023 namespace LibQGit2
0024 {
0025 
0026 StatusOptions::StatusOptions(ShowType aShowType, StatusFlags aStatusFlags)
0027 {
0028     std::memset((void*)&d, 0, sizeof(git_status_options));
0029     d.version = GIT_STATUS_OPTIONS_VERSION;
0030     setShowType(aShowType);
0031     setStatusFlags(aStatusFlags);
0032 }
0033 
0034 StatusOptions::StatusOptions(git_status_options status_options)
0035     : d(status_options)
0036 {
0037 }
0038 
0039 StatusOptions::StatusOptions(const StatusOptions &other)
0040     : d(other.d)
0041 {
0042 }
0043 
0044 StatusOptions::~StatusOptions()
0045 {
0046 }
0047 
0048 StatusOptions::ShowType StatusOptions::showType() const
0049 {
0050     return show_type;
0051 }
0052 
0053 void StatusOptions::setShowType(ShowType type)
0054 {
0055     show_type = type;
0056     int i = show_type;
0057     d.show = (git_status_show_t)i;
0058 }
0059 
0060 StatusOptions::StatusFlags StatusOptions::statusFlags() const
0061 {
0062     return status_flags;
0063 }
0064 
0065 void StatusOptions::setStatusFlags(StatusOptions::StatusFlags sf)
0066 {
0067     status_flags = sf;
0068     d.flags = status_flags;
0069 }
0070 
0071 git_status_options StatusOptions::data() const
0072 {
0073     return d;
0074 }
0075 
0076 const git_status_options StatusOptions::constData() const
0077 {
0078     return d;
0079 }
0080 
0081 }