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

KIOSlave

  • 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
46class KIOSLAVE_FILE_EXPORT FileProtocol : public QObject, public KIO::SlaveBase
47{
48 Q_OBJECT
49public:
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
91private:
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
101private:
102 mutable QHash<uid_t, QString> mUsercache;
103 mutable QHash<gid_t, QString> mGroupcache;
104 int openFd;
105 QString openPath;
106};
107
108#endif
FileProtocol
Definition: file.h:47
KIO::SlaveBase
KIO::SlaveBase::setModificationTime
virtual void setModificationTime(const KUrl &url, const QDateTime &mtime)
KIO::SlaveBase::mkdir
virtual void mkdir(const KUrl &url, int permissions)
KIO::SlaveBase::put
virtual void put(const KUrl &url, int permissions, JobFlags flags)
KIO::SlaveBase::chown
virtual void chown(const KUrl &url, const QString &owner, const QString &group)
KIO::SlaveBase::seek
virtual void seek(KIO::filesize_t offset)
KIO::SlaveBase::chmod
virtual void chmod(const KUrl &url, int permissions)
KIO::SlaveBase::write
virtual void write(const QByteArray &data)
KIO::SlaveBase::get
virtual void get(const KUrl &url)
KIO::SlaveBase::listDir
virtual void listDir(const KUrl &url)
KIO::SlaveBase::symlink
virtual void symlink(const QString &target, const KUrl &dest, JobFlags flags)
KIO::SlaveBase::stat
virtual void stat(const KUrl &url)
KIO::SlaveBase::special
virtual void special(const QByteArray &data)
KIO::SlaveBase::read
virtual void read(KIO::filesize_t size)
KIO::SlaveBase::rename
virtual void rename(const KUrl &src, const KUrl &dest, JobFlags flags)
KIO::SlaveBase::close
virtual void close()
KIO::UDSEntry
KUrl
QHash
QObject
global.h
kioslave_file_export.h
open
int open(const QString &pathname, int flags, mode_t mode)
del
DeleteJob * del(const KUrl &src, JobFlags flags=DefaultFlags)
KIO::mount
SimpleJob * mount(bool ro, const QByteArray &fstype, const QString &dev, const QString &point, JobFlags flags=DefaultFlags)
copy
CopyJob * copy(const KUrl &src, const KUrl &dest, JobFlags flags=DefaultFlags)
KIO::unmount
SimpleJob * unmount(const QString &point, JobFlags flags=DefaultFlags)
KIO::filesize_t
qulonglong filesize_t
group
group
slavebase.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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