• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KIOSlave

  • sources
  • kde-4.12
  • kdelibs
  • kioslave
  • file
file.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2000-2002 Stephan Kulow <coolo@kde.org>
3  Copyright (C) 2000-2002 David Faure <faure@kde.org>
4  Copyright (C) 2000-2002 Waldo Bastian <bastian@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License (LGPL) as published by the Free Software Foundation;
9  either version 2 of the License, or (at your option) any later
10  version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #ifndef __file_h__
24 #define __file_h__
25 
26 #include "kioslave_file_export.h"
27 #include <kio/global.h>
28 #include <kio/slavebase.h>
29 
30 #include <QtCore/QObject>
31 #include <QtCore/QHash>
32 
33 #include <config-acl.h>
34 
35 #ifdef HAVE_POSIX_ACL
36 #include <sys/acl.h>
37 #include <acl/libacl.h>
38 #endif
39 
40 #include <sys/types.h>
41 #include <sys/stat.h>
42 
43 #include <stdio.h>
44 #include <unistd.h>
45 
46 class KIOSLAVE_FILE_EXPORT FileProtocol : public QObject, public KIO::SlaveBase
47 {
48  Q_OBJECT
49 public:
50  FileProtocol( const QByteArray &pool, const QByteArray &app);
51  virtual ~FileProtocol();
52 
53  virtual void get( const KUrl& url );
54  virtual void put( const KUrl& url, int _mode,
55  KIO::JobFlags _flags );
56  virtual void copy( const KUrl &src, const KUrl &dest,
57  int mode, KIO::JobFlags flags );
58  virtual void rename( const KUrl &src, const KUrl &dest,
59  KIO::JobFlags flags );
60  virtual void symlink( const QString &target, const KUrl &dest,
61  KIO::JobFlags flags );
62 
63  virtual void stat( const KUrl& url );
64  virtual void listDir( const KUrl& url );
65  virtual void mkdir( const KUrl& url, int permissions );
66  virtual void chmod( const KUrl& url, int permissions );
67  virtual void chown( const KUrl& url, const QString& owner, const QString& group );
68  virtual void setModificationTime( const KUrl& url, const QDateTime& mtime );
69  virtual void del( const KUrl& url, bool isfile);
70  virtual void open( const KUrl &url, QIODevice::OpenMode mode );
71  virtual void read( KIO::filesize_t size );
72  virtual void write( const QByteArray &data );
73  virtual void seek( KIO::filesize_t offset );
74  virtual void close();
75 
81  virtual void special( const QByteArray &data );
82  void unmount( const QString& point );
83  void mount( bool _ro, const char *_fstype, const QString& dev, const QString& point );
84  bool pumount( const QString &point );
85  bool pmount( const QString &dev );
86 
87 #ifdef HAVE_POSIX_ACL
88  static bool isExtendedACL(acl_t acl);
89 #endif
90 
91 private:
92  bool createUDSEntry( const QString & filename, const QByteArray & path, KIO::UDSEntry & entry,
93  short int details, bool withACL );
94  int setACL( const char *path, mode_t perm, bool _directoryDefault );
95 
96  QString getUserName( uid_t uid ) const;
97  QString getGroupName( gid_t gid ) const;
98 
99  bool deleteRecursive(const QString& path);
100 
101 private:
102  mutable QHash<uid_t, QString> mUsercache;
103  mutable QHash<gid_t, QString> mGroupcache;
104  int openFd;
105  QString openPath;
106 };
107 
108 #endif
KIO::unmount
SimpleJob * unmount(const QString &point, JobFlags flags=DefaultFlags)
KIO::filesize_t
qulonglong filesize_t
KIO::special
SimpleJob * special(const KUrl &url, const QByteArray &data, JobFlags flags=DefaultFlags)
KIO::SlaveBase::put
virtual void put(const KUrl &url, int permissions, JobFlags flags)
KIO::UDSEntry
group
kioslave_file_export.h
KIO::SlaveBase::copy
virtual void copy(const KUrl &src, const KUrl &dest, int permissions, JobFlags flags)
KIO::SlaveBase::symlink
virtual void symlink(const QString &target, const KUrl &dest, JobFlags flags)
QString
QHash< uid_t, QString >
QObject
global.h
KUrl
KIO::SlaveBase::del
virtual void del(const KUrl &url, bool isfile)
FileProtocol
Definition: file.h:46
KIO::mount
SimpleJob * mount(bool ro, const QByteArray &fstype, const QString &dev, const QString &point, JobFlags flags=DefaultFlags)
KIO::SlaveBase::stat
virtual void stat(const KUrl &url)
KIO::SlaveBase::chmod
virtual void chmod(const KUrl &url, int permissions)
KIO::chown
SimpleJob * chown(const KUrl &url, const QString &owner, const QString &group)
KIO::SlaveBase
KIO::open
FileJob * open(const KUrl &url, QIODevice::OpenMode mode)
KIO::SlaveBase::mkdir
virtual void mkdir(const KUrl &url, int permissions)
QDateTime
KIO::SlaveBase::listDir
virtual void listDir(const KUrl &url)
KIO::SlaveBase::rename
virtual void rename(const KUrl &src, const KUrl &dest, JobFlags flags)
KIO::SlaveBase::setModificationTime
virtual void setModificationTime(const KUrl &url, const QDateTime &mtime)
slavebase.h
close
KAction * close(const QObject *recvr, const char *slot, QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIOSlave

Skip menu "KIOSlave"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal