• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.8.5 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 
34 #include <sys/types.h>
35 #include <sys/stat.h>
36 
37 #include <stdio.h>
38 #include <unistd.h>
39 
40 class KIOSLAVE_FILE_EXPORT FileProtocol : public QObject, public KIO::SlaveBase
41 {
42  Q_OBJECT
43 public:
44  FileProtocol( const QByteArray &pool, const QByteArray &app);
45  virtual ~FileProtocol();
46 
47  virtual void get( const KUrl& url );
48  virtual void put( const KUrl& url, int _mode,
49  KIO::JobFlags _flags );
50  virtual void copy( const KUrl &src, const KUrl &dest,
51  int mode, KIO::JobFlags flags );
52  virtual void rename( const KUrl &src, const KUrl &dest,
53  KIO::JobFlags flags );
54  virtual void symlink( const QString &target, const KUrl &dest,
55  KIO::JobFlags flags );
56 
57  virtual void stat( const KUrl& url );
58  virtual void listDir( const KUrl& url );
59  virtual void mkdir( const KUrl& url, int permissions );
60  virtual void chmod( const KUrl& url, int permissions );
61  virtual void chown( const KUrl& url, const QString& owner, const QString& group );
62  virtual void setModificationTime( const KUrl& url, const QDateTime& mtime );
63  virtual void del( const KUrl& url, bool isfile);
64  virtual void open( const KUrl &url, QIODevice::OpenMode mode );
65  virtual void read( KIO::filesize_t size );
66  virtual void write( const QByteArray &data );
67  virtual void seek( KIO::filesize_t offset );
68  virtual void close();
69 
75  virtual void special( const QByteArray &data );
76  void unmount( const QString& point );
77  void mount( bool _ro, const char *_fstype, const QString& dev, const QString& point );
78  bool pumount( const QString &point );
79  bool pmount( const QString &dev );
80 
81 private:
82  bool createUDSEntry( const QString & filename, const QByteArray & path, KIO::UDSEntry & entry,
83  short int details, bool withACL );
84  int setACL( const char *path, mode_t perm, bool _directoryDefault );
85 
86  QString getUserName( uid_t uid ) const;
87  QString getGroupName( gid_t gid ) const;
88 
89  bool deleteRecursive(const QString& path);
90 
91 private:
92  mutable QHash<uid_t, QString> mUsercache;
93  mutable QHash<gid_t, QString> mGroupcache;
94  int openFd;
95  QString openPath;
96 };
97 
98 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Fri Dec 7 2012 16:13:29 by doxygen 1.8.1 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.8.5 API Reference

Skip menu "kdelibs-4.8.5 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