本文整理汇总了C++中tcpip::Storage::readChar方法的典型用法代码示例。如果您正苦于以下问题:C++ Storage::readChar方法的具体用法?C++ Storage::readChar怎么用?C++ Storage::readChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tcpip::Storage
的用法示例。
在下文中一共展示了Storage::readChar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: command_deserialize_length_error
//----------------------------------------------------------------------------
Command::Command(tcpip::Storage& storageP, size_t* sizeP)
//----------------------------------------------------------------------------
{
Storage();
m_is_data_written = false;
if (*sizeP >= 7) {
m_equipment_type = storageP.readChar();
m_equipment_id = storageP.readChar();
m_action = storageP.readChar();
m_object_type = storageP.readChar();
m_object_id = storageP.readChar();
this->writeChar(m_equipment_type);
this->writeChar(m_equipment_id);
this->writeChar(m_action);
this->writeChar(m_object_type);
this->writeChar(m_object_id);
unsigned short size = storageP.readShort();
this->writeShort(size);
*sizeP = *sizeP - 7;
if (size > 0) {
if (*sizeP >= size) {
for (int i = 0; i < size ; i++) {
this->writeChar(storageP.readChar());
}
} else {
throw command_deserialize_length_error();
}
*sizeP = *sizeP - size;
}
m_is_data_written = true;
} else {
throw command_deserialize_length_error();
}
}