src/tool-gasparize.cpp
void Tool_gasparize::fixBarlines(HumdrumFile& infile) {
	fixFinalBarline(infile);
	HumRegex hre;

	for (int i=0; i<infile.getLineCount(); i++) {
		if (!infile[i].isBarline()) {
			continue;
		}
		if (infile[i].getDurationToEnd() == 0) {
			break;
		}
		for (int j=0; j<infile[i].getFieldCount(); j++) {
			HTp token = infile.token(i, j);
			if (token->find("==") == string::npos) {
				continue;
			}
			if (hre.search(token, "^==(\\d*)")) {
				string text = "=";
				text += hre.getMatch(1);
				text += "||";
				token->setText(text);
			}
		}
	}
}
//////////////////////////////
//
// Tool_gasparize::fixBarlines -- Add final double barline and convert
//    any intermediate final barlines to double barlines.
//
:fixBarlines -- Add final double barline and convert
any intermediate final barlines to double barlines.
: fixBarlines -- Add final double barline and convert any intermediate final barlines to double barlines .
void Tool_gasparize::fixBarlines(HumdrumFile& infile) {
	fixFinalBarline(infile);
	HumRegex hre;
	for (int i=0; i<infile.getLineCount(); i++) {
		if (!infile[i].isBarline()) {
			continue;
		}
		if (infile[i].getDurationToEnd() == 0) {
			break;
		}
		for (int j=0; j<infile[i].getFieldCount(); j++) {
			HTp token = infile.token(i, j);
			if (token->find("==") == string::npos) {
				continue;
			}
			if (hre.search(token, "^==(\\d*)")) {
				string text = "=";
				text += hre.getMatch(1);
				text += "||";
				token->setText(text);
			}
		}
	}
}
void Tool_gasparize :: fixBarlines ( HumdrumFile & infile ) { fixFinalBarline ( infile ) ; HumRegex hre ; for ( int i = 0 ; i < infile . getLineCount ( ) ; i ++ ) { if ( ! infile [ i ] . isBarline ( ) ) { continue ; } if ( infile [ i ] . getDurationToEnd ( ) == 0 ) { break ; } for ( int j = 0 ; j < infile [ i ] . getFieldCount ( ) ; j ++ ) { HTp token = infile . token ( i , j ) ; if ( token -> find ( " " ) == string :: npos ) { continue ; } if ( hre . search ( token , " \\ " ) ) { string text = " " ; text += hre . getMatch ( 1 ) ; text += " " ; token -> setText ( text ) ; } } } }
Tool_gasparize::fixBarlines -- Add final double barline and convert
any intermediate final barlines to double barlines.
Tool_gasparize :: fixBarlines -- Add final double barline and convert any intermediate final barlines to double barlines .