当前位置: 首页>>代码示例>>C++>>正文


C++ CArrRef::get方法代码示例

本文整理汇总了C++中CArrRef::get方法的典型用法代码示例。如果您正苦于以下问题:C++ CArrRef::get方法的具体用法?C++ CArrRef::get怎么用?C++ CArrRef::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CArrRef的用法示例。


在下文中一共展示了CArrRef::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: same

bool Array::same(CArrRef v2) const {
  if (m_px == NULL && v2.get() == NULL) return true;
  if (m_px && v2.get()) {
    return m_px->equal(v2.get(), true);
  }
  return false;
}
开发者ID:jmedrano,项目名称:hiphop-php,代码行数:7,代码来源:type_array.cpp

示例2: less

bool Array::less(CArrRef v2, bool flip /* = false */) const {
  if (m_px == NULL || v2.get() == NULL) {
    return HPHP::less(toBoolean(), v2.toBoolean());
  }
  if (flip) {
    return v2.get()->compare(m_px, false) > 0;
  }
  return m_px->compare(v2.get(), false) < 0;
}
开发者ID:Neomeng,项目名称:hiphop-php,代码行数:9,代码来源:type_array.cpp

示例3: more

bool Array::more(CArrRef v2, bool flip /* = true */) const {
  if (m_px == NULL || v2.get() == NULL) {
    return HPHP::more(toBoolean(), v2.toBoolean());
  }
  if (flip) {
    return v2.get()->compare(m_px) < 0;
  }
  return m_px->compare(v2.get()) > 0;
}
开发者ID:jmedrano,项目名称:hiphop-php,代码行数:9,代码来源:type_array.cpp

示例4: url_encode_array

static void url_encode_array(StringBuffer &ret, CArrRef arr,
                             std::set<void*> &seen_arrs,
                             CStrRef num_prefix, CStrRef key_prefix,
                             CStrRef key_suffix, CStrRef arg_sep) {
  if (seen_arrs.find((void*)arr.get()) != seen_arrs.end()) {
    return; // recursive
  }
  seen_arrs.insert((void*)arr.get());

  for (ArrayIter iter(arr); iter; ++iter) {
    Variant data = iter.second();
    if (data.isNull() || data.isResource()) continue;

    String key = iter.first();
    bool numeric = key.isNumeric();

    if (data.is(KindOfArray) || data.is(KindOfObject)) {
      String encoded;
      if (numeric) {
        encoded = key;
      } else {
        encoded = StringUtil::UrlEncode(key);
      }
      StringBuffer new_prefix(key_prefix.size() + num_prefix.size() +
                              encoded.size() + key_suffix.size() + 4);
      new_prefix += key_prefix;
      if (numeric) new_prefix += num_prefix;
      new_prefix += encoded;
      new_prefix += key_suffix;
      new_prefix += "%5B";
      url_encode_array(ret, data.toArray(), seen_arrs, String(), new_prefix,
                       String("%5D", AttachLiteral), arg_sep);
    } else {
      if (!ret.empty()) {
        ret += arg_sep;
      }
      ret += key_prefix;
      if (numeric) {
        ret += num_prefix;
        ret += key;
      } else {
        ret += StringUtil::UrlEncode(key);
      }
      ret += key_suffix;
      ret += "=";
      if (data.isInteger() || data.is(KindOfBoolean)) {
        ret += String(data.toInt64());
      } else if (data.is(KindOfDouble)) {
        ret += String(data.toDouble());
      } else {
        ret += StringUtil::UrlEncode(data.toString());
      }
    }
  }
}
开发者ID:edv4rd0,项目名称:hiphop-php,代码行数:55,代码来源:ext_url.cpp

示例5: begin

void ArrayIter::begin(CArrRef map, CStrRef context) {
    try {
        new (this) ArrayIter(map.get());
    } catch (...) {
        m_data = NULL;
        throw;
    }
}
开发者ID:gitlisted,项目名称:hiphop-php,代码行数:8,代码来源:array_iterator.cpp

示例6: ak_exist_int_obj

HOT_FUNC_VM
int64_t ak_exist_int_obj(ObjectData* obj, int64_t key) {
  if (obj->isCollection()) {
    return collectionOffsetContains(obj, key);
  }
  CArrRef arr = obj->o_toArray();
  bool res = arr.get()->exists(key);
  return res;
}
开发者ID:simplechen,项目名称:hiphop-php,代码行数:9,代码来源:translator-runtime.cpp

示例7: ak_exist_string_obj

HOT_FUNC_VM
int64_t ak_exist_string_obj(ObjectData* obj, StringData* key) {
  if (obj->isCollection()) {
    return collectionOffsetContains(obj, key);
  }
  CArrRef arr = obj->o_toArray();
  int64_t res = ak_exist_string_impl(arr.get(), key);
  return res;
}
开发者ID:simplechen,项目名称:hiphop-php,代码行数:9,代码来源:translator-runtime.cpp

