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

Method RegisterUsingNamespace

sdk/angelscript/source/as_builder.cpp:2258–2287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2256}
2257
2258int asCBuilder::RegisterUsingNamespace(asCScriptNode *node, asCScriptCode *file, asSNameSpace *ns)
2259{
2260 asCScriptNode* n = node->firstChild;
2261 asCString name(&file->code[n->tokenPos], n->tokenLength);
2262
2263 while (n->next)
2264 {
2265 n = n->next;
2266 name += "::" + asCString(&file->code[n->tokenPos], n->tokenLength);
2267 }
2268
2269 asSNameSpace* visibleNamespace = engine->AddNameSpace(name.AddressOf());
2270 asSMapNode<asSNameSpace*, asCArray<asSNameSpace*>>* cursor = 0;
2271
2272 if (namespaceVisibility.MoveTo(&cursor, ns))
2273 {
2274 asCArray<asSNameSpace*>& visibleNamespaces = namespaceVisibility.GetValue(cursor);
2275 if (!visibleNamespaces.Exists(visibleNamespace))
2276 namespaceVisibility.GetValue(cursor).PushLast(visibleNamespace);
2277 }
2278 else
2279 {
2280 asCArray<asSNameSpace*> tmp;
2281 tmp.PushLast(visibleNamespace);
2282 namespaceVisibility.Insert(ns, tmp);
2283 }
2284
2285 node->Destroy(engine);
2286 return 0;
2287}
2288
2289int asCBuilder::RegisterMixinClass(asCScriptNode *node, asCScriptCode *file, asSNameSpace *ns)
2290{

Callers

nothing calls this directly

Calls 9

asCStringClass · 0.85
AddNameSpaceMethod · 0.80
MoveToMethod · 0.80
PushLastMethod · 0.80
DestroyMethod · 0.80
AddressOfMethod · 0.45
GetValueMethod · 0.45
ExistsMethod · 0.45
InsertMethod · 0.45

Tested by

no test coverage detected