Skip to content

Commit

Permalink
Updated wsjcpp-core to v0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-kg committed Apr 15, 2020
1 parent 68c0b35 commit e0e4205
Show file tree
Hide file tree
Showing 24 changed files with 1,801 additions and 1,141 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
wsjcpp-storages
tmp/*
.wsjcpp/*

# Prerequisites
*.d
Expand Down
15 changes: 10 additions & 5 deletions src.wsjcpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.0)

add_definitions(-DWSJCPP_VERSION="v0.0.1")
add_definitions(-DWSJCPP_NAME="wsjcpp-levenshtein")
add_definitions(-DWSJCPP_NAME="wsjcpp-storages")

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(MACOSX TRUE)
Expand All @@ -14,10 +14,15 @@ set (WSJCPP_LIBRARIES "")
set (WSJCPP_INCLUDE_DIRS "")
set (WSJCPP_SOURCES "")

# wsjcpp/wsjcpp-core:v0.0.2
list (APPEND WSJCPP_INCLUDE_DIRS "./src.wsjcpp/wsjcpp_wsjcpp_core/")
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_wsjcpp_core/wsjcpp_core.cpp")
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_wsjcpp_core/wsjcpp_core.h")
find_package(Threads REQUIRED)
list (APPEND WSJCPP_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})

# wsjcpp-core:v0.1.4
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")

# required-libraries
list (APPEND WSJCPP_LIBRARIES "-lpthread")
Expand Down
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
81 changes: 81 additions & 0 deletions src.wsjcpp/wsjcpp_core/wsjcpp.hold.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
wsjcpp_version: v0.0.1
cmake_cxx_standard: 11
cmake_minimum_required: 3.0

name: wsjcpp-core
version: v0.1.4
description: Basic Utils for wsjcpp
issues: https://github.com/wsjcpp/wsjcpp-core/issues
repositories:
- type: main
url: "https://github.com/wsjcpp/wsjcpp-core"
keywords:
- c++
- wsjcpp

authors:
- name: Evgenii Sopov
email: mrseakg@gmail.com

distribution:
- source-file: src/wsjcpp_core.cpp
target-file: wsjcpp_core.cpp
type: "source-code"
- source-file: src/wsjcpp_core.h
target-file: wsjcpp_core.h
type: "source-code" # todo must be header-file
- source-file: "src/wsjcpp_unit_tests.cpp"
target-file: "wsjcpp_unit_tests.cpp"
type: "unit-tests"
- source-file: "src/wsjcpp_unit_tests.h"
target-file: "wsjcpp_unit_tests.h"
type: "unit-tests"
- source-file: "src/wsjcpp_unit_tests_main.cpp"
target-file: "wsjcpp_unit_tests_main.cpp"
type: "unit-tests"
- 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"
description: "String to upper"
- name: "CreateUuid"
description: "Test generation uuids"
- name: "GetEnv"
description: "Test getEnv function"
- name: "ToLower"
description: "Test toLower"
- name: "ReplaceAll"
description: "Test replace all"
- name: "DecodeUriComponent"
description: "Check decoding"
- name: "EncodeUriComponent"
description: "Check encoding"
- name: "Uint2HexString"
description: "Test convert unsigned int to hex string"
- name: "Split"
description: "Test split function"
- name: "CreateEmptyFile"
description: "Test create empty file"
- name: "ReadFileToBuffer"
description: "test for readFileToBuffer"
- name: "Join"
description: "Test join function"
- name: "getHumanSizeBytes"
description: "Test function get human size in bytes"
- name: "TestResources"
description: "Test basic resources"
Loading

0 comments on commit e0e4205

Please sign in to comment.