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


C++ CsvReader::getColumnSize方法代码示例

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


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

示例1: load

	//--------------------------------------------------------------------------
	// MG_CN_MODIFY
	Bool ArtMapResCsv::load(const Char16* FileName, IMGExternalPackManager* packManager/* = NULL*/)
	{
		CsvReader csvreader;
		// MG_CN_MODIFY
		if(!csvreader.create(FileName, packManager))
		{
			return false;
		}

		DYNAMIC_ASSERT(csvreader.getColumnSize() == AMR_RPGRadarID + 1 || csvreader.getColumnSize() == AMR_Max);
		
		CsvData* csvdata = NULL;
		Int RowCount = csvreader.count();

		for(Int i = 0; i < RowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}

			ArtMapResIdType artMapResId;
			MGStrOp::toI32(csvdata->mData[AMR_ArtMapResId].c_str(), artMapResId);
			if (true == mArtMapResList.hasData(artMapResId))
			{
				DYNAMIC_ASSERT(0);
				continue;
			}

			ArtMapResCsvInfo* newArtMapRes = mArtMapResList.createOrRetrieve(artMapResId, false);
			newArtMapRes->artMapResId	= artMapResId;
			newArtMapRes->name			= csvdata->mData[AMR_Name];
			newArtMapRes->BaseFilePath	= csvdata->mData[AMR_BaseFilePath];
			//newArtMapRes->cameraId		= csvdata->mData[AMR_CameraSetID];

			MGStrOp::toI32(csvdata->mData[AMR_UseType].c_str(), (I32&)newArtMapRes->mapType);
			MGStrOp::toU32(csvdata->mData[AMR_RPGCamSetID].c_str(), newArtMapRes->rpgCameraId);
			MGStrOp::toU32(csvdata->mData[AMR_RPGRadarID].c_str(), newArtMapRes->rpgRadarId);

			if ( csvdata->mData.size() > AMR_RPGRadarID + 1 )
			{
				MGStrOp::toU32(csvdata->mData[AMR_SLGCamSetID].c_str(), newArtMapRes->slgCameraId);
				MGStrOp::toU32(csvdata->mData[AMR_SLGRadarID].c_str(), newArtMapRes->slgRadarId);
			}
			else
			{
				newArtMapRes->slgCameraId = newArtMapRes->rpgCameraId;
				newArtMapRes->slgRadarId = newArtMapRes->rpgRadarId;
			}
		}

		return true;
	}
开发者ID:dnjsflagh1,项目名称:code,代码行数:56,代码来源:ArtMapResCsv.cpp

示例2: load

	//--------------------------------------------------------------------------
	Bool InstanceAtkStrengthListCsv::load(const Char16* FileName, IMGExternalPackManager* packManager/* = NULL*/)
	{
		CsvReader csvreader;

		if(!csvreader.create(FileName, packManager))
		{
			return false;
		}

		DYNAMIC_ASSERT(csvreader.getColumnSize() == InstanceAtkStrengthListCsvRow_Max);

		CsvData* csvdata = NULL;
		Int RowCount = csvreader.count();

		for(Int i = 0; i < RowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}

			CampIdType campId;
			MGStrOp::toU64(csvdata->mData[InstanceAtkStrengthListCsvRow_CampId].c_str(), campId);
			if (true == mInstanceAtkStrengthList.hasData(campId))
			{
				DYNAMIC_ASSERT(0);
				continue;
			}

			U32 buildTemplateId;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_CharacterBuildId].c_str(), buildTemplateId);

			U32 campPoint;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_CampPointId].c_str(), campPoint);

			U32 generalRefreshPoint;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_GeneraRefreshpoint].c_str(), generalRefreshPoint);

			U32 generalAlivePoint;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_GeneraSpawnPoint].c_str(), generalAlivePoint);

			U32 armyPoint01;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_ArmyPlayedPoint01].c_str(), armyPoint01);

			U32 armyPoint02;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_ArmyPlayedPoint02].c_str(), armyPoint02);

			U32 armyPoint03;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_ArmyPlayedPoint03].c_str(), armyPoint03);

			U32 armyPoint04;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_ArmyPlayedPoint04].c_str(), armyPoint04);

			U32 armyPoint05;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_ArmyPlayedPoint05].c_str(), armyPoint05);

			InstanceAtkStrengthListCsvInfo* newInfo	= mInstanceAtkStrengthList.createOrRetrieve(campId, false);
			newInfo->campId					= campId;
			newInfo->buildTemplateId		= buildTemplateId;
			newInfo->campPoint				= campPoint;
			newInfo->generalRefreshPoint	= generalRefreshPoint;
			newInfo->generalAlivePoint		= generalAlivePoint;
			newInfo->armyPoint[0]			= armyPoint01;
			newInfo->armyPoint[1]			= armyPoint02;
			newInfo->armyPoint[2]			= armyPoint03;
			newInfo->armyPoint[3]			= armyPoint04;
			newInfo->armyPoint[4]			= armyPoint05;
		}

		return true;
	}
开发者ID:dnjsflagh1,项目名称:code,代码行数:73,代码来源:InstanceAtkStrengthListCsv.cpp


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