本文整理汇总了C++中IODevice::write_int32方法的典型用法代码示例。如果您正苦于以下问题:C++ IODevice::write_int32方法的具体用法?C++ IODevice::write_int32怎么用?C++ IODevice::write_int32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IODevice
的用法示例。
在下文中一共展示了IODevice::write_int32方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void Zip64EndOfCentralDirectoryLocator::save(IODevice &output)
{
output.write_int32(signature);
output.write_int32(number_of_disk_with_zip64_end_of_central_directory);
output.write_int64(relative_offset_of_zip64_end_of_central_directory);
output.write_int32(total_number_of_disks);
}
示例2:
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());
}
示例3: 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);
}
示例4: save
void CollisionOutline_Impl::save(IODevice &output_source) const
{
/* fileformat:
uint32 type // file type identifier
uint8 version // file version
uint32 width // width of the outline
uint32 height // height of the outline
float32 x-pos // of enclosing disc
float32 y-pos // of enclosing disc
float32 radius // of enclosing disc
uint32 num_contours
uint32 num_points contour 1
float32 px1
float32 py1
float32 px2
float32 py2
... contour 1 data ...
uint32 num_points contour 2
... contour 2 data ...
uint32 num_points contour N
... contour N data ...
*/
// file type identifier
output_source.write_uint32( 0x16082004 );
// fileformat version
output_source.write_uint8(1);
// width
output_source.write_int32(width);
// height
output_source.write_int32(height);
// x-pos of enclosing disc
output_source.write_float((float)minimum_enclosing_disc.position.x);
// y-pos of enclosing disc
output_source.write_float((float)minimum_enclosing_disc.position.y);
// radius of enclosing disc
output_source.write_float((float)minimum_enclosing_disc.radius);
// number of contours
output_source.write_uint32(contours.size());
std::vector<Contour>::const_iterator it_cont;
for( it_cont = contours.begin(); it_cont != contours.end(); ++it_cont )
{
// number of points in contours
output_source.write_uint32((*it_cont).get_points().size());
std::vector<Pointf>::const_iterator it;
for( it = (*it_cont).get_points().begin(); it != (*it_cont).get_points().end(); ++it )
{
// x,y of points
output_source.write_float((float)(*it).x);
output_source.write_float((float)(*it).y);
}
}
}