本文整理汇总了PHP中FileData::read方法的典型用法代码示例。如果您正苦于以下问题:PHP FileData::read方法的具体用法?PHP FileData::read怎么用?PHP FileData::read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileData
的用法示例。
在下文中一共展示了FileData::read方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: read
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::I32) {
$xfer += $input->readI32($this->pid);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->name);
} else {
$xfer += $input->skip($ftype);
}
break;
case 3:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->folder);
} else {
$xfer += $input->skip($ftype);
}
break;
case 4:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->site);
} else {
$xfer += $input->skip($ftype);
}
break;
case 5:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->password);
} else {
$xfer += $input->skip($ftype);
}
break;
case 6:
if ($ftype == TType::I32) {
$xfer += $input->readI32($this->dest);
} else {
$xfer += $input->skip($ftype);
}
break;
case 7:
if ($ftype == TType::I16) {
$xfer += $input->readI16($this->order);
} else {
$xfer += $input->skip($ftype);
}
break;
case 8:
if ($ftype == TType::BYTE) {
$xfer += $input->readByte($this->priority);
} else {
$xfer += $input->skip($ftype);
}
break;
case 9:
if ($ftype == TType::LST) {
$this->links = array();
$_size7 = 0;
$_etype10 = 0;
$xfer += $input->readListBegin($_etype10, $_size7);
for ($_i11 = 0; $_i11 < $_size7; ++$_i11) {
$elem12 = null;
$elem12 = new FileData();
$xfer += $elem12->read($input);
$this->links[] = $elem12;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}