-
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.
-added header and source generation mode;
-changed command line interface; -set version to 2.0.0;
- Loading branch information
1 parent
37edf65
commit 6eb4e2a
Showing
20 changed files
with
666 additions
and
116 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
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,4 +1,4 @@ | ||
#include "todolist.h" | ||
#include "template/todolist.h" | ||
#include <string> | ||
#include <vector> | ||
|
||
|
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,20 @@ | ||
cmake_minimum_required(VERSION 3.18) | ||
project(ex_06) | ||
|
||
include(../../hypertextcpp.cmake) | ||
|
||
hypertextcpp_GenerateHeaderAndSource( | ||
TEMPLATE_FILE todolist.htcpp | ||
CLASS_NAME TodoList | ||
CONFIG_CLASS_NAME PageParams) | ||
|
||
set(SRC | ||
todolist_printer.cpp | ||
todolist.h | ||
todolist.cpp) | ||
|
||
add_executable(${PROJECT_NAME} ${SRC}) | ||
|
||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) | ||
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF) | ||
|
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,24 @@ | ||
#{ | ||
#include <vector> | ||
struct PageParams{ | ||
struct Task{ | ||
std::string name; | ||
bool isCompleted = false; | ||
}; | ||
std::string name = "Bob"; | ||
std::vector<Task> tasks = {{"laundry", true}, {"cooking", false}}; | ||
}; | ||
} | ||
|
||
#taskList(){ | ||
<li [[style="text-decoration: line-through;"]]?(task.isCompleted)>$(task.name)</li>@(auto task : cfg.tasks) | ||
} | ||
<html> | ||
<body> | ||
<h1>$(cfg.name)'s todo list:</h1> | ||
<p> No tasks found </p>?(cfg.tasks.empty()) | ||
<ul> | ||
$(taskList()) | ||
</ul> | ||
</body> | ||
</html> |
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,11 @@ | ||
#include "todolist.h" | ||
#include <string> | ||
#include <vector> | ||
|
||
int main() | ||
{ | ||
PageParams pageParams; | ||
auto page = TodoList{}; | ||
page.print(pageParams); | ||
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,20 @@ | ||
cmake_minimum_required(VERSION 3.18) | ||
project(ex_07) | ||
|
||
include(../../hypertextcpp.cmake) | ||
|
||
hypertextcpp_GenerateHeaderAndSource( | ||
TEMPLATE_FILE todolist.htcpp | ||
CLASS_NAME TodoList | ||
CONFIG_CLASS_NAME PageParams) | ||
|
||
set(SRC | ||
todolist_printer.cpp | ||
todolist.h | ||
todolist.cpp) | ||
|
||
add_executable(${PROJECT_NAME} ${SRC}) | ||
|
||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) | ||
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF) | ||
|
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,12 @@ | ||
#pragma once | ||
#include <string> | ||
#include <vector> | ||
|
||
struct PageParams{ | ||
struct Task{ | ||
std::string name; | ||
bool isCompleted = false; | ||
}; | ||
std::string name = "Bob"; | ||
std::vector<Task> tasks = {{"laundry", true}, {"cooking", false}}; | ||
}; |
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,16 @@ | ||
#{ | ||
#include "pageparams.h" | ||
} | ||
|
||
#taskList(){ | ||
<li [[style="text-decoration: line-through;"]]?(task.isCompleted)>$(task.name)</li>@(auto task : cfg.tasks) | ||
} | ||
<html> | ||
<body> | ||
<h1>$(cfg.name)'s todo list:</h1> | ||
<p> No tasks found </p>?(cfg.tasks.empty()) | ||
<ul> | ||
$(taskList()) | ||
</ul> | ||
</body> | ||
</html> |
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,11 @@ | ||
#include "todolist.h" | ||
#include <string> | ||
#include <vector> | ||
|
||
int main() | ||
{ | ||
PageParams pageParams; | ||
auto page = TodoList{}; | ||
page.print(pageParams); | ||
return 0; | ||
} |
Oops, something went wrong.