本文整理汇总了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;
}
示例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;
}