Skip to content

Commit 11db891

Browse files
committed
Init wsjcpp package
1 parent fd5b0d4 commit 11db891

21 files changed

+1757
-1
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
.wsjcpp/*
2+
tmp/*
3+
14
# Prerequisites
25
*.d
36

CMakeLists.txt

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
cmake_minimum_required(VERSION 3.0)
2+
3+
project(wsjcpp-obj-tree C CXX)
4+
5+
include(${CMAKE_CURRENT_SOURCE_DIR}/src.wsjcpp/CMakeLists.txt)
6+
7+
set(CMAKE_CXX_STANDARD 11)
8+
set(EXECUTABLE_OUTPUT_PATH ${wsjcpp-obj-tree_SOURCE_DIR})
9+
10+
# include header dirs
11+
list (APPEND WSJCPP_INCLUDE_DIRS "src")
12+
13+
list (APPEND WSJCPP_SOURCES "src/main.cpp")
14+
15+
#### BEGIN_WSJCPP_APPEND
16+
#### END_WSJCPP_APPEND
17+
18+
include_directories(${WSJCPP_INCLUDE_DIRS})
19+
20+
add_executable (wsjcpp-obj-tree ${WSJCPP_SOURCES})
21+
22+
target_link_libraries(wsjcpp-obj-tree ${WSJCPP_LIBRARIES})
23+
24+
install(
25+
TARGETS
26+
wsjcpp-obj-tree
27+
RUNTIME DESTINATION
28+
/usr/bin
29+
)
30+

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# wsjcpp-obj-tree
2-
multi type node tree
2+
Multi Object Tree

build_simple.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
if [ ! -d tmp ]; then
4+
mkdir -p tmp
5+
fi
6+
7+
cd tmp
8+
cmake ..
9+
make
10+

src.wsjcpp/.gitkeep

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

src.wsjcpp/CMakeLists.txt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Automaticly generated by [email protected]
2+
cmake_minimum_required(VERSION 3.0)
3+
4+
add_definitions(-DWSJCPP_APP_VERSION="v0.0.1")
5+
add_definitions(-DWSJCPP_APP_NAME="wsjcpp-obj-tree.git")
6+
7+
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
8+
set(MACOSX TRUE)
9+
endif()
10+
11+
set(CMAKE_CXX_STANDARD 11)
12+
13+
set (WSJCPP_LIBRARIES "")
14+
set (WSJCPP_INCLUDE_DIRS "")
15+
set (WSJCPP_SOURCES "")
16+
17+
find_package(Threads REQUIRED)
18+
list (APPEND WSJCPP_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
19+
20+
# wsjcpp-core:v0.1.7
21+
list (APPEND WSJCPP_INCLUDE_DIRS "./src.wsjcpp/wsjcpp_core/")
22+
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_core/wsjcpp_core.cpp")
23+
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")
26+
27+

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
+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
wsjcpp_version: v0.0.1
2+
cmake_cxx_standard: 11
3+
cmake_minimum_required: 3.0
4+
5+
name: wsjcpp-core
6+
version: v0.1.7
7+
description: Basic Utils for wsjcpp
8+
issues: https://github.com/wsjcpp/wsjcpp-core/issues
9+
repositories:
10+
- type: main
11+
url: "https://github.com/wsjcpp/wsjcpp-core"
12+
keywords:
13+
- c++
14+
- wsjcpp
15+
16+
authors:
17+
- name: Evgenii Sopov
18+
19+
20+
distribution:
21+
- source-file: src/wsjcpp_core.cpp
22+
target-file: wsjcpp_core.cpp
23+
type: "source-code"
24+
- source-file: src/wsjcpp_core.h
25+
target-file: wsjcpp_core.h
26+
type: "source-code" # todo must be header-file
27+
- source-file: "src/wsjcpp_unit_tests.cpp"
28+
target-file: "wsjcpp_unit_tests.cpp"
29+
type: "unit-tests"
30+
- source-file: "src/wsjcpp_unit_tests.h"
31+
target-file: "wsjcpp_unit_tests.h"
32+
type: "unit-tests"
33+
- source-file: "src/wsjcpp_unit_tests_main.cpp"
34+
target-file: "wsjcpp_unit_tests_main.cpp"
35+
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"
45+
46+
unit-tests:
47+
cases:
48+
- name: CoreNormalizePath
49+
description: Check function normalizePath
50+
- name: CoreExtractFilename
51+
description: Check function extract filenane from path
52+
- name: "ToUpper"
53+
description: "String to upper"
54+
- name: "CreateUuid"
55+
description: "Test generation uuids"
56+
- name: "GetEnv"
57+
description: "Test getEnv function"
58+
- name: "ToLower"
59+
description: "Test toLower"
60+
- name: "ReplaceAll"
61+
description: "Test replace all"
62+
- name: "DecodeUriComponent"
63+
description: "Check decoding"
64+
- name: "EncodeUriComponent"
65+
description: "Check encoding"
66+
- name: "Uint2HexString"
67+
description: "Test convert unsigned int to hex string"
68+
- name: "Split"
69+
description: "Test split function"
70+
- name: "CreateEmptyFile"
71+
description: "Test create empty file"
72+
- name: "ReadFileToBuffer"
73+
description: "test for readFileToBuffer"
74+
- name: "Join"
75+
description: "Test join function"
76+
- name: "getHumanSizeBytes"
77+
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)