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


C++ Stream::Deserialize方法代码示例

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


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

示例1:

	void IncludeFile::ReadVer81(Stream* stream)
	{
		Stream* includeFileStream = stream->Deserialize();

		includeFileStream->ReadTimestamp();
		includeFileStream->ReadDword();
		filename				= includeFileStream->ReadString();
		filepath				= includeFileStream->ReadString();
		originalFile			= includeFileStream->ReadBoolean();
		originalFileSize		= includeFileStream->ReadDword();
		
		if (includeFileStream->ReadBoolean())
			data = includeFileStream->Deserialize(false);
		else
			data = NULL;

		exportKind				= includeFileStream->ReadDword();
		exportPath				= includeFileStream->ReadString();
		overwrite				= includeFileStream->ReadBoolean();
		freeMemory				= includeFileStream->ReadBoolean();
		removeAtEndOfGame		= includeFileStream->ReadBoolean();

		delete includeFileStream;
	}
开发者ID:RobertBColton,项目名称:RadialGM,代码行数:24,代码来源:gmkincludefile.cpp

示例2:

	void Settings::ReadVer81(Stream* stream)
	{
		CleanMemory();

		Stream* settingsStream = stream->Deserialize();

		fullscreen				= settingsStream->ReadBoolean();
		interpolatePixels		= settingsStream->ReadBoolean();
		noBorder				= settingsStream->ReadBoolean();
		showCursor				= settingsStream->ReadBoolean();
		scale					= settingsStream->ReadDword();
		sizeable				= settingsStream->ReadBoolean();
		stayOnTop				= settingsStream->ReadBoolean();
		windowColor				= settingsStream->ReadDword();
		changeResolution		= settingsStream->ReadBoolean();
		colorDepth				= settingsStream->ReadDword();
		resolution				= settingsStream->ReadDword();
		frequency				= settingsStream->ReadDword();
		noButtons				= settingsStream->ReadBoolean();
		vsync					= settingsStream->ReadBoolean();
		noScreenSaver			= settingsStream->ReadBoolean();
		fullscreenKey			= settingsStream->ReadBoolean();
		helpKey					= settingsStream->ReadBoolean();
		quitKey					= settingsStream->ReadBoolean();
		saveKey					= settingsStream->ReadBoolean();
		screenshotKey			= settingsStream->ReadBoolean();
		closeSecondary			= settingsStream->ReadBoolean();
		priority				= settingsStream->ReadDword();
		freeze					= settingsStream->ReadBoolean();
		showProgress			= settingsStream->ReadDword();

		if (showProgress == LpbtCustom)
		{
			backImage = settingsStream->ReadBitmap();
			frontImage = settingsStream->ReadBitmap();
		}

		if (settingsStream->ReadBoolean())
			loadImage = settingsStream->ReadBitmap();

		loadTransparent			= settingsStream->ReadBoolean();
		loadAlpha				= settingsStream->ReadDword();
		scaleProgress			= settingsStream->ReadBoolean();

		iconImage				= settingsStream->Deserialize(false);

		displayErrors			= settingsStream->ReadBoolean();
		writeErrors				= settingsStream->ReadBoolean();
		abortErrors				= settingsStream->ReadBoolean();
		
		unsigned int errorFlags = settingsStream->ReadDword();

		treatUninitializedVariablesAsZero = (errorFlags & 0x01) == 0x01;
		argumentError = (errorFlags & 0x02) == 0x02;

		author					= settingsStream->ReadString();
		versionString			= settingsStream->ReadString();
		settingsStream->ReadTimestamp();
		information				= settingsStream->ReadString();

		major					= settingsStream->ReadDword();
		minor					= settingsStream->ReadDword();
		release					= settingsStream->ReadDword();
		build					= settingsStream->ReadDword();
		company					= settingsStream->ReadString();
		product					= settingsStream->ReadString();
		copyright				= settingsStream->ReadString();
		description				= settingsStream->ReadString();
		settingsStream->ReadTimestamp();

		delete settingsStream;
	}
开发者ID:DatZach,项目名称:Gmk,代码行数:72,代码来源:gmksettings.cpp


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