lib

KoDirectoryStore.h
1/* This file is part of the KDE project
2 Copyright (C) 2002 David Faure <faure@kde.org>
3
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.
8
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.
13
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.
18*/
19
20#ifndef koDirectoryStore_h
21#define koDirectoryStore_h
22
23#include "KoStoreBase.h"
24
25class TQFile;
26
27class KoDirectoryStore : public KoStoreBase
28{
29public:
30 KoDirectoryStore( const TQString& path, Mode _mode );
31 ~KoDirectoryStore();
32protected:
33 virtual bool init( Mode _mode );
34 virtual bool openWrite( const TQString& name ) { return openReadOrWrite( name, IO_WriteOnly ); }
35 virtual bool openRead( const TQString& name ) { return openReadOrWrite( name, IO_ReadOnly ); }
36 virtual bool closeRead() { return true; }
37 virtual bool closeWrite() { return true; }
38 virtual bool enterRelativeDirectory( const TQString& dirName );
39 virtual bool enterAbsoluteDirectory( const TQString& path );
40 virtual bool fileExists( const TQString& absPath ) const;
41
42 bool openReadOrWrite( const TQString& name, int iomode );
43private:
44 // Path to base directory (== the ctor argument)
45 TQString m_basePath;
46
47 // Path to current directory
48 TQString m_currentPath;
49
50 // Current File
51 TQFile* m_file;
52};
53
54#endif
Helper class for KoStore (mainly for remote file support).
Definition KoStoreBase.h:33
virtual bool closeRead()=0
virtual bool closeWrite()=0