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

Method GetFunctionByName

sdk/angelscript/source/as_module.cpp:840–863  ·  view source on GitHub ↗

interface

Source from the content-addressed store, hash-verified

838
839// interface
840asIScriptFunction *asCModule::GetFunctionByName(const char *in_name) const
841{
842 asCString name;
843 asSNameSpace *ns = 0;
844 if( m_engine->DetermineNameAndNamespace(in_name, m_defaultNamespace, name, ns) < 0 )
845 return 0;
846
847 // Search recursively in the given namespace, moving up to parent namespace until the function is found
848 while( ns )
849 {
850 const asCArray<unsigned int> &idxs = m_globalFunctions.GetIndexes(ns, name);
851 if( idxs.GetLength() != 1 )
852 return 0;
853
854 const asIScriptFunction *func = m_globalFunctions.Get(idxs[0]);
855 if( func )
856 return const_cast<asIScriptFunction*>(func);
857
858 // Recursively search parent namespaces
859 ns = m_engine->GetParentNameSpace(ns);
860 }
861
862 return 0;
863}
864
865// interface
866asUINT asCModule::GetImportedFunctionCount() const

Callers 15

AddFunctionFunction · 0.80
DeleteFunctionFunction · 0.80
BuildMethod · 0.80
test_compiler.cppFile · 0.80
TestFunction · 0.80
Test1Function · 0.80
Test2Function · 0.80
TestOptimizeFunction · 0.80
test_condition.cppFile · 0.80
TestFunction · 0.80
test_debug.cppFile · 0.80
TestFunction · 0.80

Calls 4

GetParentNameSpaceMethod · 0.80
GetLengthMethod · 0.45
GetMethod · 0.45

Tested by 15

TestFunction · 0.64
Test1Function · 0.64
Test2Function · 0.64
TestOptimizeFunction · 0.64
TestFunction · 0.64
TestFunction · 0.64
TestFunction · 0.64
TestFunction · 0.64
TestFunction · 0.64
TestFunction · 0.64
TestCDecl_ClassFunction · 0.64
TestFunction · 0.64