ktempdir.h
/*
This file is part of the KDE libraries
Copyright (c) 2003 Joseph Wenninger <jowenn@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _KTEMPDIR_H_
#define _KTEMPDIR_H_
#include <qstring.h>
#include <stdio.h>
#include <errno.h>
#include "kdelibs_export.h"
class QDir;
class KTempDirPrivate;
class KDECORE_EXPORT KTempDir
{
public:
KTempDir(QString directoryPrefix=QString::null,
int mode = 0700 );
~KTempDir();
void setAutoDelete(bool autoDelete) { bAutoDelete = autoDelete; }
int status() const;
QString name() const;
QDir *qDir();
void unlink();
bool existing() const;
static bool removeDir( const QString& path );
protected:
bool create(const QString &directoryPrefix, int mode);
void setError(int error) { mError = error; }
private:
int mError;
QString mTmpName;
bool bExisting;
bool bAutoDelete;
KTempDirPrivate *d;
};
#endif
KTempDir
The KTempDir class creates a unique directory for temporary use.
Definition: ktempdir.h:53
KTempDir::setError
void setError(int error)
Sets the errno value.
Definition: ktempdir.h:161
KTempDir::setAutoDelete
void setAutoDelete(bool autoDelete)
Turn automatic deletion on or off.
Definition: ktempdir.h:85

KDE Home | KDE Accessibility Home | Description of Access Keys