KIO

knfsshare.h
1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2004 Jan Schaefer <j_schaef@informatik.uni-kl.de>
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 */
26class KNFSShare : public QObject
27{
29public:
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 */
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
63 /**
64 * Emitted when the /etc/exports file has changed
65 */
66 void changed();
67
68private:
69 KIOCORE_NO_EXPORT KNFSShare();
70 class KNFSSharePrivate;
71 std::unique_ptr<KNFSSharePrivate> const d;
72
73 friend class KNFSShareSingleton;
74};
75
76#endif
Similar functionality like KFileShare, but works only for NFS and do not need any suid script.
Definition knfsshare.h:27
QString exportsPath() const
Returns the path to the used exports file, or null if no exports file was found.
void changed()
Emitted when the /etc/exports file has changed.
~KNFSShare() override
KNFSShare destructor.
static KNFSShare * instance()
Returns the one and only instance of KNFSShare.
bool isDirectoryShared(const QString &path) const
Whether or not the given path is shared by NFS.
QStringList sharedDirectories() const
Returns a list of all directories shared by NFS.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.