本文整理汇总了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();
}
示例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);
}
}
}
示例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");
}
示例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);
}
示例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();
}
示例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;
}