controller_patcher/source/ConfigReader.hpp

69 lines
1.9 KiB
C++
Raw Permalink Normal View History

/****************************************************************************
* Copyright (C) 2016,2017 Maschell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef _ConfigReader_H_
#define _ConfigReader_H_
#include <string>
#include <vector>
2017-10-29 09:34:47 +01:00
#include "ControllerPatcherIncludes.hpp"
2023-04-10 11:45:58 +02:00
class ConfigReader {
friend class ControllerPatcher;
friend class ConfigParser;
2023-04-10 11:45:58 +02:00
private:
static ConfigReader *getInstance() {
if (!instance) {
instance = new ConfigReader();
}
2023-04-10 11:45:58 +02:00
return instance;
}
2023-04-10 11:45:58 +02:00
static void destroyInstance() {
if (instance) {
delete instance;
instance = NULL;
}
2023-04-10 11:45:58 +02:00
}
2023-04-10 11:45:58 +02:00
static int32_t getNumberOfLoadedFiles() {
return ConfigReader::numberValidFiles;
}
static void increaseNumberOfLoadedFiles() {
ConfigReader::numberValidFiles++;
}
BOOL ReadConfigs(std::string path);
static int32_t numberValidFiles;
2023-04-10 11:45:58 +02:00
//!Constructor
ConfigReader();
//!Destructor
~ConfigReader();
2023-04-10 11:45:58 +02:00
int32_t InitSDCard();
2023-04-10 11:45:58 +02:00
static ConfigReader *instance;
2023-04-10 11:45:58 +02:00
std::string loadFileToString(std::string path);
void processFileList(std::vector<std::string> path);
2023-04-10 11:45:58 +02:00
std::vector<std::string> ScanFolder(std::string path);
};
#endif