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


C++ Sequence::addLast方法代码示例

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


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

示例1: isMethodCall

static bool isMethodCall( SourceTokenizer& tokenizer )
{
	bool ret = false;
	Sequence<SourceToken> tokens;
	
	tokens.addLast( tokenizer.nextToken() );
	
	bool loop = true;
	while ( loop && tokenizer.hasMoreTokens() )
	{
		SourceToken*           token = tokenizer.nextToken();
		const String&          value = token->getValue();
		SourceToken::TokenType type  = token->getTokenType();
		
		switch ( type )
		{
		case SourceToken::WORD:
		case SourceToken::SPACE:
			break;

		case SourceToken::STARTEXPRESSION:
			ret  = true;
			loop = false;
			break;

		case SourceToken::INFIXOP:
			if ( ! (value.contentEquals( "<" ) || value.contentEquals( ">" )) ) loop = false;
			break;
			
		case SourceToken::SYMBOL:
			if ( !value.contentEquals( "," ) ) loop = false;
			break;
		
		default:
			loop = false;
		}
		tokens.addLast( token );
	}
	
	pushbackTokens( tokenizer, tokens );

	return ret;
}
开发者ID:danielbradley,项目名称:Astral,代码行数:43,代码来源:AST.cpp

示例2: run

static void run( int argc, char** argv )
{
	Sequence<Path> paths;
	for ( int i=1; i < argc; i++ )
	{
		paths.addLast( new Path( argv[i] ) );
	}

	CodeBase* codebase = AstralFactory::createAstralExport( paths, ".java" );
	{
		Export::toXML( *codebase );
	}
	delete codebase;
}
开发者ID:danielbradley,项目名称:Astral,代码行数:14,代码来源:main.cpp

示例3: parseArguments

bool parseArguments( int argc, const char** argv, Sequence<String>& fileLocations, MTArguments& arguments )
{
	if ( argc <= 1 ) return false;
	
	String* executable = new String( basename( (char*) argv[0] ) );
	for ( int i=1; i < argc; i++ )
	{
		String arg( argv[i] );
		if ( arg.equals( "--style" ) )
		{
			i++;

			if ( i < argc )
			{
				arguments.stylesheet = argv[i];
			}
		}
		else if ( arg.equals( "--format" ) )
		{
			i++;

			if ( i < argc )
			{
				arguments.format = argv[i];
			}
		}
		else if ( arg.equals( "--out" ) )
		{
			i++;

			if ( i < argc )
			{
				arguments.outfile = argv[i];
			}
		}
		else if ( arg.equals( "--class" ) )
		{
			i++;

			if ( i < argc )
			{
				arguments.classType = argv[i];
			}
		}
		else if ( arg.equals( "--parameters" ) )
		{
			i++;

			if ( i < argc )
			{
				arguments.parameters = argv[i];
			}
		}
		else if ( arg.equals( "--packages" ) )
		{
			i++;

			if ( i < argc )
			{
				arguments.packages = argv[i];
			}
		}
		else if ( arg.equals( "--content-only" ) )
		{
			if ( i < argc )
			{
				arguments.contentOnly = argv[i];
			}
		}
		else
		{
			fileLocations.addLast( new String( argv[i] ) );
		}
	}

	if ( 0 == CharString_getLength( arguments.format ) )
	{
		if ( executable->contentEquals( "max2tex" ) )
		{
			arguments.format = "tex";
		}
		else
		{
			arguments.format = "html";
		}
	}

	if ( 0 != CharString_compare( arguments.outfile, "" ) )
	{
		if ( ! CharString_endsWith( arguments.outfile, arguments.format ) )
		{
			FormattedString fs( "%s.%s", arguments.outfile, arguments.format );
			arguments.outfile = new_CharString( fs.getChars() );
		}
	}
	
	if ( 0 == CharString_compare( arguments.classType, "" ) )
	{
		arguments.classType = "article";
	}
//.........这里部分代码省略.........
开发者ID:danielbradley,项目名称:MaxText,代码行数:101,代码来源:main.cpp

示例4: parseArgumentsX

bool parseArgumentsX( int argc, char** argv, Sequence<String>& fileLocations, String** outfile, String** stylesheet, String** format, String** classType )
{
	if ( argc <= 1 ) return false;
	
	String* executable = new String( (const char*) basename( argv[0] ) );
	for ( int i=1; i < argc; i++ )
	{
		String arg( argv[i] );
		if ( arg.equals( "--style" ) )
		{
			i++;

			if ( i < argc )
			{
				delete *stylesheet;
				*stylesheet = new String( argv[i] );
			}
		}
		else if ( arg.equals( "--format" ) )
		{
			i++;

			if ( i < argc )
			{
				delete *format;
				*format = new String( argv[i] );
			}
		}
		else if ( arg.equals( "--out" ) )
		{
			i++;

			if ( i < argc )
			{
				delete *outfile;
				*outfile = new String( argv[i] );
			}
		}
		else if ( arg.equals( "--class" ) )
		{
			i++;

			if ( i < argc )
			{
				delete *classType;
				*classType = new String( argv[i] );
			}
		}
		else
		{
			fileLocations.addLast( new String( argv[i] ) );
		}
	}

	if ( ! *format )
	{
		if ( executable->contentEquals( "max2tex" ) )
		{
			*format = new String( "tex" );
		}
		else
		{
			*format = new String( "html" );
		}
	}

	if ( *outfile && !(*outfile)->endsWith( **format ) )
	{
		*outfile = new FormattedString( "%s.%s", (*outfile)->getChars(), (*format)->getChars() );
	}
	
	if ( ! *classType )
	{
		*classType = new String( "article" );
	}
	
	delete executable;
	
	return true;
}
开发者ID:danielbradley,项目名称:MaxText,代码行数:80,代码来源:main.cpp


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