File indexing completed on 2024-12-01 05:16:34

0001 /**
0002  * SPDX-FileCopyrightText: (C) 2003 by Sébastien Laoût <slaout@linux62.org>
0003  * SPDX-License-Identifier: GPL-2.0-or-later
0004  */
0005 
0006 /** Common methods extracted here to simplify the dependency between classes
0007  */
0008 
0009 #ifndef BASKET_COMMON_H
0010 #define BASKET_COMMON_H
0011 
0012 class QByteArray;
0013 class QString;
0014 
0015 namespace FileStorage {
0016     bool loadFromFile(const QString &fullPath, QString *string);
0017     bool loadFromFile(const QString &fullPath, QByteArray *array);
0018     bool saveToFile(const QString &fullPath, const QString &string, bool isEncrypted = false);
0019     bool saveToFile(const QString &fullPath, const QByteArray &array, bool isEncrypted = false); //[Encrypt and] save binary content
0020     bool safelySaveToFile(const QString &fullPath, const QByteArray &array, unsigned long length);
0021     bool safelySaveToFile(const QString &fullPath, const QString &string);
0022 }
0023 
0024 #endif