本文整理汇总了C++中IODevice::write_int16方法的典型用法代码示例。如果您正苦于以下问题:C++ IODevice::write_int16方法的具体用法?C++ IODevice::write_int16怎么用?C++ IODevice::write_int16使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IODevice
的用法示例。
在下文中一共展示了IODevice::write_int16方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void Zip64EndOfCentralDirectoryRecord::save(IODevice &output)
{
output.write_int32(signature);
output.write_int64(size_of_record);
output.write_int16(version_made_by);
output.write_int16(version_needed_to_extract);
output.write_int32(number_of_this_disk);
output.write_int32(number_of_disk_with_central_directory_start);
output.write_int64(number_of_entries_on_this_disk);
output.write_int64(number_of_entries_in_central_directory);
output.write_int64(size_of_central_directory);
output.write_int64(offset_to_start_of_central_directory);
output.write(extensible_data_sector.data(), extensible_data_sector.size());
}
示例2: save
void ZipFileHeader::save(IODevice &output)
{
std::string str_filename;
std::string str_comment;
if (general_purpose_bit_flag & ZIP_USE_UTF8)
{
str_filename = StringHelp::text_to_utf8(filename);
str_comment = StringHelp::text_to_utf8(file_comment);
}
else
{
str_filename = StringHelp::text_to_cp437(filename);
str_comment = StringHelp::text_to_cp437(file_comment);
}
file_name_length = str_filename.length();
file_comment_length = str_comment.length();
output.write_int32(signature);
output.write_int16(version_made_by);
output.write_int16(version_needed_to_extract);
output.write_int16(general_purpose_bit_flag);
output.write_int16(compression_method);
output.write_int16(last_mod_file_time);
output.write_int16(last_mod_file_date);
output.write_uint32(crc32);
output.write_int32(compressed_size);
output.write_int32(uncompressed_size);
output.write_int16(file_name_length);
output.write_int16(extra_field_length);
output.write_int16(file_comment_length);
output.write_int16(disk_number_start);
output.write_int16(internal_file_attributes);
output.write_int32(external_file_attributes);
output.write_int32(relative_offset_of_local_header);
output.write(str_filename.data(), file_name_length);
output.write(extra_field.get_data(), extra_field_length);
output.write(file_comment.data(), file_comment_length);
}