Convert classes and files to snake_case

This commit is contained in:
Vyn 2025-07-01 21:42:59 +02:00
parent 686d86df6f
commit 6fa94b279c
Signed by: vyn
GPG key ID: E1B2BE34E7A971E7
26 changed files with 272 additions and 301 deletions

76
external/mirai-core/src/task.cpp vendored Normal file
View file

@ -0,0 +1,76 @@
/*
* 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
*/
#include "task.h"
#include "data_provider.h"
#include "utils.h"
#include <optional>
#include <string>
namespace mirai
{
int task::id() const
{
return task_.id;
}
int task::source_id() const
{
return data_->id;
}
std::string task::title() const
{
return task_.title;
}
mirai::task_state task::state() const
{
return task_.state;
}
bool task::checked() const
{
return task_.state == mirai::DONE;
}
bool task::has_due_date() const
{
return task_.due_date.has_value();
}
std::optional<class date> task::due_date() const
{
if (!task_.due_date.has_value()) {
return std::nullopt;
}
return task_.due_date.value();
}
void task::set_title(const std::string &newTitle)
{
data_->update_task(id(), {.title = newTitle});
}
void task::set_date(const date &date)
{
auto emptyEventId = std::optional<std::optional<int>>(std::optional<int>(std::nullopt));
data_->update_task(id(), {.due_date = date});
}
void task::unschedule()
{
auto emptyId = std::optional<std::optional<int>>(std::optional<int>(std::nullopt));
data_->update_task(id(), {.due_date = std::nullopt});
}
void task::set_checked(bool checked)
{
data_->update_task(id(), {.state = checked ? DONE : TODO});
}
} // namespace mirai