Skip to content

Commit e75781f

Browse files
authored
Merge pull request #9 from wsjcpp/version-0.1.3
Version 0.1.3
2 parents 54d5f99 + be4da0c commit e75781f

30 files changed

+1357
-438
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# wsjcpp-yaml
22

3-
[![Build Status](https://api.travis-ci.com/wsjcpp/wsjcpp-yaml.svg?branch=master)](https://travis-ci.com/wsjcpp/wsjcpp-yaml) [![Github Stars](https://img.shields.io/github/stars/wsjcpp/wsjcpp-yaml.svg?label=github%20%E2%98%85)](https://github.com/wsjcpp/wsjcpp-yaml) [![Github Stars](https://img.shields.io/github/contributors/wsjcpp/wsjcpp-yaml.svg)](https://github.com/wsjcpp/wsjcpp-yaml) [![Github Forks](https://img.shields.io/github/forks/wsjcpp/wsjcpp-yaml.svg?label=github%20forks)](https://github.com/wsjcpp/wsjcpp-yaml/network/members)
3+
[![Build Status](https://api.travis-ci.com/wsjcpp/wsjcpp-yaml.svg?branch=master)](https://travis-ci.com/wsjcpp/wsjcpp-yaml) [![Github Stars](https://img.shields.io/github/stars/wsjcpp/wsjcpp-yaml.svg?label=github%20%E2%98%85)](https://github.com/wsjcpp/wsjcpp-yaml) [![Github Stars](https://img.shields.io/github/contributors/wsjcpp/wsjcpp-yaml.svg)](https://github.com/wsjcpp/wsjcpp-yaml) [![Github Forks](https://img.shields.io/github/forks/wsjcpp/wsjcpp-yaml.svg?label=github%20forks)](https://github.com/wsjcpp/wsjcpp-yaml/network/members) [![Total alerts](https://img.shields.io/lgtm/alerts/g/wsjcpp/wsjcpp-yaml.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/wsjcpp/wsjcpp-yaml/alerts/) [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/wsjcpp/wsjcpp-yaml.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/wsjcpp/wsjcpp-yaml/context:cpp)
44

55
C++ Write/Reader yaml files
66

src.wsjcpp/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
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.7
22
cmake_minimum_required(VERSION 3.0)
33

4-
add_definitions(-DWSJCPP_VERSION="v0.1.0")
5-
add_definitions(-DWSJCPP_NAME="wsjcpp-yaml")
4+
add_definitions(-DWSJCPP_APP_VERSION="v0.1.3")
5+
add_definitions(-DWSJCPP_APP_NAME="wsjcpp-yaml")
66

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

20-
# wsjcpp-core:v0.1.1
20+
# wsjcpp-core:v0.2.1
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")
Lines changed: 81 additions & 0 deletions
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
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/wsjcpp-safe-scripting
2+
3+
# log_info rootdir
4+
# log_info script_filename
5+
6+
make_dir "./unit-tests.wsjcpp"
7+
make_dir "./unit-tests.wsjcpp/src"
8+
9+
var class_name
10+
set_value class_name arg1
11+
normalize_class_name class_name
12+
13+
var filename_cpp
14+
set_value filename_cpp arg2
15+
16+
var content_source
17+
concat content_source "
18+
#include <wsjcpp_core.h>
19+
#include <wsjcpp_unit_tests.h>
20+
21+
// ---------------------------------------------------------------------
22+
// " class_name "
23+
24+
class " class_name " : public WsjcppUnitTestBase {
25+
public:
26+
" class_name "();
27+
virtual bool doBeforeTest() override;
28+
virtual void executeTest() override;
29+
virtual bool doAfterTest() override;
30+
};
31+
32+
REGISTRY_WSJCPP_UNIT_TEST(" class_name ")
33+
34+
" class_name "::" class_name "()
35+
: WsjcppUnitTestBase(\"" class_name "\") {
36+
}
37+
38+
// ---------------------------------------------------------------------
39+
40+
bool " class_name "::doBeforeTest() {
41+
// do something before test
42+
return true;
43+
}
44+
45+
// ---------------------------------------------------------------------
46+
47+
void " class_name "::executeTest() {
48+
compare(\"Not implemented\", true, false);
49+
// TODO unit test source code here
50+
}
51+
52+
// ---------------------------------------------------------------------
53+
54+
bool " class_name "::doAfterTest() {
55+
// do somethig after test
56+
return true;
57+
}
58+
59+
"
60+
61+
write_file filename_cpp content_source
62+
63+
log_info "
64+
======
65+
Generated class:
66+
- " class_name "
67+
Generated files:
68+
- " filename_cpp "
69+
======
70+
"

src.wsjcpp/wsjcpp_core/wsjcpp.hold.yml

Lines changed: 24 additions & 3 deletions
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.1
6+
version: v0.2.1
77
description: Basic Utils for wsjcpp
88
issues: https://github.com/wsjcpp/wsjcpp-core/issues
99
repositories:
@@ -21,25 +21,36 @@ distribution:
2121
- source-file: src/wsjcpp_core.cpp
2222
target-file: wsjcpp_core.cpp
2323
type: "source-code"
24+
sha1: "09ef821bbc090fc1cd8a15bc4a57a9a2ce8ae00d"
2425
- source-file: src/wsjcpp_core.h
2526
target-file: wsjcpp_core.h
2627
type: "source-code" # todo must be header-file
28+
sha1: "e6e4ab2067d3c942db08e3b79862486eaf851e4b"
2729
- source-file: "src/wsjcpp_unit_tests.cpp"
2830
target-file: "wsjcpp_unit_tests.cpp"
2931
type: "unit-tests"
32+
sha1: "fd5989d1a83c8b90bdc4d5e9bc9c3051eaa1e6d2"
3033
- source-file: "src/wsjcpp_unit_tests.h"
3134
target-file: "wsjcpp_unit_tests.h"
3235
type: "unit-tests"
36+
sha1: "83d4b6e046b6b58c42882ccae4be413e03c401c1"
3337
- source-file: "src/wsjcpp_unit_tests_main.cpp"
3438
target-file: "wsjcpp_unit_tests_main.cpp"
3539
type: "unit-tests"
40+
sha1: "388ae269b325c5e161f6c3a5c598575714a4bffc"
41+
- source-file: "scripts.wsjcpp/generate.WsjcppUnitTest.wsjcpp-script"
42+
target-file: "generate.WsjcppUnitTest.wsjcpp-script"
43+
type: "safe-scripting-generate"
44+
sha1: "a7c9c2d19bf81c5b00e659384b0b92a99319a4c1"
45+
- source-file: "scripts.wsjcpp/generate.Class.wsjcpp-script"
46+
target-file: "generate.Class.wsjcpp-script"
47+
type: "safe-scripting-generate"
48+
sha1: "de1799907c685d606b93e08b821b540c2faa2db1"
3649

3750
unit-tests:
3851
cases:
3952
- name: CoreNormalizePath
4053
description: Check function normalizePath
41-
- name: CoreUuid
42-
description: Check test generate uuid function
4354
- name: CoreExtractFilename
4455
description: Check function extract filenane from path
4556
- name: "ToUpper"
@@ -68,3 +79,13 @@ unit-tests:
6879
description: "Test join function"
6980
- name: "getHumanSizeBytes"
7081
description: "Test function get human size in bytes"
82+
- name: "TestResources"
83+
description: "Test basic resources"
84+
- name: "ListOfDirs"
85+
description: "Check list of directories"
86+
- name: "FilePermissions"
87+
description: ""
88+
- name: "StringPadding"
89+
description: ""
90+
- name: "DateTimeFormat"
91+
description: ""

0 commit comments

Comments
 (0)