Example #1
0
void Parser::SaveDepInfo(const CC_STRING& s)
{
	if(writers[VCH_DEP] && !s.isnull()) {
		ssize_t ret;
		ret = writers[VCH_DEP]->Write(s.c_str(), s.size());
		if(ret < 0)
			exit(-EPIPE);
	}
}
Example #2
0
void CMaExpander::Trim(CC_STRING& s)
{
	const char *p1, *p2, *end = s.c_str() + s.size();

	for(p1 = s.c_str() ; p1 != '\0' && isblank(*p1); p1++ ) ;
	for(p2 = end - 1 ; p2 >= s.c_str() && isblank(*p2); p2-- ) ;
	p2++;
	if(p2 < end && isblank(*p2) )
		p2++;
	CC_STRING ns;
	while(p1 < p2)
		ns += *p1++;
	s = ns;
}