KIO

knfsshare.h
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 2004 Jan Schaefer <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-only
6 */
7 
8 #ifndef knfsshare_h
9 #define knfsshare_h
10 
11 #include <QObject>
12 
13 #include "kiocore_export.h"
14 
15 #include <memory>
16 
17 /**
18  * @class KNFSShare knfsshare.h <KNFSShare>
19  *
20  * Similar functionality like KFileShare,
21  * but works only for NFS and do not need
22  * any suid script.
23  * It parses the /etc/exports file to get its information.
24  * Singleton class, call instance() to get an instance.
25  */
26 class KIOCORE_EXPORT KNFSShare : public QObject
27 {
28  Q_OBJECT
29 public:
30  /**
31  * Returns the one and only instance of KNFSShare
32  */
33  static KNFSShare *instance();
34 
35  /**
36  * Whether or not the given path is shared by NFS.
37  * @param path the path to check if it is shared by NFS.
38  * @return whether the given path is shared by NFS.
39  */
40  bool isDirectoryShared(const QString &path) const;
41 
42  /**
43  * Returns a list of all directories shared by NFS.
44  * The resulting list is not sorted.
45  * @return a list of all directories shared by NFS.
46  */
47  QStringList sharedDirectories() const;
48 
49  /**
50  * KNFSShare destructor.
51  * Do not call!
52  * The instance is destroyed automatically!
53  */
54  ~KNFSShare() override;
55 
56  /**
57  * Returns the path to the used exports file,
58  * or null if no exports file was found
59  */
60  QString exportsPath() const;
61 
62 Q_SIGNALS:
63  /**
64  * Emitted when the /etc/exports file has changed
65  */
66  void changed();
67 
68 private:
69  KNFSShare();
70  class KNFSSharePrivate;
71  std::unique_ptr<KNFSSharePrivate> const d;
72 
73  Q_PRIVATE_SLOT(d, void _k_slotFileChange(const QString &))
74 
75  friend class KNFSShareSingleton;
76 };
77 
78 #endif
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu May 26 2022 03:49:33 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.