您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ trimString函数代码示例

51自学网 2021-06-03 08:58:52
  C++
这篇教程C++ trimString函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中trimString函数的典型用法代码示例。如果您正苦于以下问题:C++ trimString函数的具体用法?C++ trimString怎么用?C++ trimString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: trie

void trie(FILE *pool,FILE *check,FILE *result) {    TRIE *head = trie_create();    char line[BUFFERSIZE];    int exitflag=0;    int i;    while(fgets(line,BUFFERSIZE,pool)) {        /*delete the useless character '/r'*/        exitflag = trimString(line);        if(!exitflag) {            reverseString(line);            trie_add(&head,line);        } else {            /*printf("Error email %s",line);*/            continue;        }    }    while(fgets(line,BUFFERSIZE,check)) {        i = 0;        while(line[i]!='/r' && line[i]!='/n') i++;        line[i] = '/0';        exitflag = trimString(line);        if(!exitflag) {            reverseString(line);            if(trie_check(&head,line)) {                fprintf(result,"yes/n");            } else {                fprintf(result,"no/n");            }        }    }    trie_destroy(&head);}
开发者ID:qhsong,项目名称:EmailSearch,代码行数:33,


示例2: trimString

void ConfigFileReader::processLine (std::string &str){	if (str=="")		return;	int index = str.find ('=');		if (index == 0 || index == str.size())	{		error = true;		errorMessage = "Invalid line in config file";		return;	}		std::string key = str.substr (0 , index);	std::string value = str.substr (index + 1, str.size()-index-1);		trimString(key);	trimString(value);				if (key == "" || value == "")	{		error = true;		errorMessage = "Invalid line in config file";		return;	}		(*keyValueMap) [key] = value;}
开发者ID:BackupTheBerlios,项目名称:diptables-svn,代码行数:30,


示例3: sep

void ProtocolAdmin::adminCommandSetOwner(const std::string& param){	OutputMessage_ptr output = OutputMessagePool::getInstance()->getOutputMessage(this, false);	if (output) {		boost::char_separator<char> sep(", ");		tokenizer cmdtokens(param, sep);		tokenizer::iterator cmdit = cmdtokens.begin();		std::string _house, name;		_house = parseParams(cmdit, cmdtokens.end());		name = parseParams(cmdit, cmdtokens.end());		trimString(_house);		trimString(name);		if (House* house = Houses::getInstance().getHouse(atoi(_house.c_str()))) {			uint32_t _guid;			if (IOLoginData::getInstance()->getGuidByName(_guid, name)) {				house->setHouseOwner(_guid);				addLogLine(this, LOGTYPE_EVENT, 1, "set " + name + " as new owner of house with id " + _house);				output->AddByte(AP_MSG_COMMAND_OK);			} else {				addLogLine(this, LOGTYPE_WARNING, 1, "Could not find player with name: " + name);				output->AddByte(AP_MSG_COMMAND_FAILED);				output->AddString("such player does not exists");			}		} else {			addLogLine(this, LOGTYPE_WARNING, 1, "Could not find house with id: " + _house);			output->AddByte(AP_MSG_COMMAND_FAILED);			output->AddString("such house does not exists");		}		OutputMessagePool::getInstance()->send(output);	}}
开发者ID:Remoq7,项目名称:forgottenserver,代码行数:35,


示例4: listStream

bool AccessList::parseList(const std::string& _list){	playerList.clear();	guildList.clear();	expressionList.clear();	regExList.clear();	list = _list;	if(_list == "")		return true;	std::istringstream listStream(_list);	std::string line;	while(getline(listStream, line))	{		trimString(line);		trim_left(line, "/t");		trim_right(line, "/t");		trimString(line);		std::transform(line.begin(), line.end(), line.begin(), tolower);		if(line.substr(0,1) == "#" || line.length() > 100)			continue;		if(line.find("@") != std::string::npos)		{			std::string::size_type pos = line.find("@");			addGuild(line.substr(pos + 1), "");		}		else if(line.find("!") != std::string::npos || line.find("*") != std::string::npos || line.find("?") != std::string::npos)			addExpression(line);		else			addPlayer(line);	}	return true;}
开发者ID:CkyLua,项目名称:tfs,代码行数:35,


示例5: sep

