File indexing completed on 2024-05-12 17:16:24

0001 /*
0002  * Port for usage with qt-framework and development for kdesvn
0003  * Copyright (C) 2005-2009 by Rajko Albrecht (ral@alwins-world.de)
0004  * http://kdesvn.alwins-world.de
0005  */
0006 /*
0007  * ====================================================================
0008  * Copyright (c) 2002-2005 The RapidSvn Group.  All rights reserved.
0009  * dev@rapidsvn.tigris.org
0010  *
0011  * This library is free software; you can redistribute it and/or
0012  * modify it under the terms of the GNU Lesser General Public
0013  * License as published by the Free Software Foundation; either
0014  * version 2.1 of the License, or (at your option) any later version.
0015  *
0016  * This library is distributed in the hope that it will be useful,
0017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0019  * Lesser General Public License for more details.
0020  *
0021  * You should have received a copy of the GNU Lesser General Public
0022  * License along with this library (in the file LGPL.txt); if not,
0023  * write to the Free Software Foundation, Inc., 51 Franklin St,
0024  * Fifth Floor, Boston, MA  02110-1301  USA
0025  *
0026  * This software consists of voluntary contributions made by many
0027  * individuals.  For exact contribution history, see the revision
0028  * history and logs, available at http://rapidsvn.tigris.org/.
0029  * ====================================================================
0030  */
0031 
0032 #ifndef SVNQT_DIRENT_H
0033 #define SVNQT_DIRENT_H
0034 
0035 #include <svnqt/svnqt_defines.h>
0036 #include <svnqt/lock_entry.h>
0037 #include <svnqt/datetime.h>
0038 
0039 // subversion api
0040 #include <svn_client.h>
0041 
0042 #include <QString>
0043 
0044 namespace svn
0045 {
0046 class DirEntry_Data;
0047 
0048 class SVNQT_EXPORT DirEntry
0049 {
0050 public:
0051     /**
0052      * default constructor
0053      */
0054     DirEntry();
0055 
0056     /**
0057      * constructor for existing @a svn_dirent_t entries
0058      */
0059     DirEntry(const QString &name, const svn_dirent_t *dirEntry);
0060     /**
0061      * constructor for existing @a svn_dirent_t entries
0062      */
0063     DirEntry(const QString &name, const svn_dirent_t *dirEntry, const svn_lock_t *lockEntry);
0064 
0065     DirEntry(const QString &name, const svn_dirent_t *dirEntry, const LockEntry &lockEntry);
0066     /**
0067      * copy constructor
0068      */
0069     DirEntry(const DirEntry &src);
0070 
0071     /**
0072      * destructor
0073      */
0074     ~DirEntry();
0075 
0076     /**
0077      * assignment operator
0078      */
0079     DirEntry &
0080     operator = (const DirEntry &);
0081 
0082     bool isEmpty() const { return name().isEmpty(); }
0083 
0084     const QString &
0085     name() const;
0086 
0087     svn_node_kind_t
0088     kind() const;
0089 
0090     bool isDir()const;
0091 
0092     qlonglong
0093     size() const;
0094 
0095     bool
0096     hasProps() const;
0097 
0098     svn_revnum_t
0099     createdRev() const;
0100 
0101     const DateTime &
0102     time() const;
0103 
0104     const QString &
0105     lastAuthor() const;
0106 
0107     //! The assigned lock entry
0108     /*!
0109      * returns the assigned lock entry if set
0110      * \return a valid or an empty lock
0111      */
0112     const LockEntry &
0113     lockEntry() const;
0114 
0115     //! initialize and convert the internal lock entry
0116     /*!
0117      * This method should not needed to call outside the lib, it may just used
0118      * inside svn::Client::ls.
0119      * \param aLock the subversion lock description to convert.
0120      */
0121     void
0122     setLock(const svn_lock_t *aLock);
0123 
0124 private:
0125     DirEntry_Data *m;
0126 
0127 };
0128 }
0129 
0130 #endif
0131 /* -----------------------------------------------------------------
0132  * local variables:
0133  * eval: (load-file "../../rapidsvn-dev.el")
0134  * end:
0135  */