#include <model.h>
|
| | Model ()=default |
| | ~Model ()=default |
| void | dir_init () |
| | Sets up the .todo directory and its contents.
|
| void | add (Task &task, const std::vector< u64 > &path) |
| | Adds task with description to todo list.
|
| void | remove (const std::vector< u64 > &path) |
| | Remove task from the todo list.
|
| void | clear () |
| | Clears (empties) the list.
|
| void | load_file () |
| | Load from a JSON file to populate todo list vector.
|
| void | save_file () |
| | Save todo list vector to a JSON file.
|
| void | change_task_desc (const std::vector< u64 > &path, const std::string &desc) |
| | Changes the completion status of a task.
|
| void | change_task_status (const std::vector< u64 > &path, const Status status) |
| | Changes the completion status of a task.
|
| void | change_task_priority (const std::vector< u64 > &path, const u16 priority) |
| | Changes the completion status of a task.
|
| const std::vector< Task > & | get_list () |
| | Returns a const reference of the todo list vector.
|
| const Task * | get_task (const std::vector< u64 > &path) |
| | Finds task via path.
|
| const Task * | get_parent_task (const std::vector< u64 > &path) |
| | Finds parent of task via path.
|
◆ Model()
◆ ~Model()
◆ add()
| void todo::Model::add |
( |
Task & | task, |
|
|
const std::vector< u64 > & | path ) |
Adds task with description to todo list.
- Parameters
-
| task | A reference to the task to add. |
| path | Path of task to add. |
◆ change_task_desc()
| void todo::Model::change_task_desc |
( |
const std::vector< u64 > & | path, |
|
|
const std::string & | desc ) |
Changes the completion status of a task.
- Parameters
-
| path | Path of the task to change. |
| desc | Description(str) to change to. |
◆ change_task_priority()
| void todo::Model::change_task_priority |
( |
const std::vector< u64 > & | path, |
|
|
const u16 | priority ) |
Changes the completion status of a task.
- Parameters
-
| path | Path of the task to change. |
| prio | Priority to change to. |
◆ change_task_status()
| void todo::Model::change_task_status |
( |
const std::vector< u64 > & | path, |
|
|
const Status | status ) |
Changes the completion status of a task.
- Parameters
-
| path | Path of the task to change. |
| status | Status to change to. |
◆ clear()
| void todo::Model::clear |
( |
| ) |
|
Clears (empties) the list.
◆ dir_init()
| void todo::Model::dir_init |
( |
| ) |
|
Sets up the .todo directory and its contents.
◆ get_list()
| const std::vector< Task > & todo::Model::get_list |
( |
| ) |
|
Returns a const reference of the todo list vector.
◆ get_parent_task()
| const Task * todo::Model::get_parent_task |
( |
const std::vector< u64 > & | path | ) |
|
Finds parent of task via path.
- Parameters
-
◆ get_task()
| const Task * todo::Model::get_task |
( |
const std::vector< u64 > & | path | ) |
|
Finds task via path.
- Parameters
-
◆ load_file()
| void todo::Model::load_file |
( |
| ) |
|
Load from a JSON file to populate todo list vector.
- Note
- Uses boost.JSON to parse file.
◆ remove()
| void todo::Model::remove |
( |
const std::vector< u64 > & | path | ) |
|
Remove task from the todo list.
- Parameters
-
| path | Path of the task to remove. |
◆ save_file()
| void todo::Model::save_file |
( |
| ) |
|
Save todo list vector to a JSON file.
- Note
- Uses boost.JSON to serialize data.
The documentation for this class was generated from the following files: