Marble

FileStoragePolicy.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2007 Tobias Koenig <[email protected]>
4 //
5 
6 #ifndef MARBLE_FILESTORAGEPOLICY_H
7 #define MARBLE_FILESTORAGEPOLICY_H
8 
9 #include "StoragePolicy.h"
10 
11 namespace Marble
12 {
13 
14 class FileStoragePolicy : public StoragePolicy
15 {
16  Q_OBJECT
17 
18  public:
19  /**
20  * Creates a new file storage policy.
21  *
22  * @param dataDirectory The directory where the data should go to.
23  * @param parent The parent object.
24  */
25  explicit FileStoragePolicy( const QString &dataDirectory = QString(), QObject *parent = nullptr );
26 
27  /**
28  * Destroys the cache storage policy.
29  */
30  ~FileStoragePolicy() override;
31 
32  /**
33  * Returns whether the @p fileName exists already.
34  */
35  bool fileExists( const QString &fileName ) const override;
36 
37  /**
38  * Updates the @p fileName with the given @p data.
39  */
40  bool updateFile( const QString &fileName, const QByteArray &data ) override;
41 
42  /**
43  * Clears the cache.
44  */
45  void clearCache() override;
46 
47  /**
48  * Returns the last error message.
49  */
50  QString lastErrorMessage() const override;
51 
52  private:
53  Q_DISABLE_COPY( FileStoragePolicy )
54 
55  QString m_dataDirectory;
56  QString m_errorMsg;
57 };
58 
59 }
60 
61 #endif
Q_OBJECTQ_OBJECT
bool fileExists(const QUrl &path)
Binds a QML item to a specific geodetic location in screen coordinates.
Q_DISABLE_COPY(Class)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Oct 3 2023 04:09:47 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.