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


C++ ParamVector::push_back方法代码示例

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


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

示例1: buildIntegerParams

ParamVector* buildIntegerParams(CExport* exporter, int integer)
{
	exporter->extra_paramVectors.push_back(ParamVector());
	ParamVector* vec = &exporter->extra_paramVectors.back();
	vec->push_back(buildIntegerParam(exporter, integer));
	return vec;
}
开发者ID:segafan,项目名称:Construct-classic,代码行数:7,代码来源:Export.cpp

示例2:

vd::bytesize
ParamSet::GetAllSymbols(
	ParamVector& params) const
{
	vd::bytesize count = 0;
	MapTypes::const_iterator it;
	for(it = m_Types.begin(); it != m_Types.end(); it++)
	{
		params.push_back(it->first);
		count++;
	}
	return count;
}
开发者ID:ICRAR,项目名称:void,代码行数:13,代码来源:paramset.cpp

示例3: parseCommandLine

//commandLine should contain path to n++ executable running
void parseCommandLine(TCHAR * commandLine, ParamVector & paramVector) {
	//params.erase(params.begin());	
	//remove the first element, since thats the path the the executable (GetCommandLine does that)
	TCHAR stopChar = TEXT(' ');
	if (commandLine[0] == TEXT('\"')) {
		stopChar = TEXT('\"');
		++commandLine;
	}
	//while this is not really DBCS compliant, space and quote are in the lower 127 ASCII range
	while(commandLine[0] && commandLine[0] != stopChar)
    {
		++commandLine;
    }

    // For unknown reason, the following command :
    // c:\NppDir>notepad++
    // (without quote) will give string "notepad++\0notepad++\0"
    // To avoid the unexpected behaviour we check the end of string before increasing the pointer
    if (commandLine[0] != '\0')
	    ++commandLine;	//advance past stopChar

	//kill remaining spaces
	while(commandLine[0] == TEXT(' '))
		++commandLine;

	bool isFile = checkSingleFile(commandLine);	//if the commandline specifies only a file, open it as such
	if (isFile) {
		paramVector.push_back(commandLine);
		return;
	}
	bool isInFile = false;
	bool isInWhiteSpace = true;
	paramVector.clear();
	size_t commandLength = lstrlen(commandLine);
	for (size_t i = 0; i < commandLength; ++i)
	{
		switch(commandLine[i]) {
			case '\"': {										//quoted filename, ignore any following whitespace
				if (!isInFile) {	//" will always be treated as start or end of param, in case the user forgot to add an space
					paramVector.push_back(commandLine+i+1);	//add next param(since zero terminated generic_string original, no overflow of +1)
				}
				isInFile = !isInFile;
				isInWhiteSpace = false;
				//because we dont want to leave in any quotes in the filename, remove them now (with zero terminator)
				commandLine[i] = 0;
				break; }
			case '\t':	//also treat tab as whitespace
			case ' ': {
				isInWhiteSpace = true;
				if (!isInFile)
					commandLine[i] = 0;		//zap spaces into zero terminators, unless its part of a filename
				break; }
			default: {											//default TCHAR, if beginning of word, add it
				if (!isInFile && isInWhiteSpace) {
					paramVector.push_back(commandLine+i);	//add next param 
					isInWhiteSpace = false;
				}
				break; }
		}
	}
	//the commandline generic_string is now a list of zero terminated strings concatenated, and the vector contains all the substrings
}
开发者ID:Mewster,项目名称:TranslatorPP,代码行数:63,代码来源:winmain.cpp


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