-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e75646d
commit a737e14
Showing
9 changed files
with
183 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** R-Type | ||
** File description: | ||
** Console | ||
*/ | ||
|
||
#include "Console.hpp" | ||
#include "Exodia.hpp" | ||
|
||
namespace Exodia { | ||
|
||
///////////// | ||
// Methods // | ||
///////////// | ||
|
||
void Console::OnImGuiRender() | ||
{ | ||
ImGui::Begin("Console"); | ||
|
||
for (std::string &log : GetLogs()) | ||
ImGui::Text("%s", log.c_str()); | ||
|
||
ImGui::End(); | ||
} | ||
|
||
/////////////////////// | ||
// Getters & Setters // | ||
/////////////////////// | ||
|
||
std::vector<std::string> Console::GetLogs() | ||
{ | ||
LogHistory coreHistory = Log::GetCoreLoggerHistory(); | ||
std::vector <std::string> logs; | ||
|
||
for (const std::string &logFileName : coreHistory.GetLogs()) { | ||
std::ifstream logFile(logFileName); | ||
|
||
if (logFile.is_open()) { | ||
std::string line; | ||
|
||
while (std::getline(logFile, line)) | ||
logs.push_back(line); | ||
logFile.close(); | ||
} | ||
} | ||
|
||
return logs; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** R-Type | ||
** File description: | ||
** Console | ||
*/ | ||
|
||
#ifndef CONSOLE_HPP_ | ||
#define CONSOLE_HPP_ | ||
|
||
// External includes | ||
#include <vector> | ||
#include <string> | ||
|
||
namespace Exodia { | ||
|
||
class Console { | ||
|
||
////////////////////////////// | ||
// Constructor & Destructor // | ||
////////////////////////////// | ||
public: | ||
|
||
Console() = default; | ||
~Console() = default; | ||
|
||
///////////// | ||
// Methods // | ||
///////////// | ||
public: | ||
|
||
void OnImGuiRender(); | ||
|
||
/////////////////////// | ||
// Getters & Setters // | ||
/////////////////////// | ||
private: | ||
|
||
std::vector<std::string> GetLogs(); | ||
}; | ||
}; | ||
|
||
#endif /* !CONSOLE_HPP_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters