Skip to content

Commit f5d1af2

Browse files
committed
Updated wsjcpp-core to v0.1.0
1 parent a55fbf9 commit f5d1af2

24 files changed

+533
-416
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ addons:
1717
# Build steps
1818
script:
1919
- ./build_simple.sh
20-
- ./wsjcpp-safe-scripting scripts.wsjcpp/generate.WSJCppSafeScriptingProc TestProc
20+
- ./wsjcpp-safe-scripting scripts.wsjcpp/generate.WsjcppSafeScriptingProc TestProc
21+
- ./build_simple.sh
2122
- cd unit-tests.wsjcpp
2223
- ./build_simple.sh
2324
- ./unit-tests

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# wsjcpp-safe-scripting
22

3-
[![Build Status](https://api.travis-ci.org/wsjcpp/wsjcpp-safe-scripting.svg?branch=master)](https://travis-ci.org/wsjcpp/wsjcpp-safe-scripting) [![Github Stars](https://img.shields.io/github/stars/wsjcpp/wsjcpp-safe-scripting.svg?label=github%20%E2%98%85)](https://github.com/wsjcpp/wsjcpp-safe-scripting/stargazers) [![Github Stars](https://img.shields.io/github/contributors/wsjcpp/wsjcpp-safe-scripting.svg)](https://github.com/wsjcpp/wsjcpp-safe-scripting/) [![Github Forks](https://img.shields.io/github/forks/wsjcpp/wsjcpp-safe-scripting.svg?label=github%20forks)](https://github.com/wsjcpp/wsjcpp-safe-scripting/network/members)
3+
[![Build Status](https://api.travis-ci.com/wsjcpp/wsjcpp-safe-scripting.svg?branch=master)](https://travis-ci.com/wsjcpp/wsjcpp-safe-scripting) [![Github Stars](https://img.shields.io/github/stars/wsjcpp/wsjcpp-safe-scripting.svg?label=github%20%E2%98%85)](https://github.com/wsjcpp/wsjcpp-safe-scripting/stargazers) [![Github Stars](https://img.shields.io/github/contributors/wsjcpp/wsjcpp-safe-scripting.svg)](https://github.com/wsjcpp/wsjcpp-safe-scripting/) [![Github Forks](https://img.shields.io/github/forks/wsjcpp/wsjcpp-safe-scripting.svg?label=github%20forks)](https://github.com/wsjcpp/wsjcpp-safe-scripting/network/members)
44

55
* Light script language for integration to your project
66
* Script deny access read/write to out folders/files
@@ -57,9 +57,9 @@ Default procedures:
5757
5858
...
5959
60-
WSJCppSafeScriptingContext scriptContext;
60+
WsjcppSafeScriptingContext scriptContext;
6161
62-
std::string sCurrentDirectory = WSJCppCore::getCurrentDirectory();
62+
std::string sCurrentDirectory = WsjcppCore::getCurrentDirectory();
6363
std::string sScriptFileName = "script_filename";
6464
std::vector<std::string> vScriptArgs = {"Some1", "Some2"}; // script args: arg1, arg2
6565
@@ -88,7 +88,7 @@ if (nResult == 0) {
8888
### New procedures via wsjcpp
8989

9090
```
91-
wsjcpp generate WSJCppSafeScriptingProc YourClassName
91+
wsjcpp generate WsjcppSafeScriptingProc YourClassName
9292
```
9393

9494
After this will be generated files and added to your CMakeLists.txt:
@@ -110,10 +110,10 @@ header `src/wsjcpp_safe_scripting_proc_your_class_name.h`:
110110
111111
#include <wsjcpp_safe_scripting.h>
112112
113-
class WSJCppSafeScriptingProcYourClassName : public WSJCppSafeScriptingProc {
113+
class WsjcppSafeScriptingProcYourClassName : public WsjcppSafeScriptingProc {
114114
public:
115-
WSJCppSafeScriptingProcYourClassName();
116-
virtual bool exec(const std::vector<WSJCppSafeScriptingVariable *> &m_vArgs);
115+
WsjcppSafeScriptingProcYourClassName();
116+
virtual bool exec(const std::vector<WsjcppSafeScriptingVariable *> &m_vArgs);
117117
};
118118
119119
@@ -126,18 +126,18 @@ source-code `src/wsjcpp_safe_scripting_proc_your_class_name.cpp`:
126126
#include <wsjcpp_core.h>
127127
128128
// ---------------------------------------------------------------------
129-
// WSJCppSafeScriptingProcYourClassName
129+
// WsjcppSafeScriptingProcYourClassName
130130
131-
WSJCppSafeScriptingProcYourClassName::WSJCppSafeScriptingProcYourClassName()
132-
: WSJCppSafeScriptingProc("your_class_name") {
131+
WsjcppSafeScriptingProcYourClassName::WsjcppSafeScriptingProcYourClassName()
132+
: WsjcppSafeScriptingProc("your_class_name") {
133133
134134
}
135135
136136
// ---------------------------------------------------------------------
137137
138-
bool WSJCppSafeScriptingProcYourClassName::exec(const std::vector<WSJCppSafeScriptingVariable *> &vArgs) {
138+
bool WsjcppSafeScriptingProcYourClassName::exec(const std::vector<WsjcppSafeScriptingVariable *> &vArgs) {
139139
// you code here
140-
WSJCppLog::err(TAG, "Not implemented")
140+
WsjcppLog::err(TAG, "Not implemented")
141141
return false;
142142
}
143143
```
@@ -146,13 +146,13 @@ bool WSJCppSafeScriptingProcYourClassName::exec(const std::vector<WSJCppSafeScri
146146

147147
Example:
148148
```
149-
WSJCppSafeScriptingContext scriptContext;
149+
WsjcppSafeScriptingContext scriptContext;
150150
151151
// variable
152-
WSJCppSafeScriptingVariable *pVar = new WSJCppSafeScriptingVariable("");
152+
WsjcppSafeScriptingVariable *pVar = new WsjcppSafeScriptingVariable("");
153153
scriptContext.addVar(pVar);
154154
155-
WSJCppSafeScriptingProcYourClassName *pProc = new WSJCppSafeScriptingProcYourClassName();
155+
WsjcppSafeScriptingProcYourClassName *pProc = new WsjcppSafeScriptingProcYourClassName();
156156
scriptContext.addProc(pProc);
157157
158158
```

scripts.wsjcpp/generate.WSJCppSafeScriptingProc renamed to scripts.wsjcpp/generate.WsjcppSafeScriptingProc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ concat content_header "#ifndef " ifndef_header "
3636

3737
#include <wsjcpp_safe_scripting.h>
3838

39-
class " class_name " : public WSJCppSafeScriptingProc {
39+
class " class_name " : public WsjcppSafeScriptingProc {
4040
public:
4141
" class_name "();
42-
virtual bool exec(const std::vector<WSJCppSafeScriptingVariable *> &m_vArgs);
42+
virtual bool exec(const std::vector<WsjcppSafeScriptingVariable *> &m_vArgs);
4343
};
4444

4545
#endif // " ifndef_header
@@ -54,14 +54,14 @@ concat content_source "
5454
// " class_name "
5555

5656
" class_name "::" class_name "()
57-
: WSJCppSafeScriptingProc(\"" proc_name "\") {
57+
: WsjcppSafeScriptingProc(\"" proc_name "\") {
5858

5959
}
6060

6161
// ---------------------------------------------------------------------
6262

63-
bool " class_name "::exec(const std::vector<WSJCppSafeScriptingVariable *> &vArgs) {
64-
WSJCppLog::err(TAG, \"Not implemented\");
63+
bool " class_name "::exec(const std::vector<WsjcppSafeScriptingVariable *> &vArgs) {
64+
WsjcppLog::err(TAG, \"Not implemented\");
6565
return false;
6666
}
6767
"

src.wsjcpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.0.7
20+
# wsjcpp-core:v0.1.0
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")

src.wsjcpp/wsjcpp_core/wsjcpp.hold.yml

Lines changed: 7 additions & 6 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.0.7
6+
version: v0.1.0
77
description: Basic Utils for wsjcpp
88
issues: https://github.com/wsjcpp/wsjcpp-core/issues
99
repositories:
@@ -21,23 +21,18 @@ distribution:
2121
- source-file: src/wsjcpp_core.cpp
2222
target-file: wsjcpp_core.cpp
2323
type: "source-code"
24-
sha1: ""
2524
- source-file: src/wsjcpp_core.h
2625
target-file: wsjcpp_core.h
2726
type: "source-code" # todo must be header-file
28-
sha1: ""
2927
- source-file: "src/wsjcpp_unit_tests.cpp"
3028
target-file: "wsjcpp_unit_tests.cpp"
3129
type: "unit-tests"
32-
sha1: ""
3330
- source-file: "src/wsjcpp_unit_tests.h"
3431
target-file: "wsjcpp_unit_tests.h"
3532
type: "unit-tests"
36-
sha1: ""
3733
- source-file: "src/wsjcpp_unit_tests_main.cpp"
3834
target-file: "wsjcpp_unit_tests_main.cpp"
3935
type: "unit-tests"
40-
sha1: ""
4136

4237
unit-tests:
4338
cases:
@@ -67,3 +62,9 @@ unit-tests:
6762
description: "Test split function"
6863
- name: "CreateEmptyFile"
6964
description: "Test create empty file"
65+
- name: "ReadFileToBuffer"
66+
description: "test for readFileToBuffer"
67+
- name: "Join"
68+
description: "Test join function"
69+
- name: "getHumanSizeBytes"
70+
description: "Test function get human size in bytes"

0 commit comments

Comments
 (0)