void Commands::addSkill(Player* player, const std::string& cmd, const std::string& param){	boost::char_separator<char> sep(",");	tokenizer cmdtokens(param, sep);	tokenizer::iterator cmdit = cmdtokens.begin();	std::string param1, param2;	param1 = parseParams(cmdit, cmdtokens.end());	param2 = parseParams(cmdit, cmdtokens.end());	trimString(param1);	trimString(param2);	toLowerCaseString(param2);	Player* paramPlayer = g_game.getPlayerByName(param1);	if (!paramPlayer) {		player->sendTextMessage(MSG_STATUS_SMALL, "Couldn't find target.");		return;	}	if (param2[0] == 'l' || param2[0] == 'e') {		paramPlayer->addExperience(Player::getExpForLevel(paramPlayer->getLevel() + 1) - paramPlayer->experience, false, false);	} else if (param2[0] == 'm') {		paramPlayer->addManaSpent(paramPlayer->vocation->getReqMana(paramPlayer->getBaseMagicLevel() + 1) - paramPlayer->manaSpent, false);	} else {		skills_t skillId = getSkillId(param2);		paramPlayer->addSkillAdvance(skillId, paramPlayer->vocation->getReqSkillTries(skillId, paramPlayer->getSkill(skillId, SKILL_LEVEL) + 1));	}}
开发者ID:Remoq7,项目名称:forgottenserver,代码行数:28,


示例6: MessageBox

