src/MuseRecord.cpp
void MuseRecord::addMeasureFlag(const string& strang) {
	string flags = getColumns(17, 80);
	string flag = strang;

	HumRegex hre;
	hre.replaceDestructive(flag, "\\*", "\\*", "g");
	hre.replaceDestructive(flag, "\\|", "\\|", "g");
	if (hre.search(flags, flag)) {
		// flag was already found in flags, so don't do anything
		return;
	}
	hre.replaceDestructive(flags, "", "\\s+$");
	flags += " ";
	flags += strang;
	setColumns(flags, 17, 80);
}
//////////////////////////////
//
// MuseRecord::addMeasureFlag -- add the following characters to the
//    Flag region of the measure flag area (columns 17-80).  But only
//    add the flag if it is not already present in the region.  If it is
//    not present, then append it after the last non-space character
//    in that region.  A space will be added between the last item
//    and the newly added parameter.
//
:addMeasureFlag -- add the following characters to the
Flag region of the measure flag area (columns 17-80).  But only
add the flag if it is not already present in the region.  If it is
not present, then append it after the last non-space character
in that region.  A space will be added between the last item
and the newly added parameter.
: addMeasureFlag -- add the following characters to the Flag region of the measure flag area ( columns 17 - 80 ) . But only add the flag if it is not already present in the region . If it is not present then append it after the last non - space character in that region . A space will be added between the last item and the newly added parameter .
void MuseRecord::addMeasureFlag(const string& strang) {
	string flags = getColumns(17, 80);
	string flag = strang;
	HumRegex hre;
	hre.replaceDestructive(flag, "\\*", "\\*", "g");
	hre.replaceDestructive(flag, "\\|", "\\|", "g");
	if (hre.search(flags, flag)) {
		return;
	}
	hre.replaceDestructive(flags, "", "\\s+$");
	flags += " ";
	flags += strang;
	setColumns(flags, 17, 80);
}
void MuseRecord :: addMeasureFlag ( const string & strang ) { string flags = getColumns ( 17 , 80 ) ; string flag = strang ; HumRegex hre ; hre . replaceDestructive ( flag , " \\ " , " \\ " , " " ) ; hre . replaceDestructive ( flag , " \\ " , " \\ " , " " ) ; if ( hre . search ( flags , flag ) ) { return ; } hre . replaceDestructive ( flags , " " , " \\ " ) ; flags += " " ; flags += strang ; setColumns ( flags , 17 , 80 ) ; }
MuseRecord::addMeasureFlag -- add the following characters to the
Flag region of the measure flag area (columns 17-80).
MuseRecord :: addMeasureFlag -- add the following characters to the Flag region of the measure flag area ( columns 17 - 80 ) .
// flag was already found in flags, so don't do anything