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


C++ CObjRef::o_set方法代码示例

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


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

示例1: f_hphp_recursivedirectoryiterator___construct

bool f_hphp_recursivedirectoryiterator___construct(CObjRef obj, CStrRef path,
    int64_t flags) {
  SmartObject<RecursiveDirectoryIterator> rsrc =
    NEWOBJ(RecursiveDirectoryIterator)(path, flags);
  obj->o_set("rsrc", rsrc, "SplFileInfo");
  return !rsrc->m_dir.isNull();
}
开发者ID:JustProgrammer,项目名称:hiphop-php,代码行数:7,代码来源:ext_iterator.cpp

示例2: binary_deserialize_spec

void binary_deserialize_spec(CObjRef zthis, PHPInputTransport& transport,
                             CArrRef spec) {
  // SET and LIST have 'elem' => array('type', [optional] 'class')
  // MAP has 'val' => array('type', [optiona] 'class')
  while (true) {
    Variant val;

    int8_t ttype = transport.readI8();
    if (ttype == T_STOP) return;
    int16_t fieldno = transport.readI16();
    if (!(val = spec.rvalAt(fieldno)).isNull()) {
      Array fieldspec = val.toArray();
      // pull the field name
      // zend hash tables use the null at the end in the length... so strlen(hash key) + 1.
      String varname = fieldspec.rvalAt(PHPTransport::s_var).toString();

      // and the type
      int8_t expected_ttype = fieldspec.rvalAt(PHPTransport::s_type).toInt64();

      if (ttypes_are_compatible(ttype, expected_ttype)) {
        Variant rv = binary_deserialize(ttype, transport, fieldspec);
        zthis->o_set(varname, rv, zthis->o_getClassName());
      } else {
        skip_element(ttype, transport);
      }
    } else {
      skip_element(ttype, transport);
    }
  }
}
开发者ID:Halfnhav,项目名称:hiphop-php,代码行数:30,代码来源:binary.cpp

示例3: f_hphp_recursiveiteratoriterator___construct

Object f_hphp_recursiveiteratoriterator___construct(CObjRef obj, CObjRef iterator, int64_t mode, int64_t flags) {
  if (iterator->instanceof(SystemLib::s_RecursiveDirectoryIteratorClass)) {
    CVarRef rsrc = iterator->o_get("rsrc", true, "SplFileInfo");
    obj->o_set("rsrc", NEWOBJ(RecursiveIteratorIterator)(rsrc, mode, flags),
               "RecursiveIteratorIterator");
    return obj;
  }
  throw NotImplementedException("this type of iterator");
}
开发者ID:JustProgrammer,项目名称:hiphop-php,代码行数:9,代码来源:ext_iterator.cpp

示例4: f_hphp_set_property

void f_hphp_set_property(CObjRef obj, CStrRef cls, CStrRef prop,
                         CVarRef value) {
  obj->o_set(prop.data(), -1, value);
}
开发者ID:GunioRobot,项目名称:hiphop-php,代码行数:4,代码来源:ext_reflection.cpp

示例5: f_hphp_directoryiterator___construct

bool f_hphp_directoryiterator___construct(CObjRef obj, CStrRef path) {
  SmartObject<DirectoryIterator> rsrc = NEWOBJ(DirectoryIterator)(path);
  obj->o_set("rsrc", rsrc, "SplFileInfo");
  return !rsrc->m_dir.isNull();
}
开发者ID:JustProgrammer,项目名称:hiphop-php,代码行数:5,代码来源:ext_iterator.cpp

示例6: f_hphp_splfileobject___construct

Object f_hphp_splfileobject___construct(CObjRef obj, CStrRef filename, CStrRef open_mode, bool use_include_path, CVarRef context) {
  Variant f = f_fopen(filename, open_mode, use_include_path,
                      context.isNull() ? null_object : context.toObject());
  obj->o_set("rsrc", NEWOBJ(SplFileObject)(f), "SplFileInfo");
  return obj;
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:6,代码来源:ext_splfile.cpp


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