added print debug method
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 @@ | ||
| 21 | 21 | |
| 22 | 22 | using namespace ftxui; |
| 23 | 23 | |
| 24 | + | |
| 25 | +std::string version{ "v0.1.2" }; | |
| 24 | 26 | std::vector<Game> games; |
| 25 | 27 | |
| 26 | 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 | 30 | auto addGame(Database& database, std::string name, std::string path) -> void { |
| 35 | 31 | std::string command = |
| 36 | 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 | 81 | runGame(gameName); |
| 86 | 82 | } |
| 87 | 83 | else if (command == "--version") { |
| 88 | - std::cout << "fluffy v0.1.1" << std::endl; | |
| 84 | + std::cout << "fluffy " + version << std::endl; | |
| 89 | 85 | } |
| 90 | 86 | else if (command == "--help") { |
| 91 | 87 | std::cout << "fluffy commands:" << std::endl; |
| @@ -140,7 +136,7 @@ auto runConsoleApp() -> void { | ||
| 140 | 136 | }); |
| 141 | 137 | auto renderer = Renderer(container, [&] { |
| 142 | 138 | return vbox({ |
| 143 | - center(text(L" Fluffy v0.1.1 ")), | |
| 139 | + center(text("Fluffy " + version)), | |
| 144 | 140 | appContainer->Render(), |
| 145 | 141 | }) | |
| 146 | 142 | 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); |