本文整理汇总了C++中PHPInputTransport::skip方法的典型用法代码示例。如果您正苦于以下问题:C++ PHPInputTransport::skip方法的具体用法?C++ PHPInputTransport::skip怎么用?C++ PHPInputTransport::skip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPInputTransport
的用法示例。
在下文中一共展示了PHPInputTransport::skip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: skip_element
void skip_element(long thrift_typeID, PHPInputTransport& transport) {
switch (thrift_typeID) {
case T_STOP:
case T_VOID:
return;
case T_STRUCT:
while (true) {
int8_t ttype = transport.readI8(); // get field type
if (ttype == T_STOP) break;
transport.skip(2); // skip field number, I16
skip_element(ttype, transport); // skip field payload
}
return;
case T_BOOL:
case T_BYTE:
transport.skip(1);
return;
case T_I16:
transport.skip(2);
return;
case T_I32:
case T_FLOAT:
transport.skip(4);
return;
case T_U64:
case T_I64:
case T_DOUBLE:
transport.skip(8);
return;
//case T_UTF7: // aliases T_STRING
case T_UTF8:
case T_UTF16:
case T_STRING: {
uint32_t len = transport.readU32();
transport.skip(len);
} return;
case T_MAP: {
int8_t keytype = transport.readI8();
int8_t valtype = transport.readI8();
uint32_t size = transport.readU32();
for (uint32_t i = 0; i < size; ++i) {
skip_element(keytype, transport);
skip_element(valtype, transport);
}
} return;
case T_LIST:
case T_SET: {
int8_t valtype = transport.readI8();
uint32_t size = transport.readU32();
for (uint32_t i = 0; i < size; ++i) {
skip_element(valtype, transport);
}
} return;
};
char errbuf[128];
sprintf(errbuf, "Unknown thrift typeID %ld", thrift_typeID);
throw_tprotocolexception(String(errbuf, CopyString), INVALID_DATA);
}