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

Method GetGlobalPropertyIndexByDecl

sdk/angelscript/source/as_scriptengine.cpp:2854–2880  ·  view source on GitHub ↗

interface

Source from the content-addressed store, hash-verified

2852
2853// interface
2854int asCScriptEngine::GetGlobalPropertyIndexByDecl(const char *decl) const
2855{
2856 // This const cast is OK. The builder won't modify the engine
2857 asCBuilder bld(const_cast<asCScriptEngine*>(this), 0);
2858
2859 // Don't write parser errors to the message callback
2860 bld.silent = true;
2861
2862 asCString name;
2863 asSNameSpace *ns;
2864 asCDataType dt;
2865 int r = bld.ParseVariableDeclaration(decl, defaultNamespace, name, ns, dt);
2866 if( r < 0 )
2867 return r;
2868
2869 // Search for a match
2870 while( ns )
2871 {
2872 int id = registeredGlobalProps.GetFirstIndex(ns, name, asCCompGlobPropType(dt));
2873 if( id >= 0 )
2874 return id;
2875
2876 ns = GetParentNameSpace(ns);
2877 }
2878
2879 return asNO_GLOBAL_VAR;
2880}
2881
2882// interface
2883int asCScriptEngine::RegisterObjectMethod(const char *obj, const char *declaration, const asSFuncPtr &funcPointer, asDWORD callConv, void *auxiliary, int compositeOffset, bool isCompositeIndirect)

Callers 1

test_namespace.cppFile · 0.80

Calls 3

asCCompGlobPropTypeClass · 0.85
GetFirstIndexMethod · 0.80

Tested by

no test coverage detected