-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated project structure^ added UI library
- Loading branch information
Showing
12 changed files
with
73 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
#include <iostream> | ||
|
||
#include "lib/mylib/MyClass.h" | ||
#include "lib/ui/ui_functions.hpp" | ||
|
||
int main() { | ||
MyClass printer(std::cout); | ||
printer.Print("Hello, World!\n"); | ||
return 0; | ||
int main(int32_t argc, char** argv) { | ||
std::vector<std::string> args = std::vector<std::string>(argv, argv + argc); | ||
return StartConsoleUI(args, std::cout); | ||
} |
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 |
---|---|---|
|
@@ -7,3 +7,4 @@ endif() | |
message(STATUS "Libraries build type: ${CMAKE_BUILD_TYPE}") | ||
|
||
add_subdirectory(mylib) | ||
add_subdirectory(ui) |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
add_library(mylib STATIC MyClass.cpp MyClass.h) | ||
add_library(mylib STATIC | ||
MyClass.cpp | ||
MyClass.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "MyClass.h" | ||
#include "MyClass.hpp" | ||
|
||
MyClass::MyClass(std::ostream& out) : out_(out) {} | ||
|
||
|
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,10 @@ | ||
add_library(ui STATIC | ||
ui_functions.cpp | ||
ui_functions.hpp | ||
) | ||
|
||
target_link_libraries(ui PUBLIC | ||
mylib | ||
) | ||
|
||
target_include_directories(ui PUBLIC ${PROJECT_SOURCE_DIR}) |
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,13 @@ | ||
#include "ui_functions.hpp" | ||
#include "lib/mylib/MyClass.hpp" | ||
|
||
int32_t StartConsoleUI(const std::vector<std::string>& args, std::ostream& out) { | ||
if (args.size() < 2) { | ||
out << "Insufficient arguments\n"; | ||
return 1; | ||
} | ||
|
||
MyClass printer(out); | ||
printer.Print("Hello, World!\n"); | ||
return 0; | ||
} |
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,9 @@ | ||
#ifndef UI_FUNCTIONS_HPP_ | ||
#define UI_FUNCTIONS_HPP_ | ||
|
||
#include <vector> | ||
#include <string> | ||
|
||
int32_t StartConsoleUI(const std::vector<std::string>& args, std::ostream& out); | ||
|
||
#endif //UI_FUNCTIONS_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