This is a simple To-Do List application written in C++. The application allows users to create, manipulate, and save a list of tasks. The tasks are stored in a list.txt
file, enabling persistence across sessions.
This class represents the entire to-do list and contains methods to manipulate the list of items.
- addItem(const Item &item): Adds a new item to the list.
- removeItem(int index): Removes an item from the list based on its index.
- displayItems() const: Displays all the items in the list.
- saveToFile() const: Saves the list of items to
list.txt
. - loadFromFile(): Loads the list of items from
list.txt
.
This class represents a specific task in the to-do list.
- std::string description: A description of the task.
- bool completed: A flag indicating whether the task is completed.
Used for input and output from the user.
Used for formatting the display of the list items.
Used for managing and formatting user input.
Used for reading from and writing to the list.txt
file.
Used for file manipulation, specifically for removing the list.txt
file.
- A C++ compiler (e.g., g++, clang++)
- A text editor or IDE (e.g., VSCode, CLion)
- Clone the repository:
git clone https://github.com/naemazam/to-do-cpp.git cd to-do-cpp
- Compile the application:
g++ main.cpp -o to-do-cpp
Run the application:
./to-do-cpp
Upon running the application, you will be presented with a menu to add, remove, display tasks, save the list to a file, or load the list from a file.
- main.cpp: The main file containing the entry point of the application.
- TodoList.h: Header file for the
TodoList
class. - Item.h: Header file for the
Item
class. - list.txt: File used to store the tasks persistently.
- README.md: This README file.
- Add a feature to edit existing tasks.
- Implement a search function to find tasks by keywords.
- Add a graphical user interface (GUI).