Skip to content

Commit 95d83cb

Browse files
committed
Updated wsjcpp-core to v0.1.7
1 parent 8d4e33d commit 95d83cb

11 files changed

+492
-94
lines changed

src.wsjcpp/CMakeLists.txt

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Automaticly generated by wsjcpp@v0.0.1
1+
# Automaticly generated by wsjcpp@v0.1.5
22
cmake_minimum_required(VERSION 3.0)
33

4-
add_definitions(-DWSJCPP_VERSION="v0.0.1")
5-
add_definitions(-DWSJCPP_NAME="wsjcpp-docker-api")
4+
add_definitions(-DWSJCPP_APP_VERSION="v0.0.1")
5+
add_definitions(-DWSJCPP_APP_NAME="wsjcpp-docker-api")
66

77
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
88
set(MACOSX TRUE)
@@ -17,10 +17,12 @@ set (WSJCPP_SOURCES "")
1717
find_package(Threads REQUIRED)
1818
list (APPEND WSJCPP_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
1919

20-
# wsjcpp-core:v0.1.0
20+
# wsjcpp-core:v0.1.7
2121
list (APPEND WSJCPP_INCLUDE_DIRS "./src.wsjcpp/wsjcpp_core/")
2222
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_core/wsjcpp_core.cpp")
2323
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_core/wsjcpp_core.h")
24+
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_core/wsjcpp_resources_manager.h")
25+
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_core/wsjcpp_resources_manager.cpp")
2426

2527
# nlohmann/json:v3.7.3
2628
list (APPEND WSJCPP_INCLUDE_DIRS "./src.wsjcpp/nlohmann_json/")

src.wsjcpp/wsjcpp_core/generate.Class

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/usr/bin/wsjcpp-safe-scripting
2+
3+
# log_info rootdir
4+
# log_info script_filename
5+
6+
make_dir "src"
7+
8+
var user_class_name
9+
set_value user_class_name arg1
10+
normalize_class_name user_class_name
11+
convert_CamelCase_to_snake_case user_class_name user_class_name
12+
13+
var class_name
14+
set_value class_name arg1
15+
normalize_class_name class_name
16+
17+
var base_filename
18+
convert_CamelCase_to_snake_case class_name base_filename
19+
# log_info base_filename
20+
21+
var filename_cpp
22+
concat filename_cpp "./src/" base_filename ".cpp"
23+
24+
var filename_h
25+
concat filename_h "./src/" base_filename ".h"
26+
27+
var ifndef_header
28+
set_value ifndef_header base_filename
29+
concat ifndef_header "_H"
30+
31+
to_upper_case ifndef_header
32+
33+
var content_header
34+
concat content_header "#ifndef " ifndef_header "
35+
#define " ifndef_header "
36+
37+
#include <string>
38+
39+
class " class_name " {
40+
public:
41+
" class_name "();
42+
43+
private:
44+
std::string TAG;
45+
};
46+
47+
#endif // " ifndef_header
48+
49+
50+
var content_source
51+
concat content_source "
52+
#include \"" base_filename ".h\"
53+
#include <wsjcpp_core.h>
54+
55+
// ---------------------------------------------------------------------
56+
// " class_name "
57+
58+
" class_name "::" class_name "() {
59+
TAG = \"" class_name "\";
60+
}
61+
62+
"
63+
64+
var file_source
65+
concat file_source "src/" filename_cpp
66+
67+
write_file filename_h content_header
68+
write_file filename_cpp content_source
69+
70+
log_info "
71+
======
72+
Generated class:
73+
- " class_name "
74+
Generated files:
75+
- " filename_h "
76+
- " filename_cpp "
77+
======
78+
"
79+
80+
cmakelists_txt_append_wsjcpp filename_h
81+
cmakelists_txt_append_wsjcpp filename_cpp

src.wsjcpp/wsjcpp_core/wsjcpp.hold.yml

+14-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_cxx_standard: 11
33
cmake_minimum_required: 3.0
44

55
name: wsjcpp-core
6-
version: v0.1.0
6+
version: v0.1.7
77
description: Basic Utils for wsjcpp
88
issues: https://github.com/wsjcpp/wsjcpp-core/issues
99
repositories:
@@ -33,13 +33,20 @@ distribution:
3333
- source-file: "src/wsjcpp_unit_tests_main.cpp"
3434
target-file: "wsjcpp_unit_tests_main.cpp"
3535
type: "unit-tests"
36+
- source-file: "scripts.wsjcpp/generate.Class"
37+
target-file: "generate.Class"
38+
type: "safe-scripting-generate"
39+
- source-file: "src/wsjcpp_resources_manager.h"
40+
target-file: "wsjcpp_resources_manager.h"
41+
type: "source-code"
42+
- source-file: "src/wsjcpp_resources_manager.cpp"
43+
target-file: "wsjcpp_resources_manager.cpp"
44+
type: "source-code"
3645

3746
unit-tests:
3847
cases:
3948
- name: CoreNormalizePath
4049
description: Check function normalizePath
41-
- name: CoreUuid
42-
description: Check test generate uuid function
4350
- name: CoreExtractFilename
4451
description: Check function extract filenane from path
4552
- name: "ToUpper"
@@ -68,3 +75,7 @@ unit-tests:
6875
description: "Test join function"
6976
- name: "getHumanSizeBytes"
7077
description: "Test function get human size in bytes"
78+
- name: "TestResources"
79+
description: "Test basic resources"
80+
- name: "ListOfDirs"
81+
description: "Check list of directories"

0 commit comments

Comments
 (0)