Seminar Computergrafik mit GameEngines: EventQueue (inspiriert von https://gameprogrammingpatterns.com/event-queue.html)
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
589 B
30 lines
589 B
#include "FileManager.h"
|
|
#include <iostream>
|
|
|
|
void FileManager::update() {
|
|
auto cmd = pop();
|
|
cmd->execute();
|
|
delete cmd;
|
|
}
|
|
|
|
void FileManager::readFile(const std::string &path, const std::function<void(std::string)> &readCallback) {
|
|
auto cmd = new FileReadCommand;
|
|
cmd->path = path;
|
|
cmd->readCallback = readCallback;
|
|
push(cmd);
|
|
}
|
|
|
|
void FileManager::writeFile(const std::string &path, const std::string &content) {
|
|
auto cmd = new FileWriteCommand;
|
|
cmd->path = path;
|
|
cmd->content = content;
|
|
push(cmd);
|
|
}
|
|
|
|
void FileReadCommand::execute() {
|
|
|
|
}
|
|
|
|
void FileWriteCommand::execute() {
|
|
|
|
}
|
|
|