juk3n/fluffypublic Fork
⑂ 190870d
Commits
⬇ Clone ▾
git clone https://git.rickub.com/juk3n/fluffy.git
git clone ssh://git@rickub.com/juk3n/fluffy.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

added print debug method

juk3n committed 2024-07-08T12:09:26+02:00 Browse files
190870d parent: 0b8c09e
modified app/include/output.hpp +11 -0
@@ -0,0 +1,11 @@
1+# pragma once
2+
3+#include <iostream>
4+#include <string>
5+
6+class Output {
7+public:
8+ auto printDebugMessage(std::string message) -> void {
9+ std::cout << message << std::endl;
10+ }
11+};
\ No newline at end of file
@@ -0,0 +1,11 @@
1+# pragma once
2+
3+#include <iostream>
4+#include <string>
5+
6+class Output {
7+public:
8+ auto printDebugMessage(std::string message) -> void {
9+ std::cout << message << std::endl;
10+ }
11+};
\ No newline at end of file\ No newline at end of file
modified app/src/main.cpp +4 -8
@@ -21,16 +21,12 @@
2121
2222 using namespace ftxui;
2323
24+
25+std::string version{ "v0.1.2" };
2426 std::vector<Game> games;
2527
2628 bool debugRun = false;
2729
28-auto printMessage(std::string message) -> void {
29- if (debugRun) {
30- std::cout << message << std::endl;
31- }
32-}
33-
3430 auto addGame(Database& database, std::string name, std::string path) -> void {
3531 std::string command =
3632 "INSERT INTO games (GAME_NAME, GAME_PATH) VALUES (";
@@ -85,7 +81,7 @@ auto handleCommand(const std::string& command, const std::vector<std::string>& a
8581 runGame(gameName);
8682 }
8783 else if (command == "--version") {
88- std::cout << "fluffy v0.1.1" << std::endl;
84+ std::cout << "fluffy " + version << std::endl;
8985 }
9086 else if (command == "--help") {
9187 std::cout << "fluffy commands:" << std::endl;
@@ -140,7 +136,7 @@ auto runConsoleApp() -> void {
140136 });
141137 auto renderer = Renderer(container, [&] {
142138 return vbox({
143- center(text(L" Fluffy v0.1.1 ")),
139+ center(text("Fluffy " + version)),
144140 appContainer->Render(),
145141 }) |
146142 border | size(WIDTH, LESS_THAN, 120);
@@ -21,16 +21,12 @@
21 21
22 using namespace ftxui;22 using namespace ftxui;
23 23
24+
25+std::string version{ "v0.1.2" };
24 std::vector<Game> games;26 std::vector<Game> games;
25 27
26 bool debugRun = false;28 bool debugRun = false;
27 29
28-auto printMessage(std::string message) -> void {
29- if (debugRun) {
30- std::cout << message << std::endl;
31- }
32-}
33-
34 auto addGame(Database& database, std::string name, std::string path) -> void {30 auto addGame(Database& database, std::string name, std::string path) -> void {
35 std::string command =31 std::string command =
36 "INSERT INTO games (GAME_NAME, GAME_PATH) VALUES (";32 "INSERT INTO games (GAME_NAME, GAME_PATH) VALUES (";
@@ -85,7 +81,7 @@ auto handleCommand(const std::string& command, const std::vector<std::string>& a
85 runGame(gameName);81 runGame(gameName);
86 }82 }
87 else if (command == "--version") {83 else if (command == "--version") {
88- std::cout << "fluffy v0.1.1" << std::endl;84+ std::cout << "fluffy " + version << std::endl;
89 }85 }
90 else if (command == "--help") {86 else if (command == "--help") {
91 std::cout << "fluffy commands:" << std::endl;87 std::cout << "fluffy commands:" << std::endl;
@@ -140,7 +136,7 @@ auto runConsoleApp() -> void {
140 });136 });
141 auto renderer = Renderer(container, [&] {137 auto renderer = Renderer(container, [&] {
142 return vbox({138 return vbox({
143- center(text(L" Fluffy v0.1.1 ")),139+ center(text("Fluffy " + version)),
144 appContainer->Render(),140 appContainer->Render(),
145 }) |141 }) |
146 border | size(WIDTH, LESS_THAN, 120);142 border | size(WIDTH, LESS_THAN, 120);