| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | ** EPITECH PROJECT, 2024 | ||
| 3 | ** zappy/utils | ||
| 4 | ** File description: | ||
| 5 | ** DisplayHelp.cpp | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <fstream> | ||
| 9 | #include <iostream> | ||
| 10 | #include "../constant/Constants.hpp" | ||
| 11 | |||
| 12 | ✗ | static void printFileContentError(const std::string &filePath) | |
| 13 | { | ||
| 14 | ✗ | std::ifstream file(filePath); | |
| 15 | |||
| 16 | ✗ | if (file.is_open()) | |
| 17 | { | ||
| 18 | std::string line; | ||
| 19 | |||
| 20 | ✗ | while (std::getline(file, line)) | |
| 21 | { | ||
| 22 | ✗ | std::cerr << line << '\n'; | |
| 23 | } | ||
| 24 | ✗ | file.close(); | |
| 25 | } | ||
| 26 | else | ||
| 27 | { | ||
| 28 | ✗ | std::string errorMsg = "Unable to open file: " + filePath + '\n'; | |
| 29 | ✗ | PRINT_ERROR(errorMsg); | |
| 30 | } | ||
| 31 | ✗ | } | |
| 32 | |||
| 33 | ✗ | void displayHelp() | |
| 34 | { | ||
| 35 | ✗ | printFileContentError("src/ai/assets/help.txt"); | |
| 36 | ✗ | } | |
| 37 |