示例8: f_print_arr

/* SRC: ../../util/helper.php line 3 */
void f_print_arr(CVarRef v_the_arr) {
    FUNCTION_INJECTION(print_arr);
    INTERCEPT_INJECTION("print_arr", (Array(ArrayInit(1, true).set(0, v_the_arr).create())), r);
    String v_to_print;
    Variant v_element;

    v_to_print = NAMSTR(s_ss00000000, "");
    {
        LOOP_COUNTER(1);
        for (ArrayIterPtr iter3 = v_the_arr.begin(null_string, true); !iter3->end(); iter3->next()) {
            LOOP_COUNTER_CHECK(1);
            iter3->second(v_element);
            {
                v_to_print = concat3(v_to_print, toString(v_element), NAMSTR(s_ss00000000_1, " "));
            }
        }
    }
    v_to_print = concat(v_to_print, NAMSTR(s_ss66d2232c, "\n"));
    print(v_to_print);
} /* function */
Variant i_print_arr(void *extra, CArrRef params) {
    int count __attribute__((__unused__)) = params.size();
    if (count < 1) throw_missing_arguments("print_arr", count+1);
    {
        ArrayData *ad(params.get());
        ssize_t pos = ad ? ad->iter_begin() : ArrayData::invalid_index;
        CVarRef arg0(count <= 0 ? null_variant : (ad->getValue(pos)));
        return (f_print_arr(arg0), null);
    }
}
开发者ID:mjacobsz,项目名称:Scriptie,代码行数:31,代码来源:helper.cpp

示例9: setArrayData

HOT_FUNC
ArrayIter::ArrayIter(CArrRef array) : m_pos(0) {
    const ArrayData* ad = array.get();
    setArrayData(ad);
    if (ad) {
        ad->incRefCount();
        m_pos = ad->iter_begin();
    } else {
        m_pos = ArrayData::invalid_index;
    }
}
开发者ID:gitlisted,项目名称:hiphop-php,代码行数:11,代码来源:array_iterator.cpp

示例10: i___construct

Variant c_Directory::i___construct(MethodCallPackage &mcp, CArrRef params) {
  if (UNLIKELY(mcp.obj == 0)) {
    return ObjectData::i_dummy(mcp, params, i___construct, coo_Directory);
  }
  c_Directory *self ATTRIBUTE_UNUSED (static_cast<c_Directory*>(mcp.obj));
  int count ATTRIBUTE_UNUSED = params.size();
  if (UNLIKELY(count != 1)) return throw_wrong_arguments("Directory::__construct", count, 1, 1, 2);
  {
    ArrayData *ad(params.get());
    ssize_t pos = ad ? ad->iter_begin() : ArrayData::invalid_index;
    CVarRef arg0((ad->getValue(pos)));
    return (self->t___construct(arg0), null);
  }
}
开发者ID:canerdogan,项目名称:hiphop-php,代码行数:14,代码来源:directory.cpp

示例11: write

void VariableSerializer::write(CArrRef v) {
  if (m_type == APCSerialize && !v.isNull() && v->isStatic()) {
    union {
      char buf[8];
      ArrayData *ad;
    } u;
    u.ad = v.get();
    m_buf->append("A:");
    m_buf->append(u.buf, 8);
    m_buf->append(';');
  } else {
    v.serialize(this);
  }
}
开发者ID:TitoAgudelo,项目名称:hiphop-php,代码行数:14,代码来源:variable_serializer.cpp

示例12: equal

bool Array::equal(CArrRef v2) const {
  if (m_px == NULL || v2.get() == NULL) {
    return HPHP::equal(toBoolean(), v2.toBoolean());
  }
  return m_px->equal(v2.get(), false);
}
开发者ID:jmedrano,项目名称:hiphop-php,代码行数:6,代码来源:type_array.cpp

示例13: less

bool String::less(CArrRef v2) const {
  if (m_px == NULL || v2.get() == NULL) {
    return HPHP::less(toBoolean(), v2.toBoolean());
  }
  return true;
}
开发者ID:yigithub,项目名称:hiphop-php,代码行数:6,代码来源:type_string.cpp

示例14: check_renamed_functions

void check_renamed_functions(CArrRef names) {
  g_vmContext->addRenameableFunctions(names.get());
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:3,代码来源:intercept.cpp

示例15: create

ArrayIter::ArrayIter(CArrRef array)
  : m_data(array.get()), m_pos(0) {
  create();
}
开发者ID:Neomeng,项目名称:hiphop-php,代码行数:4,代码来源:array_iterator.cpp


注:本文中的CArrRef::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。