interface
| 2852 | |
| 2853 | // interface |
| 2854 | int 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 |
| 2883 | int asCScriptEngine::RegisterObjectMethod(const char *obj, const char *declaration, const asSFuncPtr &funcPointer, asDWORD callConv, void *auxiliary, int compositeOffset, bool isCompositeIndirect) |
no test coverage detected