summaryrefslogtreecommitdiffstats
path: root/tdeioslave/mac/tdeio_mac.h
blob: e497e9918f3e7c6a7ce665fd8bb21f0f5c327ec3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/***************************************************************************
                          mac.cpp
                             -------------------
    copyright            : (C) 2002 Jonathan Riddell
    email                : jr@jriddell.org
    version              : 1.0
    release date         : 10 Feburary 2002
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include <tdeio/slavebase.h>
#include <tdeio/global.h>
#include <kurl.h>
#include <kprocess.h>

#include <tqstring.h>
#include <tqcstring.h>
#include <tqfile.h>
#include <tqtextstream.h>

class MacProtocol : public TQObject, public TDEIO::SlaveBase
{
    Q_OBJECT
public:
    MacProtocol(const TQCString &pool, const TQCString &app);
    ~MacProtocol();
    virtual void get(const KURL& url );
    virtual void listDir(const KURL& url);
    virtual void stat(const KURL& url);
protected slots:
    void slotGetStdOutput(TDEProcess*, char*, int);
    void slotSetDataStdOutput(TDEProcess*, char *s, int len);
protected:
    TQString prepareHP(const KURL& _url);
    TQValueList<TDEIO::UDSAtom> makeUDS(const TQString& _line);
    int makeTime(TQString mday, TQString mon, TQString third);
    TQString getMimetype(TQString type, TQString app);
    TQValueList<TDEIO::UDSAtom> doStat(const KURL& url);

    TDEIO::filesize_t processedBytes;
    TQString standardOutputStream;
    TDEProcess* myTDEProcess;

    //for debugging
    //TQFile* logFile;
    //TQTextStream* logStream;
};