REnvironmentObject *RObjectList::createTopLevelEnvironment (const QString &name) { RK_TRACE (OBJECTS); REnvironmentObject *envobj = new REnvironmentObject (this, name); envobj->updateFromR (update_chain); return envobj; }
REnvironmentObject* RObjectList::findPackage (const QString &namespacename) const { RK_TRACE (OBJECTS); for (int i = childmap.size () - 1; i >= 0; --i) { RObject* child = childmap[i]; if (!child->isType (PackageEnv)) continue; // Skip Autoloads REnvironmentObject* env = static_cast<REnvironmentObject *> (child); if (env->packageName () == namespacename) { return env; } } return 0; }
void RObjectList::createToplevelEnvironment (const QString &name) { RK_TRACE (OBJECTS); RK_ASSERT (childmap.find (name) == childmap.end ()); REnvironmentObject *envobj = new REnvironmentObject (this, name); if (name == ".GlobalEnv") { envobj->type |= GlobalEnv; } else if (name.contains (':')) { envobj->namespace_name = name.section (':', 1); } else if (name == "Autoloads") { envobj->type |= GlobalEnv; // this is wrong! but it's a temporary HACK to get things to work } addChild (envobj, name); RKGlobals::tracker ()->addObject (envobj, 0); envobj->updateFromR (); }