diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch) | |
tree | acaf47eb0fa12142d3896416a69e74cbf5a72242 /vcs/cvsservice/cvsdir.h | |
download | tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'vcs/cvsservice/cvsdir.h')
-rw-r--r-- | vcs/cvsservice/cvsdir.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/vcs/cvsservice/cvsdir.h b/vcs/cvsservice/cvsdir.h new file mode 100644 index 00000000..606f7507 --- /dev/null +++ b/vcs/cvsservice/cvsdir.h @@ -0,0 +1,103 @@ +/*************************************************************************** + * Copyright (C) 2003 by Mario Scalas * + * mario.scalas@libero.it * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef CVSDIR_H +#define CVSDIR_H + +#include <qdir.h> +#include <qstringlist.h> +#include <qmap.h> + +#include "cvsentry.h" + +/** +Helper classes for handling CVS dirs + +@author Mario Scalas +*/ +class CVSDir : public QDir +{ +public: + CVSDir(); + CVSDir( const QDir &dir ); + explicit CVSDir( const CVSDir & ); + CVSDir &operator=( const CVSDir & ); + virtual ~CVSDir(); + + /** + * A client can use this method to validate the directory state. + * @return true if the directory is a valid CVS dir, false otherwise + */ + bool isValid() const; + /** + * Returns a list of all the files registered into repository + */ + QStringList registeredEntryList() const; + /** + * @param fileName is the file name (with no path info, just the file name!) + * @param refreshCache update internal cache re-parsing "<dirPath>/CVS/Entries" + * @return an empty CVSEntry if the file is not present + */ + CVSEntry fileStatus( const QString &fileName, bool refreshCache = false ) const; + /** + */ + VCSFileInfoMap dirStatus() const; + VCSFileInfoMap *cacheableDirStatus() const; + /** + * @return true if the file is registered into repository, false otherwise + */ + bool isRegistered( const QString fileName ) const; + /** + * Check if the specified @p fileName is in "<CVSDIR>/.cvsignore" and, if not, + * append it. + */ + void ignoreFile( const QString &fileName ); + /** + * Check if the specified @p fileName is in "<CVSDIR>/.cvsignore" and, if yes, + * remove it. + */ + void doNotIgnoreFile( const QString &fileName ); + /** + * @return the content of "<CVSDIR>/CVS/Repository" + */ + QString repository() const; + /** + * @return the content of "<CVSDIR>/CVS/Root" + */ + QString root() const; + /** + * @return full path of "<this-dir>/CVS/Entries" + */ + QString entriesFileName() const; + /** + * @return full path of "<this-dir>/CVS/Root" + */ + QString rootFileName() const; + /** + * @return full path of "<this-dir>/CVS/Repository" + */ + QString repoFileName() const; + /** + * @return full path of "<this-dir>/.cvsignore" + */ + QString cvsIgnoreFileName() const; + +private: + void refreshEntriesCache() const; + static QByteArray cacheFile( const QString &fileName ); + + QString m_cvsDir; + + typedef QMap<QString,CVSEntry> CVSEntriesCacheMap; + mutable CVSEntriesCacheMap m_cachedEntries; +}; + +#endif |