Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
1.2 KB
Raw Blame
/* This file is part of the KDE project
   SPDX-FileCopyrightText: 2002 David Faure <[email protected]>

   SPDX-License-Identifier: LGPL-2.0-or-later
*/

#ifndef koDirectoryStore_h
#define koDirectoryStore_h

#include "KoStore.h"

class QFile;

class KoDirectoryStore : public KoStore
{
public:
    KoDirectoryStore(const QString& path, Mode _mode, bool writeMimetype);
    ~KoDirectoryStore() override;
protected:
    void init();
    bool openWrite(const QString &name) override {
        return openReadOrWrite(name, QIODevice::WriteOnly);
    }
    bool openRead(const QString &name) override {
        return openReadOrWrite(name, QIODevice::ReadOnly);
    }
    bool closeRead() override {
        return true;
    }
    bool closeWrite() override {
        return true;
    }
    bool enterRelativeDirectory(const QString &dirName) override;
    bool enterAbsoluteDirectory(const QString &path) override;
    bool fileExists(const QString &absPath) const override;

    bool openReadOrWrite(const QString &name, QIODevice::OpenModeFlag ioMode);
private:
    // Path to base directory (== the ctor argument)
    QString m_basePath;

    // Path to current directory
    QString m_currentPath;

    // Current File
    QFile* m_file;
    Q_DECLARE_PRIVATE(KoStore)
};

#endif