Exemplo n.º 1
0
Variant *AssocList::getPtr(CStrRef name) {
  for (VarAssocPair *vp = m_list; vp; vp = vp->m_next) {
    if (name.same(vp->name())) {
      return &vp->var();
    }
  }
  return NULL;
}
Exemplo n.º 2
0
Array AssocList::toArray() const {
  Array res = Array::Create();
  for (VarAssocPair *vp = m_head; vp; vp = vp->m_next) {
    if (vp->var().isInitialized() && vp->name() != "GLOBALS") {
      res.lval(vp->name()).setWithRef(vp->var());
    }
  }
  return res;
}
Exemplo n.º 3
0
bool AssocList::exists(CStrRef name, bool checkInit /* = false */) const {
  for (VarAssocPair *vp = m_list; vp; vp = vp->m_next) {
    if (name.same(vp->name())) {
      if (checkInit && !vp->var().isInitialized()) return false;
      return true;
    }
  }
  return false;
}