Format all c++ files

This commit is contained in:
Vyn 2024-04-13 11:52:42 +02:00
parent 081e107b9b
commit f8f49233dc
21 changed files with 683 additions and 599 deletions

View file

@ -1,4 +1,4 @@
/*
/*
* Mirai. Copyright (C) 2024 Vyn
* This file is licensed under version 3 of the GNU General Public License (GPL-3.0-only)
* The license can be found in the LICENSE file or at https://www.gnu.org/licenses/gpl-3.0.txt
@ -14,33 +14,33 @@
#include <algorithm>
#include <memory>
namespace mirai {
namespace mirai
{
class Mirai {
class Mirai
{
public:
public:
void loadFile(const std::string &path);
void save();
void addTask(TaskItem taskItem);
void addTask(std::string text, std::string date);
void removeTask(const TaskItem *taskItem);
void loadFile(const std::string& path);
void save();
void addTask(TaskItem taskItem);
void addTask(std::string text, std::string date);
void removeTask(const TaskItem* taskItem);
std::weak_ptr<TasksView> getTasks();
const std::vector<std::string> &getTags();
std::weak_ptr<TasksView> getTasks();
const std::vector<std::string>& getTags();
private:
// The `TasksFile`s are shared to the views, their lifetime can outlive
// this (Mirai) object
// because we can't control if the caller will keep the main object alive.
std::shared_ptr<std::vector<TasksFile>> files = std::make_shared<std::vector<TasksFile>>();
private:
// The `TasksFile`s are shared to the views, their lifetime can outlive
// this (Mirai) object
// because we can't control if the caller will keep the main object alive.
std::shared_ptr<std::vector<TasksFile>> files = std::make_shared<std::vector<TasksFile>>();
// We keep a vector of shared_ptr because we need the ref counting mechanism to know
// if we have to remove the view (not used) or tell the view to update() on
// some changes.
std::vector<std::shared_ptr<TasksView>> views;
std::vector<std::string> tags;
};
}
// We keep a vector of shared_ptr because we need the ref counting mechanism to know
// if we have to remove the view (not used) or tell the view to update() on
// some changes.
std::vector<std::shared_ptr<TasksView>> views;
std::vector<std::string> tags;
};
} // namespace mirai
#endif