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


C++ STRING_LIST::size方法代码示例

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


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

示例1: checkItemCount

bool Triggerconf::checkItemCount (STRING_LIST path, unsigned int items)
{
	if (path.size () != items) {
		
		char buf [16];

#ifdef WIN32
		ultoa (items, buf, 10);
#else
		snprintf (buf, 10, "%d", items);
#endif
		
		setError ("path " + untokenize (path) + " does not contain " + string(buf) + " items");
		return false;
	
	} else
		return true;
}
开发者ID:freshbob,项目名称:worms-attack,代码行数:18,代码来源:triggerconf.cpp

示例2: main

//-----------------------------------------------------------------------------
// Purpose: runs diff on all changed files in the date range
// Input  : argc - 
//			*argv[] - 
// Output : int
//-----------------------------------------------------------------------------
int main( int argc, char *argv[] )
{
	char tmpBuf[1024];

	if ( argc < 2 )
	{
		Error( "Incorrect usage\n" );
	}

	ArgsInit( argc, argv );
	const char *pSSDir = ArgsGet( "-ssdir", "\\\\jeeves\\vsscode" );

	sprintf( tmpBuf, "ssdir=%s", pSSDir );
	putenv( tmpBuf );

	const char *pSSProject = argv[argc-1];
	const char *pSSUser = ArgsGet( "-user", "Jay" );

	printf("Changes for %s\n", pSSUser );
	const char *pSSTmpFile = _tempnam( ".", "ssc" );

	const char *pRecurse = "";
	if ( ArgsExist( "-r" ) || ArgsExist( "-R" ) )
	{
		pRecurse = "-R";
	}

	const char *pDateRange = ArgsGet( "-vssdate", NULL );
	char dateBuf[128];

	if ( !pDateRange )
	{
		pDateRange = ArgsGet( "-weeks", "1" );
		int weeks = atoi( pDateRange );

		struct tm last, first;
		SetToday( &last );
		SetSunday( &last );
		SubtractWeeks( &last, &first, weeks );
		if ( ArgsExist( "-addcurrent" ) )
		{
			SetToday( &last );
		}
		string end = TmToString(last);
		string start = TmToString( first );
		sprintf( dateBuf, "%s~%s", &end[0], &start[0] );
		pDateRange = dateBuf;
		printf("From %s to %s\n", &start[0], &end[0] );
	}
	else
	{
		printf("Using custom vss date range: %s\n", pDateRange );
	}

	sprintf( tmpBuf, "history %s %s -vd%s -u%s >%s", pRecurse, pSSProject, pDateRange, pSSUser, pSSTmpFile );
	RunVSS( tmpBuf );

	STRING_LIST list = ParseHistory( pSSProject, pSSTmpFile );

	int totalLines = 0;
	for ( int i = 0; i < list.size(); i++ )
	{
		const char *pFileName = (const char *)&((list[i].file)[0]);
		sprintf( tmpBuf, "Diff -IEW %s -V%d~%d -DU >%s", pFileName, list[i].version-1, list[i].version, pSSTmpFile );
		RunVSS( tmpBuf );
		int linesChanged = CountDiffs( pSSTmpFile );
		printf( "Changed %-32s (ver %3d) \t%4d lines\n", pFileName, list[i].version, linesChanged );
		totalLines += linesChanged;
	}

	unlink( pSSTmpFile );
	printf( "\nTotal Files changed: %d\n", list.size() );
	printf( "Total Lines changed: %d\n\n", totalLines );
	return 0;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:81,代码来源:sscode.cpp


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