Coverage report for ai


src/
File: src/utils/DisplayHelp.cpp
Date: 2024-06-25 10:57:00
Lines:
0/12
0.0%
Functions:
0/2
0.0%
Branches:
0/28
0.0%

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