MCPcopy Create free account
hub / github.com/christophhart/HISE / mergeCallbacksToScript

Method mergeCallbacksToScript

hi_scripting/scripting/ScriptProcessor.cpp:2053–2079  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2051}
2052
2053void JavascriptProcessor::mergeCallbacksToScript(String &x, const String& sepString/*=String()*/) const
2054{
2055 for (int i = 0; i < getNumSnippets(); i++)
2056 {
2057 const SnippetDocument *s = getSnippet(i);
2058
2059 auto code = s->getSnippetAsFunction();
2060
2061 for (const auto& pf : preprocessorFunctions)
2062 pf(s->getCallbackName(), code);
2063
2064 if(usePreprocessorAtMerge)
2065 {
2066 if(auto e = const_cast<JavascriptProcessor*>(this)->getScriptEngine())
2067 {
2068 auto ok = e->preprocessor->process(code, s->getCallbackName().toString());
2069
2070 if(!ok.wasOk())
2071 throw ok;
2072
2073 jassert(ok.wasOk());
2074 }
2075 }
2076
2077 x << code << sepString;
2078 }
2079}
2080
2081bool JavascriptProcessor::parseSnippetsFromString(const String &x, bool clearUndoHistory /*= false*/)
2082{

Callers 3

collectAllScriptFilesMethod · 0.80
saveFileXmlMethod · 0.80
saveFileAsXmlMethod · 0.80

Calls 8

getSnippetFunction · 0.85
getSnippetAsFunctionMethod · 0.80
getScriptEngineMethod · 0.80
getNumSnippetsFunction · 0.70
getCallbackNameMethod · 0.45
processMethod · 0.45
toStringMethod · 0.45
wasOkMethod · 0.45

Tested by

no test coverage detected