A feature-rich command-line To-Do List Manager built with C++11.
This application allows you to add tasks with categories, due dates, priority levels, mark them as completed, and sort them efficiently. All tasks are automatically saved to tasks.txt for persistence.
- β Add Tasks with title, category, due date, and priority
- π View All Tasks with completion status and detailed information
- β Mark Tasks as Completed with task numbering
- π Sort Tasks by priority, due date, or completion status
- πΎ Persistent Storage (automatically saves to
tasks.txt) - π Clean project structure with Makefile support
- π― Intuitive command-line interface with emoji indicators
graph TD
A[main.cpp] --> B[Task.h]
A --> C[Task.cpp]
A --> D[tasks.txt]
A --> E[Makefile]
B --> F[Task Class Definition]
C --> G[Task Implementation]
C --> H[File I/O Operations]
C --> I[Sorting Functions]
D --> J[Persistent Storage<br/>Format: title;category;dueDate;priority;completed]
E --> K[Build Automation<br/>C++11 Standard]
style A fill:#e1f5fe
style B fill:#f3e5f5
style C fill:#f3e5f5
style D fill:#e8f5e8
style E fill:#fff3e0
To-do-list-manager-cpp/
βββ π main.cpp # Main application logic with menu system
βββ π Task.cpp # Task class implementation with all methods
βββ π Task.h # Task class header with declarations
βββ π Makefile # Build automation (g++ with C++11)
βββ π requirements.txt # System requirements and compilation guide
βββ π tasks.txt # Task storage file (auto-created)
βββ π README.md # Project documentation
βββ π .gitignore # Ignore build files and executables
| Component | Version | Status |
|---|---|---|
| C++ Compiler | C++11 or higher | Required |
| g++/clang/MSVC | Latest stable | Required |
| Make | Any version | Optional |
| OS Support | Windows/Linux/macOS | β Tested |
# Clone the repository
git clone https://github.com/musagithub1/To-do-list-manager-cpp.git
cd To-do-list-manager-cpp
# Build using Makefile
make
# Run the application
./todo_app
# Clean build files when needed
make clean# Clone the repository
git clone https://github.com/musagithub1/To-do-list-manager-cpp.git
cd To-do-list-manager-cpp
# Compile manually
g++ -std=c++11 -Wall main.cpp Task.cpp -o todo_app.exe
# Run the application
.\todo_app.exe# Standard compilation
g++ -std=c++11 -Wall main.cpp Task.cpp -o todo_app
# With debugging symbols
g++ -std=c++11 -Wall -g main.cpp Task.cpp -o todo_app
# Optimized release build
g++ -std=c++11 -Wall -O2 main.cpp Task.cpp -o todo_appflowchart TD
A[Start Application] --> B[Load tasks.txt]
B --> C[Main Menu Display]
C --> D{User Choice}
D -->|1| E[Add Task]
D -->|2| F[View Tasks]
D -->|3| G[Mark Completed]
D -->|4| H[Save & Exit]
E --> E1[Enter Title]
E1 --> E2[Enter Category]
E2 --> E3[Enter Due Date]
E3 --> E4[Set Priority]
E4 --> E5[Add to Vector]
E5 --> C
F --> F1[Display All Tasks<br/>with Status & Details]
F1 --> C
G --> G1[Enter Task Number]
G1 --> G2[Mark as Completed]
G2 --> C
H --> H1[Save to tasks.txt]
H1 --> I[Exit Program]
style A fill:#4CAF50
style I fill:#f44336
style C fill:#2196F3
style E fill:#FF9800
style F fill:#9C27B0
style G fill:#4CAF50
style H fill:#607D8B
===== TO-DO LIST MANAGER =====
1. β Add Task
2. π View Tasks
3. β
Mark Task as Completed
4. πΎ Save & Exit
===== TO-DO LIST MANAGER =====
1. β Add Task
2. π View Tasks
3. β
Mark Task as Completed
4. πΎ Save & Exit
Enter your choice: 1
Enter task title: Complete C++ project
Enter category (optional): Programming
β
Task added successfully!
===== TO-DO LIST MANAGER =====
1. β Add Task
2. π View Tasks
3. β
Mark Task as Completed
4. πΎ Save & Exit
Enter your choice: 2
===== TASK LIST =====
1. [ ] Complete C++ project (Category: Programming)
2. [β
] Buy groceries (Category: Personal)
Enter your choice: 3
Enter task number to mark as completed: 1
β
Task marked as completed!
classDiagram
class Task {
-string title
-string category
-string dueDate
-string priority
-bool completed
+Task(title, category)
+Task(title, category, dueDate, priority)
+getTitle() string
+getCategory() string
+getDueDate() string
+getPriority() string
+isCompleted() bool
+markDone() void
+viewTasks(vector~Task~) static void
+markCompleted(vector~Task~, int) static void
+saveTasks(vector~Task~) static void
+loadTasks(vector~Task~) static void
+sortTasks(vector~Task~, int) static void
}
The tasks.txt file uses a semicolon-delimited format:
title;category;dueDate;priority;completed
Complete C++ project;Programming;2024-12-01;High;0
Buy groceries;Personal;2024-11-20;Medium;1
Study algorithms;Education;;Low;0
Field Descriptions:
title: Task description (required)category: Task category (optional, can be empty)dueDate: Due date in YYYY-MM-DD format (optional)priority: High/Medium/Low (optional)completed: 0 for pending, 1 for completed
sequenceDiagram
participant User
participant Main
participant TaskVector
participant FileSystem
User->>Main: Start Application
Main->>FileSystem: Load tasks.txt
FileSystem-->>TaskVector: Parse & populate tasks
loop Application Runtime
Main-->>User: Display Menu
User->>Main: Select option
alt Add Task
Main->>User: Request task details
User-->>Main: Provide title, category
Main->>TaskVector: Add new Task object
else View Tasks
Main->>TaskVector: Get all tasks
TaskVector-->>User: Display formatted list
else Mark Complete
User->>Main: Provide task number
Main->>TaskVector: Update task status
else Sort Tasks
User->>Main: Select sort criteria
Main->>TaskVector: Sort by priority/date/status
end
end
User->>Main: Exit (Option 4)
Main->>FileSystem: Save tasks.txt
FileSystem-->>User: Confirmation & exit
-
Basic Operations
- Add task with title only
- Add task with title and category
- View empty task list
- View populated task list
- Mark task as completed
- Try invalid task number
-
File Persistence
- Add tasks and restart app
- Verify tasks are loaded correctly
- Check tasks.txt file format
- Handle missing tasks.txt file
-
Edge Cases
- Empty title input
- Special characters in titles
- Very long task names
- Invalid menu choices
# Check if tasks.txt is created
ls -la tasks.txt
# View file contents
cat tasks.txt
# Verify file format
head -5 tasks.txtThe included Makefile provides these targets:
# Build the application (default target)
make
# Build specific object files
make main.o
make Task.o
# Clean all build artifacts
make clean
# Force rebuild
make clean && makeCompiler Flags Used:
-std=c++11: Use C++11 standard-Wall: Enable all common warnings-c: Compile without linking (for object files)
- ποΈ Enhanced Due Dates: Date validation and overdue notifications
- π Search & Filter: Find tasks by keyword, category, or status
- π Statistics: Task completion rates and productivity metrics
- π¨ Colored Output: Terminal colors for better visual distinction
- π± Export Options: JSON, CSV, and XML export formats
- π Data Encryption: Optional task data encryption
- β‘ Performance: Optimize for large task lists (1000+ tasks)
- π‘οΈ Error Handling: More robust file I/O error handling
- π§ͺ Unit Tests: Comprehensive test suite with assertions
- π Documentation: API documentation with Doxygen
# Clean build files
make clean
# Force rebuild everything
rm -f *.o todo_app && make
# Remove all generated files
make clean && rm -f tasks.txt
# Create backup of tasks
cp tasks.txt tasks_backup_$(date +%Y%m%d).txtWe welcome contributions! Here's how to get started:
# Fork and clone the repository
git clone https://github.com/musagithub1/To-do-list-manager-cpp.git
cd To-do-list-manager-cpp
# Create a feature branch
git checkout -b feature/your-feature-name
# Make your changes and test
make clean && make
./todo_app
# Run manual tests
# Add some tasks, restart app, verify persistence
# Commit your changes
git add .
git commit -m "Add: your feature description"
git push origin feature/your-feature-name- Follow existing code style and formatting
- Add comments for complex logic
- Test your changes thoroughly
- Update documentation if needed
- Keep commits focused and atomic
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with modern C++11 features and best practices
- Inspired by productivity tools and task management systems
- Thanks to the open-source community for continuous support
- Special recognition for clean code principles and maintainability
If you encounter any issues or have questions:
- Check the Issues: Look for existing solutions in GitHub Issues
- Create New Issue: Report bugs or request features
- Discussions: Join community discussions for help