I have a file a /path/to/my_js_functions.js that contains a Javascript function my_js_functions() , amongst other functions.(我有一个/path/to/my_js_functions.js文件,其中包含Javascript函数my_js_functions()和其他函数。)
How can I go about reading the function myJsFunction
as a String in C++ ?(如何在C ++中将函数myJsFunction
读取为字符串?)
I am looking for a way to get the whole function and only that function, and then contain it in a char *jsFunction
.(我正在寻找一种方法来获取整个函数和仅该函数,然后将其包含在char *jsFunction
。)
function myJsFunction(stringParam) {
return stringParam // The function returns a stringParam from the parameter
}
function anotherJsFunction(stringParam) {
return stringParam // Another function
}
Thank you all in advance.(谢谢大家。)
ask by Program-Me-Rev translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…