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();
6363std::string sScriptFileName = "script_filename";
6464std::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
9494After 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
147147Example:
148148```
149- WSJCppSafeScriptingContext scriptContext;
149+ WsjcppSafeScriptingContext scriptContext;
150150
151151// variable
152- WSJCppSafeScriptingVariable *pVar = new WSJCppSafeScriptingVariable ("");
152+ WsjcppSafeScriptingVariable *pVar = new WsjcppSafeScriptingVariable ("");
153153scriptContext.addVar(pVar);
154154
155- WSJCppSafeScriptingProcYourClassName *pProc = new WSJCppSafeScriptingProcYourClassName ();
155+ WsjcppSafeScriptingProcYourClassName *pProc = new WsjcppSafeScriptingProcYourClassName ();
156156scriptContext.addProc(pProc);
157157
158158```
0 commit comments