home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / knfsshare.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.2 KB  |  87 lines

  1. /* This file is part of the KDE project
  2.    Copyright (c) 2004 Jan Schaefer <j_schaef@informatik.uni-kl.de>
  3.  
  4.    This library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public
  6.    License version 2 as published by the Free Software Foundation.
  7.  
  8.    This library is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  11.    Library General Public License for more details.
  12.  
  13.    You should have received a copy of the GNU Library General Public License
  14.    along with this library; see the file COPYING.LIB.  If not, write to
  15.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16.    Boston, MA 02110-1301, USA.
  17. */
  18.  
  19. #ifndef knfsshare_h
  20. #define knfsshare_h
  21.  
  22. #include <qobject.h>
  23.  
  24. #include <kdelibs_export.h>
  25.  
  26. class KNFSSharePrivate;
  27.  
  28. /**
  29.  * Similar functionality like KFileShare, 
  30.  * but works only for NFS and do not need 
  31.  * any suid script.
  32.  * It parses the /etc/exports file to get its information.
  33.  * Singleton class, call instance() to get an instance.
  34.  */
  35. class KIO_EXPORT KNFSShare : public QObject 
  36. {
  37. Q_OBJECT
  38. public:
  39.   /**
  40.    * Returns the one and only instance of KNFSShare
  41.    */
  42.   static KNFSShare* instance();
  43.  
  44.   /**
  45.    * Wether or not the given path is shared by NFS.
  46.    * @param path the path to check if it is shared by NFS.
  47.    * @return wether the given path is shared by NFS.
  48.    */
  49.   bool isDirectoryShared( const QString & path ) const;
  50.   
  51.   /**
  52.    * Returns a list of all directories shared by NFS.
  53.    * The resulting list is not sorted.
  54.    * @return a list of all directories shared by NFS.
  55.    */
  56.   QStringList sharedDirectories() const;
  57.   
  58.   /**
  59.    * KNFSShare destructor. 
  60.    * Do not call!
  61.    * The instance is destroyed automatically!
  62.    */ 
  63.   virtual ~KNFSShare();
  64.   
  65.   /**
  66.    * Returns the path to the used exports file,
  67.    * or null if no exports file was found
  68.    */
  69.   QString exportsPath() const;
  70.   
  71. signals:
  72.   /**
  73.    * Emitted when the /etc/exports file has changed
  74.    */
  75.   void changed();  
  76.   
  77. private:
  78.   KNFSShare();
  79.   static KNFSShare* _instance;
  80.   KNFSSharePrivate* d;
  81.   
  82. private slots:
  83.   void slotFileChange(const QString&);  
  84. };
  85.  
  86. #endif
  87.