void CtrlDisAsmView::assembleOpcode(u32 address, std::string defaultText){	u32 encoded;	auto memLock = Memory::Lock();	if (Core_IsStepping() == false) {		MessageBox(wnd,L"Cannot change code while the core is running!",L"Error",MB_OK);		return;	}	std::string op;	bool result = InputBox_GetString(MainWindow::GetHInstance(),wnd,L"Assemble opcode",defaultText, op, false);	if (!result)		return;	// check if it changes registers first	auto seperator = op.find('=');	if (seperator != std::string::npos)	{		std::string registerName = trimString(op.substr(0,seperator));		std::string expression = trimString(op.substr(seperator+1));		u32 value;		if (parseExpression(expression.c_str(),debugger,value) == true)		{			for (int cat = 0; cat < debugger->GetNumCategories(); cat++)			{				for (int reg = 0; reg < debugger->GetNumRegsInCategory(cat); reg++)				{					if (strcasecmp(debugger->GetRegName(cat,reg),registerName.c_str()) == 0)					{						debugger->SetRegValue(cat,reg,value);						SendMessage(GetParent(wnd),WM_DEB_UPDATE,0,0);						return;					}				}			}		}		// try to assemble the input if it failed	}	result = MIPSAsm::MipsAssembleOpcode(op.c_str(),debugger,address,encoded);	if (result == true)	{		Memory::Write_U32(encoded, address);		// In case this is a delay slot or combined instruction, clear cache above it too.		if (MIPSComp::jit)			MIPSComp::jit->InvalidateCacheAt(address - 4, 8);		scanFunctions();		if (address == curAddress)			gotoAddr(manager.getNthNextAddress(curAddress,1));		redraw();	} else {		std::wstring error = ConvertUTF8ToWString(MIPSAsm::GetAssembleError());		MessageBox(wnd,error.c_str(),L"Error",MB_OK);	}}
开发者ID:ANR2ME,项目名称:ppsspp,代码行数:59,


示例7: parseLine

void parseLine(const char* str, char* prefix, char* data){		char* pch = strchr(str, '=');	strncpy(prefix, str, pch - str);	trimString(prefix);	strcpy(data, pch + 1);	trimString(data);}
开发者ID:siningma,项目名称:peer-to-peer-file-system,代码行数:8,


示例8: if

bool Mailbox::getReceiver(Item* item, std::string& name, uint32_t& dp){	if(!item)		return false;	if(item->getID() == ITEM_PARCEL) /**We need to get the text from the label incase its a parcel**/	{		Container* parcel = item->getContainer();		if(parcel)		{			for(ItemList::const_iterator cit = parcel->getItems(); cit != parcel->getEnd(); cit++)			{				if((*cit)->getID() == ITEM_LABEL)				{					item = (*cit);					if(item->getText() != "")						break;				}			}		}	}	else if(item->getID() != ITEM_LETTER) /**The item is somehow not a parcel or letter**/	{		std::cout << "Mailbox::getReciver error, trying to get reciecer from unkown item! ID:: " << item->getID() << "." << std::endl;		return false;	}	if(!item || item->getText() == "") /**No label/letter found or its empty.**/		return false;	std::string temp;	std::istringstream iss(item->getText(), std::istringstream::in);	std::string strTown = "";	uint32_t curLine = 1;	while(getline(iss, temp, '/n'))	{		if(curLine == 1)			name = temp;		else if(curLine == 2)			strTown = temp;		else			break;		++curLine;	}	trimString(name);	trimString(strTown);	Town* town = Towns::getInstance().getTown(strTown);	if(town)	{		dp = town->getTownID();		return true;	}	return false;}
开发者ID:Codex-NG,项目名称:TFS-1.0,代码行数:58,


示例9: String

void CStringTest::testTrimWhiteSpace(){        std::string String(" test this ");        String = trimString(String);        CPPUNIT_ASSERT(String == "test this");        String = "/"test this/"";        String = trimString(String," /t/"");        CPPUNIT_ASSERT(String == "test this");}
开发者ID:martsbradley,项目名称:sumtree,代码行数:12,


示例10: trimString

char *getResult(char input1[],char input2[]){	char *result="error";	trimString(input1);	trimString(input2);	if(isValid(input1)&&isValid(input2))	{		result=NBitBinaryAdder(input1,input2);		reverse(result,inputlen(result));	}	return result;}
开发者ID:Seshu1729,项目名称:extra_problems,代码行数:12,


示例11: trimString

TalkActionResult_t Spells::playerSaySpell(Player* player, std::string& words){	std::string str_words = words;	//strip trailing spaces	trimString(str_words);	InstantSpell* instantSpell = getInstantSpell(str_words);	if (!instantSpell) {		return TALKACTION_CONTINUE;	}	std::string param;	if (instantSpell->getHasParam()) {		size_t spellLen = instantSpell->getWords().length();		size_t paramLen = str_words.length() - spellLen;		std::string paramText = str_words.substr(spellLen, paramLen);		if (!paramText.empty() && paramText.front() == ' ') {			size_t loc1 = paramText.find('"', 1);			if (loc1 != std::string::npos) {				size_t loc2 = paramText.find('"', loc1 + 1);				if (loc2 == std::string::npos) {					loc2 = paramText.length();				} else if (paramText.find_last_not_of(' ') != loc2) {					return TALKACTION_CONTINUE;				}				param = paramText.substr(loc1 + 1, loc2 - loc1 - 1);			} else {				trimString(paramText);				loc1 = paramText.find(' ', 0);				if (loc1 == std::string::npos) {					param = paramText;				} else {					return TALKACTION_CONTINUE;				}			}		}	}	if (instantSpell->playerCastInstant(player, param)) {		words = instantSpell->getWords();		if (instantSpell->getHasParam() && !param.empty()) {			words += " /"" + param + "/"";		}		return TALKACTION_BREAK;	}	return TALKACTION_FAILED;}
开发者ID:DevelopersPL,项目名称:forgottenserver,代码行数:53,


示例12: if

bool Mailbox::getRecipient(Item* item, std::string& name, uint32_t& depotId){	if(!item)		return false;	if(item->getID() == ITEM_PARCEL) /**We need to get the text from the label incase its a parcel**/	{		if(Container* parcel = item->getContainer())		{			for(ItemList::const_iterator cit = parcel->getItems(); cit != parcel->getEnd(); ++cit)			{				if((*cit)->getID() == ITEM_LABEL && !(*cit)->getText().empty())				{					item = (*cit);					break;				}			}		}	}	else if(item->getID() != ITEM_LETTER) /**The item is somehow not a parcel or letter**/	{		std::clog << "[Error - Mailbox::getReciver] Trying to get receiver from unkown item with id: " << item->getID() << "!" << std::endl;		return false;	}	if(!item || item->getText().empty()) /**No label/letter found or its empty.**/		return false;	std::istringstream iss(item->getText(), std::istringstream::in);	uint32_t curLine = 0;	std::string tmp, townString;	while(getline(iss, tmp, '/n') && curLine < 2)	{		if(curLine == 0)			name = tmp;		else if(curLine == 1)			townString = tmp;		++curLine;	}	trimString(name);	if(townString.empty())		return false;	trimString(townString);	return getDepotId(townString, depotId);}
开发者ID:AhmedWaly,项目名称:CastOnly,代码行数:49,


示例13: trimString

Production::Production(ifstream& infile){	   	// Get Production line to parse.   	const size_t MAX_CHAR_ARRAY_SIZE = 1000;	char tempString[MAX_CHAR_ARRAY_SIZE];	infile.getline(tempString, MAX_CHAR_ARRAY_SIZE, '/n');		// Convert to string object for better manipulation.	string rawStringObject = tempString;	string trimmedString = trimString(rawStringObject);	// Prepare punctuation.	formatForPunctuation(trimmedString);		// Turn string into a stream for word easy extraction.	stringstream myStringStream(trimmedString);	// Loop through; extract and store all words in vector.	string temp;	myStringStream >> temp;	while(temp != ";")	{		this->phrases.push_back(temp);				myStringStream >> temp;	}}
开发者ID:charbelZeaiter,项目名称:Sentence-Generator,代码行数:28,


示例14: wtag

char OSISLemma::processText(std::string &text, const SWKey *key, const SWModule *module) {    (void) key;    (void) module;    std::string token;    bool intoken = false;    const std::string orig = text;    const char * from = orig.c_str();    if (!option) {        for (text = ""; *from; ++from) {            if (*from == '<') {                intoken = true;                token = "";                continue;            }            if (*from == '>') {    // process tokens                intoken = false;                if (hasPrefix(token, "w ")) {    // Word                    XMLTag wtag(token.c_str());                    int count = wtag.getAttributePartCount("lemma", ' ');                    for (int i = 0; i < count; i++) {                        std::string a = wtag.getAttribute("lemma", i, ' ');                        auto const prefixPos(a.find(':'));                        if (prefixPos == std::string::npos                            || (prefixPos >= sizeof("lemma.") - 1u                                && std::strncmp(a.c_str(),                                                "lemma.",                                                sizeof("lemma.") - 1u)))                        {                            // remove attribute part                            wtag.setAttribute("lemma", 0, i, ' ');                            i--;                            count--;                        }                    }                    token = wtag;                    trimString(token);                    // drop <>                    token.erase(0u, 1u);                    token.pop_back();                }                // keep token in text                text.push_back('<');                text.append(token);                text.push_back('>');                continue;            }            if (intoken) {                token += *from;            }            else    {                text.push_back(*from);            }        }    }    return 0;}
开发者ID:kalemas,项目名称:swordxx,代码行数:60,


示例15: if

bool Mailbox::getReceiver(Item* item, std::string& name){	if (!item) {		return false;	}	if (item->getID() == ITEM_PARCEL) { /**We need to get the text from the label incase its a parcel**/		Container* parcel = item->getContainer();		if (parcel) {			for (ItemDeque::const_iterator cit = parcel->getItems(), end = parcel->getEnd(); cit != end; ++cit) {				if ((*cit)->getID() == ITEM_LABEL) {					item = (*cit);					if (!item->getText().empty()) {						break;					}				}			}		}	} else if (item->getID() != ITEM_LETTER) { /**The item is somehow not a parcel or letter**/		std::cout << "Mailbox::getReciver error, trying to get reciecer from unkown item! ID: " << item->getID() << "." << std::endl;		return false;	}	if (!item || item->getText().empty()) { /**No label/letter found or its empty.**/		return false;	}	name = getFirstLine(item->getText());	trimString(name);	return true;}
开发者ID:HeberPcL,项目名称:forgottenserver,代码行数:31,


示例16: parsePath

void parsePath(AllData& alldata, string path, int rule, uint64_t n,		double timeB) {	trimString(path);	if (rule != 1) {		timeB = -1;	}	cur_pos = NULL;	uint32_t cid;	string child;	while (path != "") {		uint32_t pid = atoi(path.substr(0, path.find_first_of(" ")).c_str());		string parent = alldata.functionIdNameMap[pid];		path = path.substr(path.find_first_of(" ") + 1);		if (path == "") {			if (cur_pos != NULL)				break;			cid = 5;			child = parent;			child = "";		} else {			cid = atoi(path.substr(0, path.find_first_of(" ")).c_str());			child = alldata.functionIdNameMap[cid];		}		if (path.find_first_of(" ") == path.npos) {			addToTree(parent, pid, child, cid, rule, n, timeB);			break;		} else			addToTree(parent, pid, child, cid, -1, 0, -1);	}}
开发者ID:DmitrySigaev,项目名称:ompi-release,代码行数:32,


示例17: inputTestCases

void inputTestCases(){	int i;	struct testcases test[12] = {				{"1010","0101","1111"},				{"0000","0000","0000"},				{"1111 1111","i111 1111","error"},				{"0 0 0 0 0 0 0 0 0","0 0 1 1","0 0 0 0 0 0 0 1 1"},				{"11 00","00 11","11 11"},				{"","   111   ","111"},				{"1111 1111","","11 1111 11"},				{"11 11","1+ 11","error"},				{"1 0 101","1 01","1 1 010"},				{"1","1","1 0"},				{" 0 "," 1 "," 1 "},				{"","",""}			};	char *finalresult,*myinput1,*myinput2,*myoutput;	for(i=0;i<12;i++)	{		myinput1 = (char *)malloc(inputlen(test[i].input1)*sizeof(char));		myinput2 = (char *)malloc(inputlen(test[i].input2)*sizeof(char));		myoutput = (char *)malloc(inputlen(test[i].output)*sizeof(char));		stringCopy(myinput1,test[i].input1);		stringCopy(myinput2,test[i].input2);		stringCopy(myoutput,test[i].output);		trimString(myoutput);		finalresult = getResult(myinput1,myinput2);		if(isEqual(finalresult,myoutput))			printf("pass/n");		else			printf("fail/n");	}}
开发者ID:Seshu1729,项目名称:extra_problems,代码行数:34,


示例18: get_config_info

void get_config_info(){	char line[512] = "";	char *token, *ptr;	FILE* fp = fopen(WEB_CONFIG_CONF, "r");	if (fp != NULL)	{		while (fgets(line, sizeof(line), fp))		{			token = strtok_r(line, "=", &ptr);			trimString(ptr);			if (strcmp(token, "filepath") == 0)			{				strcpy(DataPath, ptr);			}		}		fclose(fp);		logger_remotem("DataPath: %s", DataPath);	}	else	{		logger_remotem("GET_INFO: cannot open  config file - %s", WEB_CONFIG_CONF);	}}
开发者ID:giacdinh,项目名称:rr_apps,代码行数:26,


示例19: read_file

vector<char*> read_file(char* filename){	vector<char*> file_data;	ifstream inData;	inData.open(filename, ios::in);	if(!inData)	{		printf("the file %s can not be opened/n", filename);		inData.close();		exit(1); 	}	//buffer to hold one line data 	char str[MAXDATASIZE];	memset(str, 0, MAXDATASIZE);	while(inData.getline(str, MAXDATASIZE))	{		trimString(str);		int len = strlen(str);		if(len == 0)			continue;		char* data_str = new char[len];		memset(data_str, 0, len);		strcpy(data_str, str);		file_data.push_back(data_str);		memset(str, 0, MAXDATASIZE);	}			inData.close();	return file_data;}
开发者ID:siningma,项目名称:peer-to-peer-file-system,代码行数:31,


示例20: readFile

vector<string> readFile(char* filename){	vector<string> file_data;		FILE* pFile = fopen(filename, "r");	if(!pFile)	{		fprintf(stderr, "cannot open file %s/n", filename);		return file_data;	}	char str[MAXDATASIZE];	memset(str, 0, MAXDATASIZE);	while(!feof(pFile))	{		memset(str, 0, MAXDATASIZE);		if(fgets(str, MAXDATASIZE, pFile) != NULL)		{			trimString(str);			int len = strlen(str);			if(len == 0)				continue;			memset(&str[len - 2], 0, 2);				string s(str);			file_data.push_back(s);			}	}	return file_data;}
开发者ID:siningma,项目名称:peer-to-peer-file-system,代码行数:28,


示例21: handleDelimiter

void Parser::doParse(const char* str) {	string tmp;			insideParams = false;	params.clear();	for (size_t i = 0; i < strlen(str); i++) {		if(str[i] == expectedDelimiter) {			handleDelimiter(tmp);			} else if(str[i] == otherDelimiter) {			cerr << "WARNING: Unexpected delimiter while parsing" << endl;		} else {			if(tmp.length() > 0 && (str[i] == parameterDelimiter || isWhitespace(str[i]))) {				trimString(tmp);				params.push_back(tmp);				tmp.clear();			} else {				tmp += str[i];			}		}	}			if (tmp.length() > 0) {		//cerr << "WARNING: Reached end of line while parsing" << endl;		handleDelimiter(tmp);	}}
开发者ID:miyucy,项目名称:swfmill,代码行数:27,


示例22: trimString

bool Spectators::check(const std::string& _password){	if(password.empty())		return true;	std::string t = _password;	return trimString(t) == password;}
开发者ID:Azuen,项目名称:RealOTX-7.72,代码行数:8,


示例23: trie

void trie(FILE *pool,FILE *check,FILE *result) {	clock_t start,end,start1;	start = clock();	TRIE *head = trie_create();	char line[BUFFERSIZE];	int count=0;	int i=0;	int exitflag=0;	while(fgets(line,BUFFERSIZE,pool)) {		/*delete the useless character '/r'*/		exitflag = trimString(line);		if(!exitflag){			reverseString(line);			trie_add(&head,line);			//	if(!(++count%100000)){ 		//		end = clock();		//		printf("%d,%f /n",count++,(double)(end -start)/CLOCKS_PER_SEC);		//	} 		}else{			/*printf("Error email %s",line);*/			continue;		}	}	//end = clock();	//printf("Creating tree using %f/n",(double)(end -start)/CLOCKS_PER_SEC);	start1 = clock();	while(fgets(line,BUFFERSIZE,check)) {		i = 0;		while(line[i]!='/r' && line[i]!='/n') i++;		line[i] = '/0';		exitflag = trimString(line);		if(!exitflag){			reverseString(line);			if(trie_check(&head,line)) {				fprintf(result,"yes/n");			}else {				fprintf(result,"no/n");			}		}	}	trie_destroy(&head);	end = clock();	printf("%f/n",(double)(end -start)/CLOCKS_PER_SEC);}
开发者ID:qhsong,项目名称:EmailSearch,代码行数:46,


示例24: trimString

std::vector<bool> StringTools::stringVectorToBoolVector(std::vector<std::string> inputStringVector){	std::vector<bool> result;	std::string tmpString;	for(std::vector<std::string>::iterator currentStringVectorEntry = inputStringVector.begin(); currentStringVectorEntry < inputStringVector.end(); ++currentStringVectorEntry)	{		trimString( *currentStringVectorEntry );		tmpString.clear();		tmpString = *currentStringVectorEntry;		trimString(tmpString);		result.push_back( stringToBool(tmpString) );	}	return result;}
开发者ID:umn-earth-surface,项目名称:sedFlow,代码行数:17,


示例25: getFormattedName

 static std::string getFormattedName(std::string givenName, std::string middleName,                                           std::string surname) {        if (givenName.empty()) {            givenName = trimString(givenName);        } else {            givenName = "";        }        if (middleName.empty()) {            middleName = trimString(middleName);        } else {            middleName = "";        }        if (surname.empty()) {            surname = trimString(surname);        } else {            surname = "";        }        return givenName + " " + middleName + " " + surname;    }
开发者ID:epronk,项目名称:gnocchi,代码行数:19,


示例26: addOldToTree

void addOldToTree(AllData& alldata, std::ostringstream& old_filter) {	vector<string> pathes;	if( !alldata.params.dispersion.filter_file_name.empty())	{        string filter_file_name = alldata.params.dispersion.filter_file_name;        ifstream b_file(filter_file_name.c_str());        if (b_file.good()) {            string line;            while (std::getline(b_file, line)) {                trimString(line);                if (line.substr(0, 1) != "#" && line.find_first_of("--")                        != line.npos) {                    pathes.push_back(line);                } else {                    if (line != STARTTEXT && line != STARTTEXT2 && line                            != STARTTEXT3)                        old_filter << line << endl;                }            }            b_file.close();        }        while (!pathes.empty()) {            string path = pathes.back();            string tmp_path = path;            pathes.pop_back();            int pos = path.find_last_of("--") - 1;            string tail = path.substr(pos, path.length() - pos);            path = path.substr(0, pos);            trimString(path);            trimString(tail);            string func = path.substr(path.find_last_of(";") + 1, path.length()                    - (path.find_last_of(";") + 1));            if (tail.find("C") != tail.npos && tail.find(" 0 ") != tail.npos) {                parsePath(alldata, path, FILTEROUT);            } else {                old_filter << tmp_path << endl;            }        }	}}
开发者ID:DmitrySigaev,项目名称:ompi-release,代码行数:42,


示例27: trimString

std::string Fragment::cleanFragment() const {   static std::vector< std::string > const starts { BLOCK_START_TOKEN, VAR_START_TOKEN };   if( std::find( starts.begin(),          starts.end(), m_rawText.substr( 0, 2 ) ) != starts.end() ) {      std::string result;      std::copy( m_rawText.begin() + 2, m_rawText.end() - 2, std::back_inserter( result ) );      trimString( result );      return result;   }   return m_rawText;}
开发者ID:avdbg,项目名称:RedZone,代码行数:11,


示例28: parseNextParam

std::string parseNextParam(Tokenizer::iterator& it, Tokenizer::iterator end){	std::string tmp;	if (it == end) {		return tmp;	}	tmp = *it++;	trimString(tmp);	return tmp;}
开发者ID:tOgg1,项目名称:forgottenserver,代码行数:11,



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


C++ trim_filename函数代码示例
C++ trimSpaces函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。