本文整理汇总了C++中CObjRef::o_get方法的典型用法代码示例。如果您正苦于以下问题:C++ CObjRef::o_get方法的具体用法?C++ CObjRef::o_get怎么用?C++ CObjRef::o_get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CObjRef
的用法示例。
在下文中一共展示了CObjRef::o_get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: binary_serialize_spec
void binary_serialize_spec(CObjRef zthis, PHPOutputTransport& transport,
CArrRef spec) {
for (ArrayIter key_ptr = spec.begin(); !key_ptr.end(); ++key_ptr) {
Variant key = key_ptr.first();
if (!key.isInteger()) {
throw_tprotocolexception("Bad keytype in TSPEC (expected 'long')", INVALID_DATA);
return;
}
unsigned long fieldno = key.toInt64();
Array fieldspec = key_ptr.second().toArray();
// field name
String varname = fieldspec.rvalAt(PHPTransport::s_var,
AccessFlags::Error_Key).toString();
// thrift type
int8_t ttype = fieldspec.rvalAt(PHPTransport::s_type,
AccessFlags::Error_Key).toByte();
Variant prop = zthis->o_get(varname, true, zthis->o_getClassName());
if (!prop.isNull()) {
transport.writeI8(ttype);
transport.writeI16(fieldno);
binary_serialize(ttype, transport, prop, fieldspec);
}
}
transport.writeI8(T_STOP); // struct end
}
示例2: 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");
}
示例3: f_hphp_get_property
Variant f_hphp_get_property(CObjRef obj, CStrRef cls, CStrRef prop) {
return obj->o_get(prop.data(), -1);
}