MCPcopy Create free account
hub / github.com/anjo76/angelscript / AddCode

Method AddCode

sdk/angelscript/source/as_builder.cpp:210–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208
209#ifndef AS_NO_COMPILER
210int asCBuilder::AddCode(const char *name, const char *code, int codeLength, int lineOffset, int sectionIdx, bool makeCopy)
211{
212 asCScriptCode *script = asNEW(asCScriptCode);
213 if( script == 0 )
214 return asOUT_OF_MEMORY;
215
216 int r = script->SetCode(name, code, codeLength, makeCopy);
217 if( r < 0 )
218 {
219 asDELETE(script, asCScriptCode);
220 return r;
221 }
222
223 script->lineOffset = lineOffset;
224 script->idx = sectionIdx;
225 scripts.PushLast(script);
226
227 return 0;
228}
229
230asCScriptCode *asCBuilder::FindOrAddCode(const char *name, const char *code, size_t length)
231{

Callers 15

CompileFunctionMethod · 0.45
CallDestructorMethod · 0.45
CompileStatementBlockMethod · 0.45
CompileGlobalVariableMethod · 0.45
CompileInitAsCopyMethod · 0.45
PrepareArgumentMethod · 0.45
PrepareFunctionCallMethod · 0.45
CompileInitializationMethod · 0.45

Calls 2

SetCodeMethod · 0.80
PushLastMethod · 0.80

Tested by

no test coverage detected