当前位置: 首页>>代码示例>>C++>>正文


C++ File::writeByte方法代码示例

本文整理汇总了C++中common::File::writeByte方法的典型用法代码示例。如果您正苦于以下问题:C++ File::writeByte方法的具体用法?C++ File::writeByte怎么用?C++ File::writeByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common::File的用法示例。


在下文中一共展示了File::writeByte方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: writeResponseTree

void writeResponseTree() {
	outputFile.seek(dataOffset);

	const uint OFFSETS[3] = { 0x619520, 0x618340, 0x617380 };
	for (int idx = 0; idx < 1022; ++idx) {
		inputFile.seek(OFFSETS[_version] - FILE_DIFF[_version] + idx * 8);
		uint id = inputFile.readLong();
		uint offset = inputFile.readLong();

		outputFile.writeLong(id);
		if (!id) {
			// An end of list id
		} else if (offset >= OFFSETS[_version] && offset <= (OFFSETS[_version] + 0x1FF0)) {
			// Offset to another table
			outputFile.writeByte(0);
			outputFile.writeLong((offset - OFFSETS[_version]) / 8);
		} else {
			// Offset to ASCIIZ string
			outputFile.writeByte(1);
			writeString(offset);
		}
	}

	uint size = outputFile.size() - dataOffset;
	writeEntryHeader("TEXT/TREE", dataOffset, size);
	dataOffset += size;
}
开发者ID:,项目名称:,代码行数:27,代码来源:

示例2: writeString

void writeString(uint offset) {
	inputFile.seek(offset - FILE_DIFF[_version]);
	char c;
	do {
		c = inputFile.readByte();
		outputFile.writeByte(c);
	} while (c);
}
开发者ID:,项目名称:,代码行数:8,代码来源:

示例3: writeEmptyHeader

/*! \brief Write an empty header to the STK archive
 * \param stk STK/ITK archive file
 * \param chunkCount Number of chunks to be written in the archive file
 *
 * This function writes an empty header in the STK archive. This is required as
 * the header length is variable and depends on the number of chunks to be written
 * in the archive file.
 *
 * This header will be overwritten just before the end of the program execution
 */
void CompressGob::writeEmptyHeader(Common::File &stk, uint16 chunkCount) {
	for (uint32 count = 0; count < 2 + (uint32) (chunkCount * 22); count++)
		stk.writeByte(0);

	return;
}
开发者ID:CobaltBlues,项目名称:scummvm-tools,代码行数:16,代码来源:compress_gob.cpp


注:本文中的common::File::writeByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。