Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / runtime / kioslave / floppy / kio_floppy.h
blob132e3e792fbcfd1e9697549ac466dfdea98b3312
1 /* This file is part of the KDE project
2 Copyright (C) 2000 Alexander Neundorf <neundorf@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef KIO_FLOPPY_H
21 #define KIO_FLOPPY_H
23 #include <kio/slavebase.h>
24 #include <kio/global.h>
26 #include "program.h"
29 struct StatInfo
31 StatInfo():name(""),time(0),size(0),mode(0),freeSpace(0),isDir(false),isValid(false) {;}
32 QString name;
33 time_t time;
34 int size;
35 int mode;
36 int freeSpace;
37 bool isDir:1;
38 bool isValid:1;
42 class FloppyProtocol : public KIO::SlaveBase
44 public:
45 FloppyProtocol (const QByteArray &pool, const QByteArray &app );
46 virtual ~FloppyProtocol();
48 virtual void listDir( const KUrl& url);
49 virtual void stat( const KUrl & url);
50 virtual void mkdir( const KUrl& url, int);
51 virtual void del( const KUrl& url, bool isfile);
52 virtual void rename(const KUrl &src, const KUrl &dest, KIO::JobFlags _flags);
53 virtual void get( const KUrl& url );
54 virtual void put( const KUrl& url, int _mode, KIO::JobFlags _flags );
55 //virtual void copy( const KUrl& src, const KUrl &dest, int, bool overwrite );
56 protected:
57 Program *m_mtool;
58 int readStdout();
59 int readStderr();
61 StatInfo createStatInfo(const QString line, bool makeStat=false, const QString& dirName="");
62 void createUDSEntry(const StatInfo& info, KIO::UDSEntry& entry);
63 StatInfo _stat(const KUrl& _url);
64 int freeSpace(const KUrl& url);
66 bool stopAfterError(const KUrl& url, const QString& drive);
67 void errorMissingMToolsProgram(const QString& name);
69 void clearBuffers();
70 void terminateBuffers();
71 char *m_stdoutBuffer;
72 char *m_stderrBuffer;
73 int m_stdoutSize;
74 int m_stderrSize;
77 #endif