Skip to content

Commit

Permalink
Updated wsjcpp-core README.md and version to v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-kg committed Sep 18, 2020
1 parent 5f1252c commit 2ad4081
Show file tree
Hide file tree
Showing 17 changed files with 1,122 additions and 168 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# wsjcpp-print-tree

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

Helper class for print tree like a for filesystems

Expand Down
10 changes: 6 additions & 4 deletions src.wsjcpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Automaticly generated by wsjcpp@v0.0.1
# Automaticly generated by wsjcpp@v0.1.6
cmake_minimum_required(VERSION 3.0)

add_definitions(-DWSJCPP_VERSION="v0.1.0")
add_definitions(-DWSJCPP_NAME="wsjcpp-print-tree")
add_definitions(-DWSJCPP_APP_VERSION="v0.1.1")
add_definitions(-DWSJCPP_APP_NAME="wsjcpp-print-tree")

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(MACOSX TRUE)
Expand All @@ -17,9 +17,11 @@ set (WSJCPP_SOURCES "")
find_package(Threads REQUIRED)
list (APPEND WSJCPP_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})

# wsjcpp-core:v0.1.1
# wsjcpp-core:v0.2.0
list (APPEND WSJCPP_INCLUDE_DIRS "./src.wsjcpp/wsjcpp_core/")
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_core/wsjcpp_core.cpp")
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_core/wsjcpp_core.h")
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_core/wsjcpp_resources_manager.h")
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_core/wsjcpp_resources_manager.cpp")


81 changes: 81 additions & 0 deletions src.wsjcpp/wsjcpp_core/generate.Class
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/usr/bin/wsjcpp-safe-scripting

# log_info rootdir
# log_info script_filename

make_dir "src"

var user_class_name
set_value user_class_name arg1
normalize_class_name user_class_name
convert_CamelCase_to_snake_case user_class_name user_class_name

var class_name
set_value class_name arg1
normalize_class_name class_name

var base_filename
convert_CamelCase_to_snake_case class_name base_filename
# log_info base_filename

var filename_cpp
concat filename_cpp "./src/" base_filename ".cpp"

var filename_h
concat filename_h "./src/" base_filename ".h"

var ifndef_header
set_value ifndef_header base_filename
concat ifndef_header "_H"

to_upper_case ifndef_header

var content_header
concat content_header "#ifndef " ifndef_header "
#define " ifndef_header "

#include <string>

class " class_name " {
public:
" class_name "();

private:
std::string TAG;
};

#endif // " ifndef_header


var content_source
concat content_source "
#include \"" base_filename ".h\"
#include <wsjcpp_core.h>

// ---------------------------------------------------------------------
// " class_name "

" class_name "::" class_name "() {
TAG = \"" class_name "\";
}

"

var file_source
concat file_source "src/" filename_cpp

write_file filename_h content_header
write_file filename_cpp content_source

log_info "
======
Generated class:
- " class_name "
Generated files:
- " filename_h "
- " filename_cpp "
======
"

cmakelists_txt_append_wsjcpp filename_h
cmakelists_txt_append_wsjcpp filename_cpp
103 changes: 103 additions & 0 deletions src.wsjcpp/wsjcpp_core/generate.WsjcppUnitTest
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/usr/bin/wsjcpp-safe-scripting

# log_info rootdir
# log_info script_filename

make_dir "./unit-tests.wsjcpp"
make_dir "./unit-tests.wsjcpp/src"

var user_class_name
set_value user_class_name arg1
normalize_class_name user_class_name
var class_name
set_value class_name "UnitTest"
concat class_name user_class_name

var base_filename
convert_CamelCase_to_snake_case class_name base_filename
# log_info base_filename

var filename_cpp
concat filename_cpp "./unit-tests.wsjcpp/src/" base_filename ".cpp"

var filename_h
concat filename_h "./unit-tests.wsjcpp/src/" base_filename ".h"

var ifndef_header
set_value ifndef_header base_filename
concat ifndef_header "_H"

to_upper_case ifndef_header

var content_header
concat content_header "#ifndef " ifndef_header "
#define " ifndef_header "

#include <wsjcpp_unit_tests.h>

class " class_name " : public WsjcppUnitTestBase {
public:
" class_name "();
virtual bool doBeforeTest() override;
virtual void executeTest() override;
virtual bool doAfterTest() override;
};

#endif // " ifndef_header


var content_source
concat content_source "
#include \"" base_filename ".h\"
#include <wsjcpp_core.h>

// ---------------------------------------------------------------------
// " class_name "

REGISTRY_WSJCPP_UNIT_TEST(" class_name ")

" class_name "::" class_name "()
: WsjcppUnitTestBase(\"" class_name "\") {
}

// ---------------------------------------------------------------------

bool " class_name "::doBeforeTest() {
// nothing
return true;
}

// ---------------------------------------------------------------------

void " class_name "::executeTest() {
compare(\"Not implemented\", true, false);
// TODO unit test source code here
}

// ---------------------------------------------------------------------

bool " class_name "::doAfterTest() {
// nothing
return true;
}

"

var file_source
concat file_source "src/" filename_cpp

write_file filename_h content_header
write_file filename_cpp content_source

log_info "
======
Generated class:
- " class_name "
Generated files:
- " filename_h "
- " filename_cpp "
======
"

wsjcpp_yml_unit_test_add user_class_name filename_h
wsjcpp_yml_unit_test_add user_class_name filename_cpp
26 changes: 23 additions & 3 deletions src.wsjcpp/wsjcpp_core/wsjcpp.hold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_cxx_standard: 11
cmake_minimum_required: 3.0

name: wsjcpp-core
version: v0.1.1
version: v0.2.0
description: Basic Utils for wsjcpp
issues: https://github.com/wsjcpp/wsjcpp-core/issues
repositories:
Expand Down Expand Up @@ -33,13 +33,23 @@ distribution:
- source-file: "src/wsjcpp_unit_tests_main.cpp"
target-file: "wsjcpp_unit_tests_main.cpp"
type: "unit-tests"
- source-file: "scripts.wsjcpp/generate.WsjcppUnitTest"
target-file: "generate.WsjcppUnitTest"
type: "safe-scripting-generate"
- source-file: "scripts.wsjcpp/generate.Class"
target-file: "generate.Class"
type: "safe-scripting-generate"
- source-file: "src/wsjcpp_resources_manager.h"
target-file: "wsjcpp_resources_manager.h"
type: "source-code"
- source-file: "src/wsjcpp_resources_manager.cpp"
target-file: "wsjcpp_resources_manager.cpp"
type: "source-code"

unit-tests:
cases:
- name: CoreNormalizePath
description: Check function normalizePath
- name: CoreUuid
description: Check test generate uuid function
- name: CoreExtractFilename
description: Check function extract filenane from path
- name: "ToUpper"
Expand Down Expand Up @@ -68,3 +78,13 @@ unit-tests:
description: "Test join function"
- name: "getHumanSizeBytes"
description: "Test function get human size in bytes"
- name: "TestResources"
description: "Test basic resources"
- name: "ListOfDirs"
description: "Check list of directories"
- name: "FilePermissions"
description: ""
- name: "StringPadding"
description: ""
- name: "DateTimeFormat"
description: ""
Loading

0 comments on commit 2ad4081

Please sign in to comment.