From 491841c9b87090f23a72e238e617ed7f3607bdbb Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Thu, 9 Feb 2023 15:07:19 +0100 Subject: [PATCH] regenerate libmei output --- libmei/dist/atts_analytical.cpp | 40 +- libmei/dist/atts_analytical.h | 18 +- libmei/dist/atts_cmn.cpp | 158 +++--- libmei/dist/atts_cmn.h | 62 +-- libmei/dist/atts_cmnornaments.cpp | 22 +- libmei/dist/atts_cmnornaments.h | 8 +- libmei/dist/atts_critapp.cpp | 4 +- libmei/dist/atts_critapp.h | 2 +- libmei/dist/atts_edittrans.cpp | 8 +- libmei/dist/atts_edittrans.h | 4 +- libmei/dist/atts_externalsymbols.cpp | 10 +- libmei/dist/atts_externalsymbols.h | 2 +- libmei/dist/atts_facsimile.cpp | 4 +- libmei/dist/atts_facsimile.h | 2 +- libmei/dist/atts_figtable.cpp | 6 +- libmei/dist/atts_figtable.h | 2 +- libmei/dist/atts_fingering.cpp | 4 +- libmei/dist/atts_fingering.h | 2 +- libmei/dist/atts_frettab.cpp | 10 +- libmei/dist/atts_frettab.h | 4 +- libmei/dist/atts_gestural.cpp | 76 +-- libmei/dist/atts_gestural.h | 24 +- libmei/dist/atts_harmony.cpp | 4 +- libmei/dist/atts_harmony.h | 2 +- libmei/dist/atts_header.cpp | 24 +- libmei/dist/atts_header.h | 8 +- libmei/dist/atts_mei.cpp | 6 +- libmei/dist/atts_mei.h | 2 +- libmei/dist/atts_mensural.cpp | 34 +- libmei/dist/atts_mensural.h | 12 +- libmei/dist/atts_midi.cpp | 54 +- libmei/dist/atts_midi.h | 18 +- libmei/dist/atts_neumes.cpp | 24 +- libmei/dist/atts_neumes.h | 4 +- libmei/dist/atts_pagebased.cpp | 10 +- libmei/dist/atts_pagebased.h | 2 +- libmei/dist/atts_performance.cpp | 4 +- libmei/dist/atts_performance.h | 2 +- libmei/dist/atts_shared.cpp | 802 +++++++++++++-------------- libmei/dist/atts_shared.h | 284 +++++----- libmei/dist/atts_usersymbols.cpp | 16 +- libmei/dist/atts_usersymbols.h | 8 +- libmei/dist/atts_visual.cpp | 248 ++++----- libmei/dist/atts_visual.h | 74 +-- 44 files changed, 1057 insertions(+), 1057 deletions(-) diff --git a/libmei/dist/atts_analytical.cpp b/libmei/dist/atts_analytical.cpp index feb88c3668e..d18f8c48487 100644 --- a/libmei/dist/atts_analytical.cpp +++ b/libmei/dist/atts_analytical.cpp @@ -38,12 +38,12 @@ void AttHarmAnl::ResetHarmAnl() m_form = harmAnl_FORM_NONE; } -bool AttHarmAnl::ReadHarmAnl(pugi::xml_node element) +bool AttHarmAnl::ReadHarmAnl(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToHarmAnlForm(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } return hasAttribute; @@ -82,12 +82,12 @@ void AttHarmonicFunction::ResetHarmonicFunction() m_deg = ""; } -bool AttHarmonicFunction::ReadHarmonicFunction(pugi::xml_node element) +bool AttHarmonicFunction::ReadHarmonicFunction(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("deg")) { this->SetDeg(StrToStr(element.attribute("deg").value())); - element.remove_attribute("deg"); + if (removeAttr) element.remove_attribute("deg"); hasAttribute = true; } return hasAttribute; @@ -126,12 +126,12 @@ void AttIntervalHarmonic::ResetIntervalHarmonic() m_inth = ""; } -bool AttIntervalHarmonic::ReadIntervalHarmonic(pugi::xml_node element) +bool AttIntervalHarmonic::ReadIntervalHarmonic(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("inth")) { this->SetInth(StrToStr(element.attribute("inth").value())); - element.remove_attribute("inth"); + if (removeAttr) element.remove_attribute("inth"); hasAttribute = true; } return hasAttribute; @@ -170,12 +170,12 @@ void AttIntervalMelodic::ResetIntervalMelodic() m_intm = ""; } -bool AttIntervalMelodic::ReadIntervalMelodic(pugi::xml_node element) +bool AttIntervalMelodic::ReadIntervalMelodic(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("intm")) { this->SetIntm(StrToStr(element.attribute("intm").value())); - element.remove_attribute("intm"); + if (removeAttr) element.remove_attribute("intm"); hasAttribute = true; } return hasAttribute; @@ -214,12 +214,12 @@ void AttKeySigAnl::ResetKeySigAnl() m_mode = MODE_NONE; } -bool AttKeySigAnl::ReadKeySigAnl(pugi::xml_node element) +bool AttKeySigAnl::ReadKeySigAnl(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("mode")) { this->SetMode(StrToMode(element.attribute("mode").value())); - element.remove_attribute("mode"); + if (removeAttr) element.remove_attribute("mode"); hasAttribute = true; } return hasAttribute; @@ -260,22 +260,22 @@ void AttKeySigDefaultAnl::ResetKeySigDefaultAnl() m_keyPname = PITCHNAME_NONE; } -bool AttKeySigDefaultAnl::ReadKeySigDefaultAnl(pugi::xml_node element) +bool AttKeySigDefaultAnl::ReadKeySigDefaultAnl(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("key.accid")) { this->SetKeyAccid(StrToAccidentalGestural(element.attribute("key.accid").value())); - element.remove_attribute("key.accid"); + if (removeAttr) element.remove_attribute("key.accid"); hasAttribute = true; } if (element.attribute("key.mode")) { this->SetKeyMode(StrToMode(element.attribute("key.mode").value())); - element.remove_attribute("key.mode"); + if (removeAttr) element.remove_attribute("key.mode"); hasAttribute = true; } if (element.attribute("key.pname")) { this->SetKeyPname(StrToPitchname(element.attribute("key.pname").value())); - element.remove_attribute("key.pname"); + if (removeAttr) element.remove_attribute("key.pname"); hasAttribute = true; } return hasAttribute; @@ -332,12 +332,12 @@ void AttMelodicFunction::ResetMelodicFunction() m_mfunc = MELODICFUNCTION_NONE; } -bool AttMelodicFunction::ReadMelodicFunction(pugi::xml_node element) +bool AttMelodicFunction::ReadMelodicFunction(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("mfunc")) { this->SetMfunc(StrToMelodicfunction(element.attribute("mfunc").value())); - element.remove_attribute("mfunc"); + if (removeAttr) element.remove_attribute("mfunc"); hasAttribute = true; } return hasAttribute; @@ -376,12 +376,12 @@ void AttPitchClass::ResetPitchClass() m_pclass = MEI_UNSET; } -bool AttPitchClass::ReadPitchClass(pugi::xml_node element) +bool AttPitchClass::ReadPitchClass(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("pclass")) { this->SetPclass(StrToInt(element.attribute("pclass").value())); - element.remove_attribute("pclass"); + if (removeAttr) element.remove_attribute("pclass"); hasAttribute = true; } return hasAttribute; @@ -420,12 +420,12 @@ void AttSolfa::ResetSolfa() m_psolfa = ""; } -bool AttSolfa::ReadSolfa(pugi::xml_node element) +bool AttSolfa::ReadSolfa(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("psolfa")) { this->SetPsolfa(StrToStr(element.attribute("psolfa").value())); - element.remove_attribute("psolfa"); + if (removeAttr) element.remove_attribute("psolfa"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_analytical.h b/libmei/dist/atts_analytical.h index 01fcea432d8..54a7dd84e38 100644 --- a/libmei/dist/atts_analytical.h +++ b/libmei/dist/atts_analytical.h @@ -38,7 +38,7 @@ class AttHarmAnl : public Att { void ResetHarmAnl(); /** Read the values for the attribute class **/ - bool ReadHarmAnl(pugi::xml_node element); + bool ReadHarmAnl(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteHarmAnl(pugi::xml_node element); @@ -73,7 +73,7 @@ class AttHarmonicFunction : public Att { void ResetHarmonicFunction(); /** Read the values for the attribute class **/ - bool ReadHarmonicFunction(pugi::xml_node element); + bool ReadHarmonicFunction(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteHarmonicFunction(pugi::xml_node element); @@ -114,7 +114,7 @@ class AttIntervalHarmonic : public Att { void ResetIntervalHarmonic(); /** Read the values for the attribute class **/ - bool ReadIntervalHarmonic(pugi::xml_node element); + bool ReadIntervalHarmonic(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteIntervalHarmonic(pugi::xml_node element); @@ -149,7 +149,7 @@ class AttIntervalMelodic : public Att { void ResetIntervalMelodic(); /** Read the values for the attribute class **/ - bool ReadIntervalMelodic(pugi::xml_node element); + bool ReadIntervalMelodic(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteIntervalMelodic(pugi::xml_node element); @@ -189,7 +189,7 @@ class AttKeySigAnl : public Att { void ResetKeySigAnl(); /** Read the values for the attribute class **/ - bool ReadKeySigAnl(pugi::xml_node element); + bool ReadKeySigAnl(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteKeySigAnl(pugi::xml_node element); @@ -224,7 +224,7 @@ class AttKeySigDefaultAnl : public Att { void ResetKeySigDefaultAnl(); /** Read the values for the attribute class **/ - bool ReadKeySigDefaultAnl(pugi::xml_node element); + bool ReadKeySigDefaultAnl(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteKeySigDefaultAnl(pugi::xml_node element); @@ -274,7 +274,7 @@ class AttMelodicFunction : public Att { void ResetMelodicFunction(); /** Read the values for the attribute class **/ - bool ReadMelodicFunction(pugi::xml_node element); + bool ReadMelodicFunction(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMelodicFunction(pugi::xml_node element); @@ -309,7 +309,7 @@ class AttPitchClass : public Att { void ResetPitchClass(); /** Read the values for the attribute class **/ - bool ReadPitchClass(pugi::xml_node element); + bool ReadPitchClass(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePitchClass(pugi::xml_node element); @@ -344,7 +344,7 @@ class AttSolfa : public Att { void ResetSolfa(); /** Read the values for the attribute class **/ - bool ReadSolfa(pugi::xml_node element); + bool ReadSolfa(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSolfa(pugi::xml_node element); diff --git a/libmei/dist/atts_cmn.cpp b/libmei/dist/atts_cmn.cpp index 365a674d5ef..932b249755c 100644 --- a/libmei/dist/atts_cmn.cpp +++ b/libmei/dist/atts_cmn.cpp @@ -38,12 +38,12 @@ void AttArpegLog::ResetArpegLog() m_order = arpegLog_ORDER_NONE; } -bool AttArpegLog::ReadArpegLog(pugi::xml_node element) +bool AttArpegLog::ReadArpegLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("order")) { this->SetOrder(StrToArpegLogOrder(element.attribute("order").value())); - element.remove_attribute("order"); + if (removeAttr) element.remove_attribute("order"); hasAttribute = true; } return hasAttribute; @@ -82,12 +82,12 @@ void AttBTremLog::ResetBTremLog() m_form = bTremLog_FORM_NONE; } -bool AttBTremLog::ReadBTremLog(pugi::xml_node element) +bool AttBTremLog::ReadBTremLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToBTremLogForm(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } return hasAttribute; @@ -126,12 +126,12 @@ void AttBeamPresent::ResetBeamPresent() m_beam = ""; } -bool AttBeamPresent::ReadBeamPresent(pugi::xml_node element) +bool AttBeamPresent::ReadBeamPresent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("beam")) { this->SetBeam(StrToStr(element.attribute("beam").value())); - element.remove_attribute("beam"); + if (removeAttr) element.remove_attribute("beam"); hasAttribute = true; } return hasAttribute; @@ -173,27 +173,27 @@ void AttBeamRend::ResetBeamRend() m_slope = 0.0; } -bool AttBeamRend::ReadBeamRend(pugi::xml_node element) +bool AttBeamRend::ReadBeamRend(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToBeamRendForm(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } if (element.attribute("place")) { this->SetPlace(StrToBeamplace(element.attribute("place").value())); - element.remove_attribute("place"); + if (removeAttr) element.remove_attribute("place"); hasAttribute = true; } if (element.attribute("slash")) { this->SetSlash(StrToBoolean(element.attribute("slash").value())); - element.remove_attribute("slash"); + if (removeAttr) element.remove_attribute("slash"); hasAttribute = true; } if (element.attribute("slope")) { this->SetSlope(StrToDbl(element.attribute("slope").value())); - element.remove_attribute("slope"); + if (removeAttr) element.remove_attribute("slope"); hasAttribute = true; } return hasAttribute; @@ -259,12 +259,12 @@ void AttBeamSecondary::ResetBeamSecondary() m_breaksec = MEI_UNSET; } -bool AttBeamSecondary::ReadBeamSecondary(pugi::xml_node element) +bool AttBeamSecondary::ReadBeamSecondary(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("breaksec")) { this->SetBreaksec(StrToInt(element.attribute("breaksec").value())); - element.remove_attribute("breaksec"); + if (removeAttr) element.remove_attribute("breaksec"); hasAttribute = true; } return hasAttribute; @@ -303,12 +303,12 @@ void AttBeamedWith::ResetBeamedWith() m_beamWith = NEIGHBORINGLAYER_NONE; } -bool AttBeamedWith::ReadBeamedWith(pugi::xml_node element) +bool AttBeamedWith::ReadBeamedWith(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("beam.with")) { this->SetBeamWith(StrToNeighboringlayer(element.attribute("beam.with").value())); - element.remove_attribute("beam.with"); + if (removeAttr) element.remove_attribute("beam.with"); hasAttribute = true; } return hasAttribute; @@ -348,17 +348,17 @@ void AttBeamingLog::ResetBeamingLog() m_beamRests = BOOLEAN_NONE; } -bool AttBeamingLog::ReadBeamingLog(pugi::xml_node element) +bool AttBeamingLog::ReadBeamingLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("beam.group")) { this->SetBeamGroup(StrToStr(element.attribute("beam.group").value())); - element.remove_attribute("beam.group"); + if (removeAttr) element.remove_attribute("beam.group"); hasAttribute = true; } if (element.attribute("beam.rests")) { this->SetBeamRests(StrToBoolean(element.attribute("beam.rests").value())); - element.remove_attribute("beam.rests"); + if (removeAttr) element.remove_attribute("beam.rests"); hasAttribute = true; } return hasAttribute; @@ -406,12 +406,12 @@ void AttBeatRptLog::ResetBeatRptLog() m_beatdef = 0.0; } -bool AttBeatRptLog::ReadBeatRptLog(pugi::xml_node element) +bool AttBeatRptLog::ReadBeatRptLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("beatdef")) { this->SetBeatdef(StrToDbl(element.attribute("beatdef").value())); - element.remove_attribute("beatdef"); + if (removeAttr) element.remove_attribute("beatdef"); hasAttribute = true; } return hasAttribute; @@ -450,12 +450,12 @@ void AttBracketSpanLog::ResetBracketSpanLog() m_func = ""; } -bool AttBracketSpanLog::ReadBracketSpanLog(pugi::xml_node element) +bool AttBracketSpanLog::ReadBracketSpanLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("func")) { this->SetFunc(StrToStr(element.attribute("func").value())); - element.remove_attribute("func"); + if (removeAttr) element.remove_attribute("func"); hasAttribute = true; } return hasAttribute; @@ -494,12 +494,12 @@ void AttCutout::ResetCutout() m_cutout = cutout_CUTOUT_NONE; } -bool AttCutout::ReadCutout(pugi::xml_node element) +bool AttCutout::ReadCutout(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("cutout")) { this->SetCutout(StrToCutoutCutout(element.attribute("cutout").value())); - element.remove_attribute("cutout"); + if (removeAttr) element.remove_attribute("cutout"); hasAttribute = true; } return hasAttribute; @@ -538,12 +538,12 @@ void AttExpandable::ResetExpandable() m_expand = BOOLEAN_NONE; } -bool AttExpandable::ReadExpandable(pugi::xml_node element) +bool AttExpandable::ReadExpandable(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("expand")) { this->SetExpand(StrToBoolean(element.attribute("expand").value())); - element.remove_attribute("expand"); + if (removeAttr) element.remove_attribute("expand"); hasAttribute = true; } return hasAttribute; @@ -582,12 +582,12 @@ void AttFTremLog::ResetFTremLog() m_form = fTremLog_FORM_NONE; } -bool AttFTremLog::ReadFTremLog(pugi::xml_node element) +bool AttFTremLog::ReadFTremLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToFTremLogForm(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } return hasAttribute; @@ -626,12 +626,12 @@ void AttGlissPresent::ResetGlissPresent() m_gliss = GLISSANDO_NONE; } -bool AttGlissPresent::ReadGlissPresent(pugi::xml_node element) +bool AttGlissPresent::ReadGlissPresent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("gliss")) { this->SetGliss(StrToGlissando(element.attribute("gliss").value())); - element.remove_attribute("gliss"); + if (removeAttr) element.remove_attribute("gliss"); hasAttribute = true; } return hasAttribute; @@ -670,12 +670,12 @@ void AttGraceGrpLog::ResetGraceGrpLog() m_attach = graceGrpLog_ATTACH_NONE; } -bool AttGraceGrpLog::ReadGraceGrpLog(pugi::xml_node element) +bool AttGraceGrpLog::ReadGraceGrpLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("attach")) { this->SetAttach(StrToGraceGrpLogAttach(element.attribute("attach").value())); - element.remove_attribute("attach"); + if (removeAttr) element.remove_attribute("attach"); hasAttribute = true; } return hasAttribute; @@ -715,17 +715,17 @@ void AttGraced::ResetGraced() m_graceTime = -1.0; } -bool AttGraced::ReadGraced(pugi::xml_node element) +bool AttGraced::ReadGraced(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("grace")) { this->SetGrace(StrToGrace(element.attribute("grace").value())); - element.remove_attribute("grace"); + if (removeAttr) element.remove_attribute("grace"); hasAttribute = true; } if (element.attribute("grace.time")) { this->SetGraceTime(StrToPercent(element.attribute("grace.time").value())); - element.remove_attribute("grace.time"); + if (removeAttr) element.remove_attribute("grace.time"); hasAttribute = true; } return hasAttribute; @@ -774,17 +774,17 @@ void AttHairpinLog::ResetHairpinLog() m_niente = BOOLEAN_NONE; } -bool AttHairpinLog::ReadHairpinLog(pugi::xml_node element) +bool AttHairpinLog::ReadHairpinLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToHairpinLogForm(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } if (element.attribute("niente")) { this->SetNiente(StrToBoolean(element.attribute("niente").value())); - element.remove_attribute("niente"); + if (removeAttr) element.remove_attribute("niente"); hasAttribute = true; } return hasAttribute; @@ -838,42 +838,42 @@ void AttHarpPedalLog::ResetHarpPedalLog() m_b = harpPedalLog_B_NONE; } -bool AttHarpPedalLog::ReadHarpPedalLog(pugi::xml_node element) +bool AttHarpPedalLog::ReadHarpPedalLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("c")) { this->SetC(StrToHarpPedalLogC(element.attribute("c").value())); - element.remove_attribute("c"); + if (removeAttr) element.remove_attribute("c"); hasAttribute = true; } if (element.attribute("d")) { this->SetD(StrToHarpPedalLogD(element.attribute("d").value())); - element.remove_attribute("d"); + if (removeAttr) element.remove_attribute("d"); hasAttribute = true; } if (element.attribute("e")) { this->SetE(StrToHarpPedalLogE(element.attribute("e").value())); - element.remove_attribute("e"); + if (removeAttr) element.remove_attribute("e"); hasAttribute = true; } if (element.attribute("f")) { this->SetF(StrToHarpPedalLogF(element.attribute("f").value())); - element.remove_attribute("f"); + if (removeAttr) element.remove_attribute("f"); hasAttribute = true; } if (element.attribute("g")) { this->SetG(StrToHarpPedalLogG(element.attribute("g").value())); - element.remove_attribute("g"); + if (removeAttr) element.remove_attribute("g"); hasAttribute = true; } if (element.attribute("a")) { this->SetA(StrToHarpPedalLogA(element.attribute("a").value())); - element.remove_attribute("a"); + if (removeAttr) element.remove_attribute("a"); hasAttribute = true; } if (element.attribute("b")) { this->SetB(StrToHarpPedalLogB(element.attribute("b").value())); - element.remove_attribute("b"); + if (removeAttr) element.remove_attribute("b"); hasAttribute = true; } return hasAttribute; @@ -966,12 +966,12 @@ void AttLvPresent::ResetLvPresent() m_lv = BOOLEAN_NONE; } -bool AttLvPresent::ReadLvPresent(pugi::xml_node element) +bool AttLvPresent::ReadLvPresent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("lv")) { this->SetLv(StrToBoolean(element.attribute("lv").value())); - element.remove_attribute("lv"); + if (removeAttr) element.remove_attribute("lv"); hasAttribute = true; } return hasAttribute; @@ -1011,17 +1011,17 @@ void AttMeasureLog::ResetMeasureLog() m_right = BARRENDITION_NONE; } -bool AttMeasureLog::ReadMeasureLog(pugi::xml_node element) +bool AttMeasureLog::ReadMeasureLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("left")) { this->SetLeft(StrToBarrendition(element.attribute("left").value())); - element.remove_attribute("left"); + if (removeAttr) element.remove_attribute("left"); hasAttribute = true; } if (element.attribute("right")) { this->SetRight(StrToBarrendition(element.attribute("right").value())); - element.remove_attribute("right"); + if (removeAttr) element.remove_attribute("right"); hasAttribute = true; } return hasAttribute; @@ -1069,12 +1069,12 @@ void AttMeterSigGrpLog::ResetMeterSigGrpLog() m_func = meterSigGrpLog_FUNC_NONE; } -bool AttMeterSigGrpLog::ReadMeterSigGrpLog(pugi::xml_node element) +bool AttMeterSigGrpLog::ReadMeterSigGrpLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("func")) { this->SetFunc(StrToMeterSigGrpLogFunc(element.attribute("func").value())); - element.remove_attribute("func"); + if (removeAttr) element.remove_attribute("func"); hasAttribute = true; } return hasAttribute; @@ -1114,17 +1114,17 @@ void AttNumberPlacement::ResetNumberPlacement() m_numVisible = BOOLEAN_NONE; } -bool AttNumberPlacement::ReadNumberPlacement(pugi::xml_node element) +bool AttNumberPlacement::ReadNumberPlacement(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("num.place")) { this->SetNumPlace(StrToStaffrelBasic(element.attribute("num.place").value())); - element.remove_attribute("num.place"); + if (removeAttr) element.remove_attribute("num.place"); hasAttribute = true; } if (element.attribute("num.visible")) { this->SetNumVisible(StrToBoolean(element.attribute("num.visible").value())); - element.remove_attribute("num.visible"); + if (removeAttr) element.remove_attribute("num.visible"); hasAttribute = true; } return hasAttribute; @@ -1172,12 +1172,12 @@ void AttNumbered::ResetNumbered() m_num = MEI_UNSET; } -bool AttNumbered::ReadNumbered(pugi::xml_node element) +bool AttNumbered::ReadNumbered(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("num")) { this->SetNum(StrToInt(element.attribute("num").value())); - element.remove_attribute("num"); + if (removeAttr) element.remove_attribute("num"); hasAttribute = true; } return hasAttribute; @@ -1216,12 +1216,12 @@ void AttOctaveLog::ResetOctaveLog() m_coll = octaveLog_COLL_NONE; } -bool AttOctaveLog::ReadOctaveLog(pugi::xml_node element) +bool AttOctaveLog::ReadOctaveLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("coll")) { this->SetColl(StrToOctaveLogColl(element.attribute("coll").value())); - element.remove_attribute("coll"); + if (removeAttr) element.remove_attribute("coll"); hasAttribute = true; } return hasAttribute; @@ -1261,17 +1261,17 @@ void AttPedalLog::ResetPedalLog() m_func = ""; } -bool AttPedalLog::ReadPedalLog(pugi::xml_node element) +bool AttPedalLog::ReadPedalLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("dir")) { this->SetDir(StrToPedalLogDir(element.attribute("dir").value())); - element.remove_attribute("dir"); + if (removeAttr) element.remove_attribute("dir"); hasAttribute = true; } if (element.attribute("func")) { this->SetFunc(StrToStr(element.attribute("func").value())); - element.remove_attribute("func"); + if (removeAttr) element.remove_attribute("func"); hasAttribute = true; } return hasAttribute; @@ -1319,12 +1319,12 @@ void AttPianoPedals::ResetPianoPedals() m_pedalStyle = PEDALSTYLE_NONE; } -bool AttPianoPedals::ReadPianoPedals(pugi::xml_node element) +bool AttPianoPedals::ReadPianoPedals(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("pedal.style")) { this->SetPedalStyle(StrToPedalstyle(element.attribute("pedal.style").value())); - element.remove_attribute("pedal.style"); + if (removeAttr) element.remove_attribute("pedal.style"); hasAttribute = true; } return hasAttribute; @@ -1363,12 +1363,12 @@ void AttRehearsal::ResetRehearsal() m_rehEnclose = rehearsal_REHENCLOSE_NONE; } -bool AttRehearsal::ReadRehearsal(pugi::xml_node element) +bool AttRehearsal::ReadRehearsal(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("reh.enclose")) { this->SetRehEnclose(StrToRehearsalRehenclose(element.attribute("reh.enclose").value())); - element.remove_attribute("reh.enclose"); + if (removeAttr) element.remove_attribute("reh.enclose"); hasAttribute = true; } return hasAttribute; @@ -1407,12 +1407,12 @@ void AttScoreDefVisCmn::ResetScoreDefVisCmn() m_gridShow = BOOLEAN_NONE; } -bool AttScoreDefVisCmn::ReadScoreDefVisCmn(pugi::xml_node element) +bool AttScoreDefVisCmn::ReadScoreDefVisCmn(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("grid.show")) { this->SetGridShow(StrToBoolean(element.attribute("grid.show").value())); - element.remove_attribute("grid.show"); + if (removeAttr) element.remove_attribute("grid.show"); hasAttribute = true; } return hasAttribute; @@ -1452,17 +1452,17 @@ void AttSlurRend::ResetSlurRend() m_slurLwidth = data_LINEWIDTH(); } -bool AttSlurRend::ReadSlurRend(pugi::xml_node element) +bool AttSlurRend::ReadSlurRend(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("slur.lform")) { this->SetSlurLform(StrToLineform(element.attribute("slur.lform").value())); - element.remove_attribute("slur.lform"); + if (removeAttr) element.remove_attribute("slur.lform"); hasAttribute = true; } if (element.attribute("slur.lwidth")) { this->SetSlurLwidth(StrToLinewidth(element.attribute("slur.lwidth").value())); - element.remove_attribute("slur.lwidth"); + if (removeAttr) element.remove_attribute("slur.lwidth"); hasAttribute = true; } return hasAttribute; @@ -1510,12 +1510,12 @@ void AttStemsCmn::ResetStemsCmn() m_stemWith = NEIGHBORINGLAYER_NONE; } -bool AttStemsCmn::ReadStemsCmn(pugi::xml_node element) +bool AttStemsCmn::ReadStemsCmn(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("stem.with")) { this->SetStemWith(StrToNeighboringlayer(element.attribute("stem.with").value())); - element.remove_attribute("stem.with"); + if (removeAttr) element.remove_attribute("stem.with"); hasAttribute = true; } return hasAttribute; @@ -1555,17 +1555,17 @@ void AttTieRend::ResetTieRend() m_tieLwidth = data_LINEWIDTH(); } -bool AttTieRend::ReadTieRend(pugi::xml_node element) +bool AttTieRend::ReadTieRend(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("tie.lform")) { this->SetTieLform(StrToLineform(element.attribute("tie.lform").value())); - element.remove_attribute("tie.lform"); + if (removeAttr) element.remove_attribute("tie.lform"); hasAttribute = true; } if (element.attribute("tie.lwidth")) { this->SetTieLwidth(StrToLinewidth(element.attribute("tie.lwidth").value())); - element.remove_attribute("tie.lwidth"); + if (removeAttr) element.remove_attribute("tie.lwidth"); hasAttribute = true; } return hasAttribute; @@ -1613,12 +1613,12 @@ void AttTremMeasured::ResetTremMeasured() m_unitdur = DURATION_NONE; } -bool AttTremMeasured::ReadTremMeasured(pugi::xml_node element) +bool AttTremMeasured::ReadTremMeasured(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("unitdur")) { this->SetUnitdur(StrToDuration(element.attribute("unitdur").value())); - element.remove_attribute("unitdur"); + if (removeAttr) element.remove_attribute("unitdur"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_cmn.h b/libmei/dist/atts_cmn.h index 60465a0e0af..c05e16512c1 100644 --- a/libmei/dist/atts_cmn.h +++ b/libmei/dist/atts_cmn.h @@ -38,7 +38,7 @@ class AttArpegLog : public Att { void ResetArpegLog(); /** Read the values for the attribute class **/ - bool ReadArpegLog(pugi::xml_node element); + bool ReadArpegLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteArpegLog(pugi::xml_node element); @@ -73,7 +73,7 @@ class AttBTremLog : public Att { void ResetBTremLog(); /** Read the values for the attribute class **/ - bool ReadBTremLog(pugi::xml_node element); + bool ReadBTremLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBTremLog(pugi::xml_node element); @@ -108,7 +108,7 @@ class AttBeamPresent : public Att { void ResetBeamPresent(); /** Read the values for the attribute class **/ - bool ReadBeamPresent(pugi::xml_node element); + bool ReadBeamPresent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBeamPresent(pugi::xml_node element); @@ -143,7 +143,7 @@ class AttBeamRend : public Att { void ResetBeamRend(); /** Read the values for the attribute class **/ - bool ReadBeamRend(pugi::xml_node element); + bool ReadBeamRend(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBeamRend(pugi::xml_node element); @@ -196,7 +196,7 @@ class AttBeamSecondary : public Att { void ResetBeamSecondary(); /** Read the values for the attribute class **/ - bool ReadBeamSecondary(pugi::xml_node element); + bool ReadBeamSecondary(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBeamSecondary(pugi::xml_node element); @@ -236,7 +236,7 @@ class AttBeamedWith : public Att { void ResetBeamedWith(); /** Read the values for the attribute class **/ - bool ReadBeamedWith(pugi::xml_node element); + bool ReadBeamedWith(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBeamedWith(pugi::xml_node element); @@ -275,7 +275,7 @@ class AttBeamingLog : public Att { void ResetBeamingLog(); /** Read the values for the attribute class **/ - bool ReadBeamingLog(pugi::xml_node element); + bool ReadBeamingLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBeamingLog(pugi::xml_node element); @@ -322,7 +322,7 @@ class AttBeatRptLog : public Att { void ResetBeatRptLog(); /** Read the values for the attribute class **/ - bool ReadBeatRptLog(pugi::xml_node element); + bool ReadBeatRptLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBeatRptLog(pugi::xml_node element); @@ -360,7 +360,7 @@ class AttBracketSpanLog : public Att { void ResetBracketSpanLog(); /** Read the values for the attribute class **/ - bool ReadBracketSpanLog(pugi::xml_node element); + bool ReadBracketSpanLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBracketSpanLog(pugi::xml_node element); @@ -395,7 +395,7 @@ class AttCutout : public Att { void ResetCutout(); /** Read the values for the attribute class **/ - bool ReadCutout(pugi::xml_node element); + bool ReadCutout(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCutout(pugi::xml_node element); @@ -430,7 +430,7 @@ class AttExpandable : public Att { void ResetExpandable(); /** Read the values for the attribute class **/ - bool ReadExpandable(pugi::xml_node element); + bool ReadExpandable(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteExpandable(pugi::xml_node element); @@ -470,7 +470,7 @@ class AttFTremLog : public Att { void ResetFTremLog(); /** Read the values for the attribute class **/ - bool ReadFTremLog(pugi::xml_node element); + bool ReadFTremLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteFTremLog(pugi::xml_node element); @@ -505,7 +505,7 @@ class AttGlissPresent : public Att { void ResetGlissPresent(); /** Read the values for the attribute class **/ - bool ReadGlissPresent(pugi::xml_node element); + bool ReadGlissPresent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteGlissPresent(pugi::xml_node element); @@ -544,7 +544,7 @@ class AttGraceGrpLog : public Att { void ResetGraceGrpLog(); /** Read the values for the attribute class **/ - bool ReadGraceGrpLog(pugi::xml_node element); + bool ReadGraceGrpLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteGraceGrpLog(pugi::xml_node element); @@ -583,7 +583,7 @@ class AttGraced : public Att { void ResetGraced(); /** Read the values for the attribute class **/ - bool ReadGraced(pugi::xml_node element); + bool ReadGraced(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteGraced(pugi::xml_node element); @@ -627,7 +627,7 @@ class AttHairpinLog : public Att { void ResetHairpinLog(); /** Read the values for the attribute class **/ - bool ReadHairpinLog(pugi::xml_node element); + bool ReadHairpinLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteHairpinLog(pugi::xml_node element); @@ -672,7 +672,7 @@ class AttHarpPedalLog : public Att { void ResetHarpPedalLog(); /** Read the values for the attribute class **/ - bool ReadHarpPedalLog(pugi::xml_node element); + bool ReadHarpPedalLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteHarpPedalLog(pugi::xml_node element); @@ -743,7 +743,7 @@ class AttLvPresent : public Att { void ResetLvPresent(); /** Read the values for the attribute class **/ - bool ReadLvPresent(pugi::xml_node element); + bool ReadLvPresent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLvPresent(pugi::xml_node element); @@ -781,7 +781,7 @@ class AttMeasureLog : public Att { void ResetMeasureLog(); /** Read the values for the attribute class **/ - bool ReadMeasureLog(pugi::xml_node element); + bool ReadMeasureLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMeasureLog(pugi::xml_node element); @@ -826,7 +826,7 @@ class AttMeterSigGrpLog : public Att { void ResetMeterSigGrpLog(); /** Read the values for the attribute class **/ - bool ReadMeterSigGrpLog(pugi::xml_node element); + bool ReadMeterSigGrpLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMeterSigGrpLog(pugi::xml_node element); @@ -861,7 +861,7 @@ class AttNumberPlacement : public Att { void ResetNumberPlacement(); /** Read the values for the attribute class **/ - bool ReadNumberPlacement(pugi::xml_node element); + bool ReadNumberPlacement(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteNumberPlacement(pugi::xml_node element); @@ -902,7 +902,7 @@ class AttNumbered : public Att { void ResetNumbered(); /** Read the values for the attribute class **/ - bool ReadNumbered(pugi::xml_node element); + bool ReadNumbered(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteNumbered(pugi::xml_node element); @@ -937,7 +937,7 @@ class AttOctaveLog : public Att { void ResetOctaveLog(); /** Read the values for the attribute class **/ - bool ReadOctaveLog(pugi::xml_node element); + bool ReadOctaveLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteOctaveLog(pugi::xml_node element); @@ -978,7 +978,7 @@ class AttPedalLog : public Att { void ResetPedalLog(); /** Read the values for the attribute class **/ - bool ReadPedalLog(pugi::xml_node element); + bool ReadPedalLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePedalLog(pugi::xml_node element); @@ -1019,7 +1019,7 @@ class AttPianoPedals : public Att { void ResetPianoPedals(); /** Read the values for the attribute class **/ - bool ReadPianoPedals(pugi::xml_node element); + bool ReadPianoPedals(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePianoPedals(pugi::xml_node element); @@ -1054,7 +1054,7 @@ class AttRehearsal : public Att { void ResetRehearsal(); /** Read the values for the attribute class **/ - bool ReadRehearsal(pugi::xml_node element); + bool ReadRehearsal(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteRehearsal(pugi::xml_node element); @@ -1089,7 +1089,7 @@ class AttScoreDefVisCmn : public Att { void ResetScoreDefVisCmn(); /** Read the values for the attribute class **/ - bool ReadScoreDefVisCmn(pugi::xml_node element); + bool ReadScoreDefVisCmn(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteScoreDefVisCmn(pugi::xml_node element); @@ -1124,7 +1124,7 @@ class AttSlurRend : public Att { void ResetSlurRend(); /** Read the values for the attribute class **/ - bool ReadSlurRend(pugi::xml_node element); + bool ReadSlurRend(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSlurRend(pugi::xml_node element); @@ -1167,7 +1167,7 @@ class AttStemsCmn : public Att { void ResetStemsCmn(); /** Read the values for the attribute class **/ - bool ReadStemsCmn(pugi::xml_node element); + bool ReadStemsCmn(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStemsCmn(pugi::xml_node element); @@ -1206,7 +1206,7 @@ class AttTieRend : public Att { void ResetTieRend(); /** Read the values for the attribute class **/ - bool ReadTieRend(pugi::xml_node element); + bool ReadTieRend(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTieRend(pugi::xml_node element); @@ -1249,7 +1249,7 @@ class AttTremMeasured : public Att { void ResetTremMeasured(); /** Read the values for the attribute class **/ - bool ReadTremMeasured(pugi::xml_node element); + bool ReadTremMeasured(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTremMeasured(pugi::xml_node element); diff --git a/libmei/dist/atts_cmnornaments.cpp b/libmei/dist/atts_cmnornaments.cpp index 450201dedbb..85a9200853c 100644 --- a/libmei/dist/atts_cmnornaments.cpp +++ b/libmei/dist/atts_cmnornaments.cpp @@ -39,17 +39,17 @@ void AttMordentLog::ResetMordentLog() m_long = BOOLEAN_NONE; } -bool AttMordentLog::ReadMordentLog(pugi::xml_node element) +bool AttMordentLog::ReadMordentLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToMordentLogForm(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } if (element.attribute("long")) { this->SetLong(StrToBoolean(element.attribute("long").value())); - element.remove_attribute("long"); + if (removeAttr) element.remove_attribute("long"); hasAttribute = true; } return hasAttribute; @@ -97,12 +97,12 @@ void AttOrnamPresent::ResetOrnamPresent() m_ornam = ""; } -bool AttOrnamPresent::ReadOrnamPresent(pugi::xml_node element) +bool AttOrnamPresent::ReadOrnamPresent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("ornam")) { this->SetOrnam(StrToStr(element.attribute("ornam").value())); - element.remove_attribute("ornam"); + if (removeAttr) element.remove_attribute("ornam"); hasAttribute = true; } return hasAttribute; @@ -142,17 +142,17 @@ void AttOrnamentAccid::ResetOrnamentAccid() m_accidlower = ACCIDENTAL_WRITTEN_NONE; } -bool AttOrnamentAccid::ReadOrnamentAccid(pugi::xml_node element) +bool AttOrnamentAccid::ReadOrnamentAccid(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("accidupper")) { this->SetAccidupper(StrToAccidentalWritten(element.attribute("accidupper").value())); - element.remove_attribute("accidupper"); + if (removeAttr) element.remove_attribute("accidupper"); hasAttribute = true; } if (element.attribute("accidlower")) { this->SetAccidlower(StrToAccidentalWritten(element.attribute("accidlower").value())); - element.remove_attribute("accidlower"); + if (removeAttr) element.remove_attribute("accidlower"); hasAttribute = true; } return hasAttribute; @@ -201,17 +201,17 @@ void AttTurnLog::ResetTurnLog() m_form = turnLog_FORM_NONE; } -bool AttTurnLog::ReadTurnLog(pugi::xml_node element) +bool AttTurnLog::ReadTurnLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("delayed")) { this->SetDelayed(StrToBoolean(element.attribute("delayed").value())); - element.remove_attribute("delayed"); + if (removeAttr) element.remove_attribute("delayed"); hasAttribute = true; } if (element.attribute("form")) { this->SetForm(StrToTurnLogForm(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_cmnornaments.h b/libmei/dist/atts_cmnornaments.h index 8a4ca5d7c0f..b7da5409dcb 100644 --- a/libmei/dist/atts_cmnornaments.h +++ b/libmei/dist/atts_cmnornaments.h @@ -38,7 +38,7 @@ class AttMordentLog : public Att { void ResetMordentLog(); /** Read the values for the attribute class **/ - bool ReadMordentLog(pugi::xml_node element); + bool ReadMordentLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMordentLog(pugi::xml_node element); @@ -82,7 +82,7 @@ class AttOrnamPresent : public Att { void ResetOrnamPresent(); /** Read the values for the attribute class **/ - bool ReadOrnamPresent(pugi::xml_node element); + bool ReadOrnamPresent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteOrnamPresent(pugi::xml_node element); @@ -121,7 +121,7 @@ class AttOrnamentAccid : public Att { void ResetOrnamentAccid(); /** Read the values for the attribute class **/ - bool ReadOrnamentAccid(pugi::xml_node element); + bool ReadOrnamentAccid(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteOrnamentAccid(pugi::xml_node element); @@ -162,7 +162,7 @@ class AttTurnLog : public Att { void ResetTurnLog(); /** Read the values for the attribute class **/ - bool ReadTurnLog(pugi::xml_node element); + bool ReadTurnLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTurnLog(pugi::xml_node element); diff --git a/libmei/dist/atts_critapp.cpp b/libmei/dist/atts_critapp.cpp index 01e78699058..de2f9a65f76 100644 --- a/libmei/dist/atts_critapp.cpp +++ b/libmei/dist/atts_critapp.cpp @@ -38,12 +38,12 @@ void AttCrit::ResetCrit() m_cause = ""; } -bool AttCrit::ReadCrit(pugi::xml_node element) +bool AttCrit::ReadCrit(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("cause")) { this->SetCause(StrToStr(element.attribute("cause").value())); - element.remove_attribute("cause"); + if (removeAttr) element.remove_attribute("cause"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_critapp.h b/libmei/dist/atts_critapp.h index 14fd5849774..89382cb1392 100644 --- a/libmei/dist/atts_critapp.h +++ b/libmei/dist/atts_critapp.h @@ -38,7 +38,7 @@ class AttCrit : public Att { void ResetCrit(); /** Read the values for the attribute class **/ - bool ReadCrit(pugi::xml_node element); + bool ReadCrit(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCrit(pugi::xml_node element); diff --git a/libmei/dist/atts_edittrans.cpp b/libmei/dist/atts_edittrans.cpp index 34dfa016a71..06812255796 100644 --- a/libmei/dist/atts_edittrans.cpp +++ b/libmei/dist/atts_edittrans.cpp @@ -38,12 +38,12 @@ void AttAgentIdent::ResetAgentIdent() m_agent = ""; } -bool AttAgentIdent::ReadAgentIdent(pugi::xml_node element) +bool AttAgentIdent::ReadAgentIdent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("agent")) { this->SetAgent(StrToStr(element.attribute("agent").value())); - element.remove_attribute("agent"); + if (removeAttr) element.remove_attribute("agent"); hasAttribute = true; } return hasAttribute; @@ -82,12 +82,12 @@ void AttReasonIdent::ResetReasonIdent() m_reason = ""; } -bool AttReasonIdent::ReadReasonIdent(pugi::xml_node element) +bool AttReasonIdent::ReadReasonIdent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("reason")) { this->SetReason(StrToStr(element.attribute("reason").value())); - element.remove_attribute("reason"); + if (removeAttr) element.remove_attribute("reason"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_edittrans.h b/libmei/dist/atts_edittrans.h index 10965f823be..7a45fcb744c 100644 --- a/libmei/dist/atts_edittrans.h +++ b/libmei/dist/atts_edittrans.h @@ -38,7 +38,7 @@ class AttAgentIdent : public Att { void ResetAgentIdent(); /** Read the values for the attribute class **/ - bool ReadAgentIdent(pugi::xml_node element); + bool ReadAgentIdent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteAgentIdent(pugi::xml_node element); @@ -76,7 +76,7 @@ class AttReasonIdent : public Att { void ResetReasonIdent(); /** Read the values for the attribute class **/ - bool ReadReasonIdent(pugi::xml_node element); + bool ReadReasonIdent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteReasonIdent(pugi::xml_node element); diff --git a/libmei/dist/atts_externalsymbols.cpp b/libmei/dist/atts_externalsymbols.cpp index 69d051e7346..79e707f6f51 100644 --- a/libmei/dist/atts_externalsymbols.cpp +++ b/libmei/dist/atts_externalsymbols.cpp @@ -41,27 +41,27 @@ void AttExtSym::ResetExtSym() m_glyphUri = ""; } -bool AttExtSym::ReadExtSym(pugi::xml_node element) +bool AttExtSym::ReadExtSym(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("glyph.auth")) { this->SetGlyphAuth(StrToStr(element.attribute("glyph.auth").value())); - element.remove_attribute("glyph.auth"); + if (removeAttr) element.remove_attribute("glyph.auth"); hasAttribute = true; } if (element.attribute("glyph.name")) { this->SetGlyphName(StrToStr(element.attribute("glyph.name").value())); - element.remove_attribute("glyph.name"); + if (removeAttr) element.remove_attribute("glyph.name"); hasAttribute = true; } if (element.attribute("glyph.num")) { this->SetGlyphNum(StrToHexnum(element.attribute("glyph.num").value())); - element.remove_attribute("glyph.num"); + if (removeAttr) element.remove_attribute("glyph.num"); hasAttribute = true; } if (element.attribute("glyph.uri")) { this->SetGlyphUri(StrToStr(element.attribute("glyph.uri").value())); - element.remove_attribute("glyph.uri"); + if (removeAttr) element.remove_attribute("glyph.uri"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_externalsymbols.h b/libmei/dist/atts_externalsymbols.h index 37894ea9b3e..75b9dbf77b2 100644 --- a/libmei/dist/atts_externalsymbols.h +++ b/libmei/dist/atts_externalsymbols.h @@ -38,7 +38,7 @@ class AttExtSym : public Att { void ResetExtSym(); /** Read the values for the attribute class **/ - bool ReadExtSym(pugi::xml_node element); + bool ReadExtSym(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteExtSym(pugi::xml_node element); diff --git a/libmei/dist/atts_facsimile.cpp b/libmei/dist/atts_facsimile.cpp index cf0d2f37d63..485f2b9bfb7 100644 --- a/libmei/dist/atts_facsimile.cpp +++ b/libmei/dist/atts_facsimile.cpp @@ -38,12 +38,12 @@ void AttFacsimile::ResetFacsimile() m_facs = ""; } -bool AttFacsimile::ReadFacsimile(pugi::xml_node element) +bool AttFacsimile::ReadFacsimile(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("facs")) { this->SetFacs(StrToStr(element.attribute("facs").value())); - element.remove_attribute("facs"); + if (removeAttr) element.remove_attribute("facs"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_facsimile.h b/libmei/dist/atts_facsimile.h index 1c334ee07c3..9eded42a6ea 100644 --- a/libmei/dist/atts_facsimile.h +++ b/libmei/dist/atts_facsimile.h @@ -38,7 +38,7 @@ class AttFacsimile : public Att { void ResetFacsimile(); /** Read the values for the attribute class **/ - bool ReadFacsimile(pugi::xml_node element); + bool ReadFacsimile(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteFacsimile(pugi::xml_node element); diff --git a/libmei/dist/atts_figtable.cpp b/libmei/dist/atts_figtable.cpp index 310d439474d..d8782833cf0 100644 --- a/libmei/dist/atts_figtable.cpp +++ b/libmei/dist/atts_figtable.cpp @@ -39,17 +39,17 @@ void AttTabular::ResetTabular() m_rowspan = MEI_UNSET; } -bool AttTabular::ReadTabular(pugi::xml_node element) +bool AttTabular::ReadTabular(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("colspan")) { this->SetColspan(StrToInt(element.attribute("colspan").value())); - element.remove_attribute("colspan"); + if (removeAttr) element.remove_attribute("colspan"); hasAttribute = true; } if (element.attribute("rowspan")) { this->SetRowspan(StrToInt(element.attribute("rowspan").value())); - element.remove_attribute("rowspan"); + if (removeAttr) element.remove_attribute("rowspan"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_figtable.h b/libmei/dist/atts_figtable.h index 986633365d8..1a9cc85d284 100644 --- a/libmei/dist/atts_figtable.h +++ b/libmei/dist/atts_figtable.h @@ -38,7 +38,7 @@ class AttTabular : public Att { void ResetTabular(); /** Read the values for the attribute class **/ - bool ReadTabular(pugi::xml_node element); + bool ReadTabular(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTabular(pugi::xml_node element); diff --git a/libmei/dist/atts_fingering.cpp b/libmei/dist/atts_fingering.cpp index a77db2479a8..36772d355c3 100644 --- a/libmei/dist/atts_fingering.cpp +++ b/libmei/dist/atts_fingering.cpp @@ -38,12 +38,12 @@ void AttFingGrpLog::ResetFingGrpLog() m_form = fingGrpLog_FORM_NONE; } -bool AttFingGrpLog::ReadFingGrpLog(pugi::xml_node element) +bool AttFingGrpLog::ReadFingGrpLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToFingGrpLogForm(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_fingering.h b/libmei/dist/atts_fingering.h index 838ebb3ca7e..cd37996eee8 100644 --- a/libmei/dist/atts_fingering.h +++ b/libmei/dist/atts_fingering.h @@ -38,7 +38,7 @@ class AttFingGrpLog : public Att { void ResetFingGrpLog(); /** Read the values for the attribute class **/ - bool ReadFingGrpLog(pugi::xml_node element); + bool ReadFingGrpLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteFingGrpLog(pugi::xml_node element); diff --git a/libmei/dist/atts_frettab.cpp b/libmei/dist/atts_frettab.cpp index 36c2a2e127d..cd2e03cf123 100644 --- a/libmei/dist/atts_frettab.cpp +++ b/libmei/dist/atts_frettab.cpp @@ -38,12 +38,12 @@ void AttCourseLog::ResetCourseLog() m_tuningStandard = COURSETUNING_NONE; } -bool AttCourseLog::ReadCourseLog(pugi::xml_node element) +bool AttCourseLog::ReadCourseLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("tuning.standard")) { this->SetTuningStandard(StrToCoursetuning(element.attribute("tuning.standard").value())); - element.remove_attribute("tuning.standard"); + if (removeAttr) element.remove_attribute("tuning.standard"); hasAttribute = true; } return hasAttribute; @@ -83,17 +83,17 @@ void AttNoteGesTab::ResetNoteGesTab() m_tabFret = -1; } -bool AttNoteGesTab::ReadNoteGesTab(pugi::xml_node element) +bool AttNoteGesTab::ReadNoteGesTab(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("tab.course")) { this->SetTabCourse(StrToInt(element.attribute("tab.course").value())); - element.remove_attribute("tab.course"); + if (removeAttr) element.remove_attribute("tab.course"); hasAttribute = true; } if (element.attribute("tab.fret")) { this->SetTabFret(StrToInt(element.attribute("tab.fret").value())); - element.remove_attribute("tab.fret"); + if (removeAttr) element.remove_attribute("tab.fret"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_frettab.h b/libmei/dist/atts_frettab.h index 15fc58d76f4..31ec5a77e86 100644 --- a/libmei/dist/atts_frettab.h +++ b/libmei/dist/atts_frettab.h @@ -38,7 +38,7 @@ class AttCourseLog : public Att { void ResetCourseLog(); /** Read the values for the attribute class **/ - bool ReadCourseLog(pugi::xml_node element); + bool ReadCourseLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCourseLog(pugi::xml_node element); @@ -73,7 +73,7 @@ class AttNoteGesTab : public Att { void ResetNoteGesTab(); /** Read the values for the attribute class **/ - bool ReadNoteGesTab(pugi::xml_node element); + bool ReadNoteGesTab(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteNoteGesTab(pugi::xml_node element); diff --git a/libmei/dist/atts_gestural.cpp b/libmei/dist/atts_gestural.cpp index 37bea77d6f9..f1dd6229654 100644 --- a/libmei/dist/atts_gestural.cpp +++ b/libmei/dist/atts_gestural.cpp @@ -38,12 +38,12 @@ void AttAccidentalGes::ResetAccidentalGes() m_accidGes = ACCIDENTAL_GESTURAL_NONE; } -bool AttAccidentalGes::ReadAccidentalGes(pugi::xml_node element) +bool AttAccidentalGes::ReadAccidentalGes(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("accid.ges")) { this->SetAccidGes(StrToAccidentalGestural(element.attribute("accid.ges").value())); - element.remove_attribute("accid.ges"); + if (removeAttr) element.remove_attribute("accid.ges"); hasAttribute = true; } return hasAttribute; @@ -82,12 +82,12 @@ void AttArticulationGes::ResetArticulationGes() m_articGes = std::vector(); } -bool AttArticulationGes::ReadArticulationGes(pugi::xml_node element) +bool AttArticulationGes::ReadArticulationGes(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("artic.ges")) { this->SetArticGes(StrToArticulationList(element.attribute("artic.ges").value())); - element.remove_attribute("artic.ges"); + if (removeAttr) element.remove_attribute("artic.ges"); hasAttribute = true; } return hasAttribute; @@ -126,12 +126,12 @@ void AttBendGes::ResetBendGes() m_amount = 0.0; } -bool AttBendGes::ReadBendGes(pugi::xml_node element) +bool AttBendGes::ReadBendGes(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("amount")) { this->SetAmount(StrToDbl(element.attribute("amount").value())); - element.remove_attribute("amount"); + if (removeAttr) element.remove_attribute("amount"); hasAttribute = true; } return hasAttribute; @@ -175,37 +175,37 @@ void AttDurationGes::ResetDurationGes() m_durRecip = ""; } -bool AttDurationGes::ReadDurationGes(pugi::xml_node element) +bool AttDurationGes::ReadDurationGes(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("dur.ges")) { this->SetDurGes(StrToDuration(element.attribute("dur.ges").value())); - element.remove_attribute("dur.ges"); + if (removeAttr) element.remove_attribute("dur.ges"); hasAttribute = true; } if (element.attribute("dots.ges")) { this->SetDotsGes(StrToInt(element.attribute("dots.ges").value())); - element.remove_attribute("dots.ges"); + if (removeAttr) element.remove_attribute("dots.ges"); hasAttribute = true; } if (element.attribute("dur.metrical")) { this->SetDurMetrical(StrToDbl(element.attribute("dur.metrical").value())); - element.remove_attribute("dur.metrical"); + if (removeAttr) element.remove_attribute("dur.metrical"); hasAttribute = true; } if (element.attribute("dur.ppq")) { this->SetDurPpq(StrToInt(element.attribute("dur.ppq").value())); - element.remove_attribute("dur.ppq"); + if (removeAttr) element.remove_attribute("dur.ppq"); hasAttribute = true; } if (element.attribute("dur.real")) { this->SetDurReal(StrToDbl(element.attribute("dur.real").value())); - element.remove_attribute("dur.real"); + if (removeAttr) element.remove_attribute("dur.real"); hasAttribute = true; } if (element.attribute("dur.recip")) { this->SetDurRecip(StrToStr(element.attribute("dur.recip").value())); - element.remove_attribute("dur.recip"); + if (removeAttr) element.remove_attribute("dur.recip"); hasAttribute = true; } return hasAttribute; @@ -289,12 +289,12 @@ void AttMdivGes::ResetMdivGes() m_attacca = BOOLEAN_NONE; } -bool AttMdivGes::ReadMdivGes(pugi::xml_node element) +bool AttMdivGes::ReadMdivGes(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("attacca")) { this->SetAttacca(StrToBoolean(element.attribute("attacca").value())); - element.remove_attribute("attacca"); + if (removeAttr) element.remove_attribute("attacca"); hasAttribute = true; } return hasAttribute; @@ -335,22 +335,22 @@ void AttNcGes::ResetNcGes() m_pnum = MEI_UNSET; } -bool AttNcGes::ReadNcGes(pugi::xml_node element) +bool AttNcGes::ReadNcGes(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("oct.ges")) { this->SetOctGes(StrToOctave(element.attribute("oct.ges").value())); - element.remove_attribute("oct.ges"); + if (removeAttr) element.remove_attribute("oct.ges"); hasAttribute = true; } if (element.attribute("pname.ges")) { this->SetPnameGes(StrToPitchname(element.attribute("pname.ges").value())); - element.remove_attribute("pname.ges"); + if (removeAttr) element.remove_attribute("pname.ges"); hasAttribute = true; } if (element.attribute("pnum")) { this->SetPnum(StrToInt(element.attribute("pnum").value())); - element.remove_attribute("pnum"); + if (removeAttr) element.remove_attribute("pnum"); hasAttribute = true; } return hasAttribute; @@ -410,27 +410,27 @@ void AttNoteGes::ResetNoteGes() m_pnum = MEI_UNSET; } -bool AttNoteGes::ReadNoteGes(pugi::xml_node element) +bool AttNoteGes::ReadNoteGes(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("extremis")) { this->SetExtremis(StrToNoteGesExtremis(element.attribute("extremis").value())); - element.remove_attribute("extremis"); + if (removeAttr) element.remove_attribute("extremis"); hasAttribute = true; } if (element.attribute("oct.ges")) { this->SetOctGes(StrToOctave(element.attribute("oct.ges").value())); - element.remove_attribute("oct.ges"); + if (removeAttr) element.remove_attribute("oct.ges"); hasAttribute = true; } if (element.attribute("pname.ges")) { this->SetPnameGes(StrToPitchname(element.attribute("pname.ges").value())); - element.remove_attribute("pname.ges"); + if (removeAttr) element.remove_attribute("pname.ges"); hasAttribute = true; } if (element.attribute("pnum")) { this->SetPnum(StrToInt(element.attribute("pnum").value())); - element.remove_attribute("pnum"); + if (removeAttr) element.remove_attribute("pnum"); hasAttribute = true; } return hasAttribute; @@ -497,17 +497,17 @@ void AttOrnamentAccidGes::ResetOrnamentAccidGes() m_accidlowerGes = ACCIDENTAL_GESTURAL_NONE; } -bool AttOrnamentAccidGes::ReadOrnamentAccidGes(pugi::xml_node element) +bool AttOrnamentAccidGes::ReadOrnamentAccidGes(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("accidupper.ges")) { this->SetAccidupperGes(StrToAccidentalGestural(element.attribute("accidupper.ges").value())); - element.remove_attribute("accidupper.ges"); + if (removeAttr) element.remove_attribute("accidupper.ges"); hasAttribute = true; } if (element.attribute("accidlower.ges")) { this->SetAccidlowerGes(StrToAccidentalGestural(element.attribute("accidlower.ges").value())); - element.remove_attribute("accidlower.ges"); + if (removeAttr) element.remove_attribute("accidlower.ges"); hasAttribute = true; } return hasAttribute; @@ -555,12 +555,12 @@ void AttSectionGes::ResetSectionGes() m_attacca = BOOLEAN_NONE; } -bool AttSectionGes::ReadSectionGes(pugi::xml_node element) +bool AttSectionGes::ReadSectionGes(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("attacca")) { this->SetAttacca(StrToBoolean(element.attribute("attacca").value())); - element.remove_attribute("attacca"); + if (removeAttr) element.remove_attribute("attacca"); hasAttribute = true; } return hasAttribute; @@ -600,17 +600,17 @@ void AttSoundLocation::ResetSoundLocation() m_elevation = 0.0; } -bool AttSoundLocation::ReadSoundLocation(pugi::xml_node element) +bool AttSoundLocation::ReadSoundLocation(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("azimuth")) { this->SetAzimuth(StrToDbl(element.attribute("azimuth").value())); - element.remove_attribute("azimuth"); + if (removeAttr) element.remove_attribute("azimuth"); hasAttribute = true; } if (element.attribute("elevation")) { this->SetElevation(StrToDbl(element.attribute("elevation").value())); - element.remove_attribute("elevation"); + if (removeAttr) element.remove_attribute("elevation"); hasAttribute = true; } return hasAttribute; @@ -659,17 +659,17 @@ void AttTimestampGes::ResetTimestampGes() m_tstampReal = ""; } -bool AttTimestampGes::ReadTimestampGes(pugi::xml_node element) +bool AttTimestampGes::ReadTimestampGes(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("tstamp.ges")) { this->SetTstampGes(StrToDbl(element.attribute("tstamp.ges").value())); - element.remove_attribute("tstamp.ges"); + if (removeAttr) element.remove_attribute("tstamp.ges"); hasAttribute = true; } if (element.attribute("tstamp.real")) { this->SetTstampReal(StrToStr(element.attribute("tstamp.real").value())); - element.remove_attribute("tstamp.real"); + if (removeAttr) element.remove_attribute("tstamp.real"); hasAttribute = true; } return hasAttribute; @@ -718,17 +718,17 @@ void AttTimestamp2Ges::ResetTimestamp2Ges() m_tstamp2Real = ""; } -bool AttTimestamp2Ges::ReadTimestamp2Ges(pugi::xml_node element) +bool AttTimestamp2Ges::ReadTimestamp2Ges(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("tstamp2.ges")) { this->SetTstamp2Ges(StrToMeasurebeat(element.attribute("tstamp2.ges").value())); - element.remove_attribute("tstamp2.ges"); + if (removeAttr) element.remove_attribute("tstamp2.ges"); hasAttribute = true; } if (element.attribute("tstamp2.real")) { this->SetTstamp2Real(StrToStr(element.attribute("tstamp2.real").value())); - element.remove_attribute("tstamp2.real"); + if (removeAttr) element.remove_attribute("tstamp2.real"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_gestural.h b/libmei/dist/atts_gestural.h index 5d2bd250c32..bf231079845 100644 --- a/libmei/dist/atts_gestural.h +++ b/libmei/dist/atts_gestural.h @@ -38,7 +38,7 @@ class AttAccidentalGes : public Att { void ResetAccidentalGes(); /** Read the values for the attribute class **/ - bool ReadAccidentalGes(pugi::xml_node element); + bool ReadAccidentalGes(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteAccidentalGes(pugi::xml_node element); @@ -73,7 +73,7 @@ class AttArticulationGes : public Att { void ResetArticulationGes(); /** Read the values for the attribute class **/ - bool ReadArticulationGes(pugi::xml_node element); + bool ReadArticulationGes(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteArticulationGes(pugi::xml_node element); @@ -108,7 +108,7 @@ class AttBendGes : public Att { void ResetBendGes(); /** Read the values for the attribute class **/ - bool ReadBendGes(pugi::xml_node element); + bool ReadBendGes(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBendGes(pugi::xml_node element); @@ -147,7 +147,7 @@ class AttDurationGes : public Att { void ResetDurationGes(); /** Read the values for the attribute class **/ - bool ReadDurationGes(pugi::xml_node element); + bool ReadDurationGes(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteDurationGes(pugi::xml_node element); @@ -218,7 +218,7 @@ class AttMdivGes : public Att { void ResetMdivGes(); /** Read the values for the attribute class **/ - bool ReadMdivGes(pugi::xml_node element); + bool ReadMdivGes(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMdivGes(pugi::xml_node element); @@ -256,7 +256,7 @@ class AttNcGes : public Att { void ResetNcGes(); /** Read the values for the attribute class **/ - bool ReadNcGes(pugi::xml_node element); + bool ReadNcGes(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteNcGes(pugi::xml_node element); @@ -303,7 +303,7 @@ class AttNoteGes : public Att { void ResetNoteGes(); /** Read the values for the attribute class **/ - bool ReadNoteGes(pugi::xml_node element); + bool ReadNoteGes(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteNoteGes(pugi::xml_node element); @@ -356,7 +356,7 @@ class AttOrnamentAccidGes : public Att { void ResetOrnamentAccidGes(); /** Read the values for the attribute class **/ - bool ReadOrnamentAccidGes(pugi::xml_node element); + bool ReadOrnamentAccidGes(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteOrnamentAccidGes(pugi::xml_node element); @@ -397,7 +397,7 @@ class AttSectionGes : public Att { void ResetSectionGes(); /** Read the values for the attribute class **/ - bool ReadSectionGes(pugi::xml_node element); + bool ReadSectionGes(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSectionGes(pugi::xml_node element); @@ -435,7 +435,7 @@ class AttSoundLocation : public Att { void ResetSoundLocation(); /** Read the values for the attribute class **/ - bool ReadSoundLocation(pugi::xml_node element); + bool ReadSoundLocation(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSoundLocation(pugi::xml_node element); @@ -476,7 +476,7 @@ class AttTimestampGes : public Att { void ResetTimestampGes(); /** Read the values for the attribute class **/ - bool ReadTimestampGes(pugi::xml_node element); + bool ReadTimestampGes(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTimestampGes(pugi::xml_node element); @@ -520,7 +520,7 @@ class AttTimestamp2Ges : public Att { void ResetTimestamp2Ges(); /** Read the values for the attribute class **/ - bool ReadTimestamp2Ges(pugi::xml_node element); + bool ReadTimestamp2Ges(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTimestamp2Ges(pugi::xml_node element); diff --git a/libmei/dist/atts_harmony.cpp b/libmei/dist/atts_harmony.cpp index 32170bef404..14580dac342 100644 --- a/libmei/dist/atts_harmony.cpp +++ b/libmei/dist/atts_harmony.cpp @@ -38,12 +38,12 @@ void AttHarmLog::ResetHarmLog() m_chordref = ""; } -bool AttHarmLog::ReadHarmLog(pugi::xml_node element) +bool AttHarmLog::ReadHarmLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("chordref")) { this->SetChordref(StrToStr(element.attribute("chordref").value())); - element.remove_attribute("chordref"); + if (removeAttr) element.remove_attribute("chordref"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_harmony.h b/libmei/dist/atts_harmony.h index 83c27226983..730604b38d2 100644 --- a/libmei/dist/atts_harmony.h +++ b/libmei/dist/atts_harmony.h @@ -38,7 +38,7 @@ class AttHarmLog : public Att { void ResetHarmLog(); /** Read the values for the attribute class **/ - bool ReadHarmLog(pugi::xml_node element); + bool ReadHarmLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteHarmLog(pugi::xml_node element); diff --git a/libmei/dist/atts_header.cpp b/libmei/dist/atts_header.cpp index 587dfbe9e41..824cb9c330a 100644 --- a/libmei/dist/atts_header.cpp +++ b/libmei/dist/atts_header.cpp @@ -41,27 +41,27 @@ void AttBifoliumSurfaces::ResetBifoliumSurfaces() m_outerVerso = ""; } -bool AttBifoliumSurfaces::ReadBifoliumSurfaces(pugi::xml_node element) +bool AttBifoliumSurfaces::ReadBifoliumSurfaces(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("outer.recto")) { this->SetOuterRecto(StrToStr(element.attribute("outer.recto").value())); - element.remove_attribute("outer.recto"); + if (removeAttr) element.remove_attribute("outer.recto"); hasAttribute = true; } if (element.attribute("inner.verso")) { this->SetInnerVerso(StrToStr(element.attribute("inner.verso").value())); - element.remove_attribute("inner.verso"); + if (removeAttr) element.remove_attribute("inner.verso"); hasAttribute = true; } if (element.attribute("inner.recto")) { this->SetInnerRecto(StrToStr(element.attribute("inner.recto").value())); - element.remove_attribute("inner.recto"); + if (removeAttr) element.remove_attribute("inner.recto"); hasAttribute = true; } if (element.attribute("outer.verso")) { this->SetOuterVerso(StrToStr(element.attribute("outer.verso").value())); - element.remove_attribute("outer.verso"); + if (removeAttr) element.remove_attribute("outer.verso"); hasAttribute = true; } return hasAttribute; @@ -128,17 +128,17 @@ void AttFoliumSurfaces::ResetFoliumSurfaces() m_verso = ""; } -bool AttFoliumSurfaces::ReadFoliumSurfaces(pugi::xml_node element) +bool AttFoliumSurfaces::ReadFoliumSurfaces(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("recto")) { this->SetRecto(StrToStr(element.attribute("recto").value())); - element.remove_attribute("recto"); + if (removeAttr) element.remove_attribute("recto"); hasAttribute = true; } if (element.attribute("verso")) { this->SetVerso(StrToStr(element.attribute("verso").value())); - element.remove_attribute("verso"); + if (removeAttr) element.remove_attribute("verso"); hasAttribute = true; } return hasAttribute; @@ -186,12 +186,12 @@ void AttRecordType::ResetRecordType() m_recordtype = recordType_RECORDTYPE_NONE; } -bool AttRecordType::ReadRecordType(pugi::xml_node element) +bool AttRecordType::ReadRecordType(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("recordtype")) { this->SetRecordtype(StrToRecordTypeRecordtype(element.attribute("recordtype").value())); - element.remove_attribute("recordtype"); + if (removeAttr) element.remove_attribute("recordtype"); hasAttribute = true; } return hasAttribute; @@ -230,12 +230,12 @@ void AttRegularMethod::ResetRegularMethod() m_method = regularMethod_METHOD_NONE; } -bool AttRegularMethod::ReadRegularMethod(pugi::xml_node element) +bool AttRegularMethod::ReadRegularMethod(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("method")) { this->SetMethod(StrToRegularMethodMethod(element.attribute("method").value())); - element.remove_attribute("method"); + if (removeAttr) element.remove_attribute("method"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_header.h b/libmei/dist/atts_header.h index 70985235e91..5cc343ce52e 100644 --- a/libmei/dist/atts_header.h +++ b/libmei/dist/atts_header.h @@ -38,7 +38,7 @@ class AttBifoliumSurfaces : public Att { void ResetBifoliumSurfaces(); /** Read the values for the attribute class **/ - bool ReadBifoliumSurfaces(pugi::xml_node element); + bool ReadBifoliumSurfaces(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBifoliumSurfaces(pugi::xml_node element); @@ -103,7 +103,7 @@ class AttFoliumSurfaces : public Att { void ResetFoliumSurfaces(); /** Read the values for the attribute class **/ - bool ReadFoliumSurfaces(pugi::xml_node element); + bool ReadFoliumSurfaces(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteFoliumSurfaces(pugi::xml_node element); @@ -144,7 +144,7 @@ class AttRecordType : public Att { void ResetRecordType(); /** Read the values for the attribute class **/ - bool ReadRecordType(pugi::xml_node element); + bool ReadRecordType(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteRecordType(pugi::xml_node element); @@ -179,7 +179,7 @@ class AttRegularMethod : public Att { void ResetRegularMethod(); /** Read the values for the attribute class **/ - bool ReadRegularMethod(pugi::xml_node element); + bool ReadRegularMethod(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteRegularMethod(pugi::xml_node element); diff --git a/libmei/dist/atts_mei.cpp b/libmei/dist/atts_mei.cpp index 2e9de29bd29..395ccf3fd6b 100644 --- a/libmei/dist/atts_mei.cpp +++ b/libmei/dist/atts_mei.cpp @@ -39,17 +39,17 @@ void AttNotationType::ResetNotationType() m_notationsubtype = ""; } -bool AttNotationType::ReadNotationType(pugi::xml_node element) +bool AttNotationType::ReadNotationType(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("notationtype")) { this->SetNotationtype(StrToNotationtype(element.attribute("notationtype").value())); - element.remove_attribute("notationtype"); + if (removeAttr) element.remove_attribute("notationtype"); hasAttribute = true; } if (element.attribute("notationsubtype")) { this->SetNotationsubtype(StrToStr(element.attribute("notationsubtype").value())); - element.remove_attribute("notationsubtype"); + if (removeAttr) element.remove_attribute("notationsubtype"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_mei.h b/libmei/dist/atts_mei.h index 091aabdbc02..07fe6809c23 100644 --- a/libmei/dist/atts_mei.h +++ b/libmei/dist/atts_mei.h @@ -38,7 +38,7 @@ class AttNotationType : public Att { void ResetNotationType(); /** Read the values for the attribute class **/ - bool ReadNotationType(pugi::xml_node element); + bool ReadNotationType(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteNotationType(pugi::xml_node element); diff --git a/libmei/dist/atts_mensural.cpp b/libmei/dist/atts_mensural.cpp index 58a93b69ed0..f798f44713c 100644 --- a/libmei/dist/atts_mensural.cpp +++ b/libmei/dist/atts_mensural.cpp @@ -38,12 +38,12 @@ void AttDurationQuality::ResetDurationQuality() m_durQuality = DURQUALITY_mensural_NONE; } -bool AttDurationQuality::ReadDurationQuality(pugi::xml_node element) +bool AttDurationQuality::ReadDurationQuality(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("dur.quality")) { this->SetDurQuality(StrToDurqualityMensural(element.attribute("dur.quality").value())); - element.remove_attribute("dur.quality"); + if (removeAttr) element.remove_attribute("dur.quality"); hasAttribute = true; } return hasAttribute; @@ -83,17 +83,17 @@ void AttMensuralLog::ResetMensuralLog() m_proportNumbase = MEI_UNSET; } -bool AttMensuralLog::ReadMensuralLog(pugi::xml_node element) +bool AttMensuralLog::ReadMensuralLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("proport.num")) { this->SetProportNum(StrToInt(element.attribute("proport.num").value())); - element.remove_attribute("proport.num"); + if (removeAttr) element.remove_attribute("proport.num"); hasAttribute = true; } if (element.attribute("proport.numbase")) { this->SetProportNumbase(StrToInt(element.attribute("proport.numbase").value())); - element.remove_attribute("proport.numbase"); + if (removeAttr) element.remove_attribute("proport.numbase"); hasAttribute = true; } return hasAttribute; @@ -145,32 +145,32 @@ void AttMensuralShared::ResetMensuralShared() m_divisio = DIVISIO_NONE; } -bool AttMensuralShared::ReadMensuralShared(pugi::xml_node element) +bool AttMensuralShared::ReadMensuralShared(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("modusmaior")) { this->SetModusmaior(StrToModusmaior(element.attribute("modusmaior").value())); - element.remove_attribute("modusmaior"); + if (removeAttr) element.remove_attribute("modusmaior"); hasAttribute = true; } if (element.attribute("modusminor")) { this->SetModusminor(StrToModusminor(element.attribute("modusminor").value())); - element.remove_attribute("modusminor"); + if (removeAttr) element.remove_attribute("modusminor"); hasAttribute = true; } if (element.attribute("prolatio")) { this->SetProlatio(StrToProlatio(element.attribute("prolatio").value())); - element.remove_attribute("prolatio"); + if (removeAttr) element.remove_attribute("prolatio"); hasAttribute = true; } if (element.attribute("tempus")) { this->SetTempus(StrToTempus(element.attribute("tempus").value())); - element.remove_attribute("tempus"); + if (removeAttr) element.remove_attribute("tempus"); hasAttribute = true; } if (element.attribute("divisio")) { this->SetDivisio(StrToDivisio(element.attribute("divisio").value())); - element.remove_attribute("divisio"); + if (removeAttr) element.remove_attribute("divisio"); hasAttribute = true; } return hasAttribute; @@ -245,12 +245,12 @@ void AttNoteVisMensural::ResetNoteVisMensural() m_lig = LIGATUREFORM_NONE; } -bool AttNoteVisMensural::ReadNoteVisMensural(pugi::xml_node element) +bool AttNoteVisMensural::ReadNoteVisMensural(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("lig")) { this->SetLig(StrToLigatureform(element.attribute("lig").value())); - element.remove_attribute("lig"); + if (removeAttr) element.remove_attribute("lig"); hasAttribute = true; } return hasAttribute; @@ -289,12 +289,12 @@ void AttRestVisMensural::ResetRestVisMensural() m_spaces = MEI_UNSET; } -bool AttRestVisMensural::ReadRestVisMensural(pugi::xml_node element) +bool AttRestVisMensural::ReadRestVisMensural(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("spaces")) { this->SetSpaces(StrToInt(element.attribute("spaces").value())); - element.remove_attribute("spaces"); + if (removeAttr) element.remove_attribute("spaces"); hasAttribute = true; } return hasAttribute; @@ -333,12 +333,12 @@ void AttStemsMensural::ResetStemsMensural() m_stemForm = STEMFORM_mensural_NONE; } -bool AttStemsMensural::ReadStemsMensural(pugi::xml_node element) +bool AttStemsMensural::ReadStemsMensural(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("stem.form")) { this->SetStemForm(StrToStemformMensural(element.attribute("stem.form").value())); - element.remove_attribute("stem.form"); + if (removeAttr) element.remove_attribute("stem.form"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_mensural.h b/libmei/dist/atts_mensural.h index b50a0721229..47386db00c5 100644 --- a/libmei/dist/atts_mensural.h +++ b/libmei/dist/atts_mensural.h @@ -38,7 +38,7 @@ class AttDurationQuality : public Att { void ResetDurationQuality(); /** Read the values for the attribute class **/ - bool ReadDurationQuality(pugi::xml_node element); + bool ReadDurationQuality(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteDurationQuality(pugi::xml_node element); @@ -77,7 +77,7 @@ class AttMensuralLog : public Att { void ResetMensuralLog(); /** Read the values for the attribute class **/ - bool ReadMensuralLog(pugi::xml_node element); + bool ReadMensuralLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMensuralLog(pugi::xml_node element); @@ -126,7 +126,7 @@ class AttMensuralShared : public Att { void ResetMensuralShared(); /** Read the values for the attribute class **/ - bool ReadMensuralShared(pugi::xml_node element); + bool ReadMensuralShared(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMensuralShared(pugi::xml_node element); @@ -185,7 +185,7 @@ class AttNoteVisMensural : public Att { void ResetNoteVisMensural(); /** Read the values for the attribute class **/ - bool ReadNoteVisMensural(pugi::xml_node element); + bool ReadNoteVisMensural(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteNoteVisMensural(pugi::xml_node element); @@ -220,7 +220,7 @@ class AttRestVisMensural : public Att { void ResetRestVisMensural(); /** Read the values for the attribute class **/ - bool ReadRestVisMensural(pugi::xml_node element); + bool ReadRestVisMensural(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteRestVisMensural(pugi::xml_node element); @@ -255,7 +255,7 @@ class AttStemsMensural : public Att { void ResetStemsMensural(); /** Read the values for the attribute class **/ - bool ReadStemsMensural(pugi::xml_node element); + bool ReadStemsMensural(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStemsMensural(pugi::xml_node element); diff --git a/libmei/dist/atts_midi.cpp b/libmei/dist/atts_midi.cpp index b80b6688d15..75d43a647ad 100644 --- a/libmei/dist/atts_midi.cpp +++ b/libmei/dist/atts_midi.cpp @@ -41,27 +41,27 @@ void AttChannelized::ResetChannelized() m_midiTrack = MEI_UNSET; } -bool AttChannelized::ReadChannelized(pugi::xml_node element) +bool AttChannelized::ReadChannelized(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("midi.channel")) { this->SetMidiChannel(StrToMidichannel(element.attribute("midi.channel").value())); - element.remove_attribute("midi.channel"); + if (removeAttr) element.remove_attribute("midi.channel"); hasAttribute = true; } if (element.attribute("midi.duty")) { this->SetMidiDuty(StrToPercentLimited(element.attribute("midi.duty").value())); - element.remove_attribute("midi.duty"); + if (removeAttr) element.remove_attribute("midi.duty"); hasAttribute = true; } if (element.attribute("midi.port")) { this->SetMidiPort(StrToMidivalueName(element.attribute("midi.port").value())); - element.remove_attribute("midi.port"); + if (removeAttr) element.remove_attribute("midi.port"); hasAttribute = true; } if (element.attribute("midi.track")) { this->SetMidiTrack(StrToInt(element.attribute("midi.track").value())); - element.remove_attribute("midi.track"); + if (removeAttr) element.remove_attribute("midi.track"); hasAttribute = true; } return hasAttribute; @@ -127,12 +127,12 @@ void AttInstrumentIdent::ResetInstrumentIdent() m_instr = ""; } -bool AttInstrumentIdent::ReadInstrumentIdent(pugi::xml_node element) +bool AttInstrumentIdent::ReadInstrumentIdent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("instr")) { this->SetInstr(StrToStr(element.attribute("instr").value())); - element.remove_attribute("instr"); + if (removeAttr) element.remove_attribute("instr"); hasAttribute = true; } return hasAttribute; @@ -176,37 +176,37 @@ void AttMidiInstrument::ResetMidiInstrument() m_midiVolume = -1.0; } -bool AttMidiInstrument::ReadMidiInstrument(pugi::xml_node element) +bool AttMidiInstrument::ReadMidiInstrument(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("midi.instrnum")) { this->SetMidiInstrnum(StrToMidivalue(element.attribute("midi.instrnum").value())); - element.remove_attribute("midi.instrnum"); + if (removeAttr) element.remove_attribute("midi.instrnum"); hasAttribute = true; } if (element.attribute("midi.instrname")) { this->SetMidiInstrname(StrToMidinames(element.attribute("midi.instrname").value())); - element.remove_attribute("midi.instrname"); + if (removeAttr) element.remove_attribute("midi.instrname"); hasAttribute = true; } if (element.attribute("midi.pan")) { this->SetMidiPan(StrToMidivaluePan(element.attribute("midi.pan").value())); - element.remove_attribute("midi.pan"); + if (removeAttr) element.remove_attribute("midi.pan"); hasAttribute = true; } if (element.attribute("midi.patchname")) { this->SetMidiPatchname(StrToStr(element.attribute("midi.patchname").value())); - element.remove_attribute("midi.patchname"); + if (removeAttr) element.remove_attribute("midi.patchname"); hasAttribute = true; } if (element.attribute("midi.patchnum")) { this->SetMidiPatchnum(StrToMidivalue(element.attribute("midi.patchnum").value())); - element.remove_attribute("midi.patchnum"); + if (removeAttr) element.remove_attribute("midi.patchnum"); hasAttribute = true; } if (element.attribute("midi.volume")) { this->SetMidiVolume(StrToPercent(element.attribute("midi.volume").value())); - element.remove_attribute("midi.volume"); + if (removeAttr) element.remove_attribute("midi.volume"); hasAttribute = true; } return hasAttribute; @@ -290,12 +290,12 @@ void AttMidiNumber::ResetMidiNumber() m_num = -1; } -bool AttMidiNumber::ReadMidiNumber(pugi::xml_node element) +bool AttMidiNumber::ReadMidiNumber(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("num")) { this->SetNum(StrToMidivalue(element.attribute("num").value())); - element.remove_attribute("num"); + if (removeAttr) element.remove_attribute("num"); hasAttribute = true; } return hasAttribute; @@ -335,17 +335,17 @@ void AttMidiTempo::ResetMidiTempo() m_midiMspb = -1; } -bool AttMidiTempo::ReadMidiTempo(pugi::xml_node element) +bool AttMidiTempo::ReadMidiTempo(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("midi.bpm")) { this->SetMidiBpm(StrToDbl(element.attribute("midi.bpm").value())); - element.remove_attribute("midi.bpm"); + if (removeAttr) element.remove_attribute("midi.bpm"); hasAttribute = true; } if (element.attribute("midi.mspb")) { this->SetMidiMspb(StrToMidimspb(element.attribute("midi.mspb").value())); - element.remove_attribute("midi.mspb"); + if (removeAttr) element.remove_attribute("midi.mspb"); hasAttribute = true; } return hasAttribute; @@ -393,12 +393,12 @@ void AttMidiValue::ResetMidiValue() m_val = -1; } -bool AttMidiValue::ReadMidiValue(pugi::xml_node element) +bool AttMidiValue::ReadMidiValue(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("val")) { this->SetVal(StrToMidivalue(element.attribute("val").value())); - element.remove_attribute("val"); + if (removeAttr) element.remove_attribute("val"); hasAttribute = true; } return hasAttribute; @@ -437,12 +437,12 @@ void AttMidiValue2::ResetMidiValue2() m_val2 = -1; } -bool AttMidiValue2::ReadMidiValue2(pugi::xml_node element) +bool AttMidiValue2::ReadMidiValue2(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("val2")) { this->SetVal2(StrToMidivalue(element.attribute("val2").value())); - element.remove_attribute("val2"); + if (removeAttr) element.remove_attribute("val2"); hasAttribute = true; } return hasAttribute; @@ -481,12 +481,12 @@ void AttMidiVelocity::ResetMidiVelocity() m_vel = -1; } -bool AttMidiVelocity::ReadMidiVelocity(pugi::xml_node element) +bool AttMidiVelocity::ReadMidiVelocity(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("vel")) { this->SetVel(StrToMidivalue(element.attribute("vel").value())); - element.remove_attribute("vel"); + if (removeAttr) element.remove_attribute("vel"); hasAttribute = true; } return hasAttribute; @@ -525,12 +525,12 @@ void AttTimeBase::ResetTimeBase() m_ppq = MEI_UNSET; } -bool AttTimeBase::ReadTimeBase(pugi::xml_node element) +bool AttTimeBase::ReadTimeBase(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("ppq")) { this->SetPpq(StrToInt(element.attribute("ppq").value())); - element.remove_attribute("ppq"); + if (removeAttr) element.remove_attribute("ppq"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_midi.h b/libmei/dist/atts_midi.h index c400dbbe02d..1e1ad3eaeeb 100644 --- a/libmei/dist/atts_midi.h +++ b/libmei/dist/atts_midi.h @@ -38,7 +38,7 @@ class AttChannelized : public Att { void ResetChannelized(); /** Read the values for the attribute class **/ - bool ReadChannelized(pugi::xml_node element); + bool ReadChannelized(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteChannelized(pugi::xml_node element); @@ -91,7 +91,7 @@ class AttInstrumentIdent : public Att { void ResetInstrumentIdent(); /** Read the values for the attribute class **/ - bool ReadInstrumentIdent(pugi::xml_node element); + bool ReadInstrumentIdent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteInstrumentIdent(pugi::xml_node element); @@ -129,7 +129,7 @@ class AttMidiInstrument : public Att { void ResetMidiInstrument(); /** Read the values for the attribute class **/ - bool ReadMidiInstrument(pugi::xml_node element); + bool ReadMidiInstrument(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMidiInstrument(pugi::xml_node element); @@ -203,7 +203,7 @@ class AttMidiNumber : public Att { void ResetMidiNumber(); /** Read the values for the attribute class **/ - bool ReadMidiNumber(pugi::xml_node element); + bool ReadMidiNumber(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMidiNumber(pugi::xml_node element); @@ -238,7 +238,7 @@ class AttMidiTempo : public Att { void ResetMidiTempo(); /** Read the values for the attribute class **/ - bool ReadMidiTempo(pugi::xml_node element); + bool ReadMidiTempo(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMidiTempo(pugi::xml_node element); @@ -288,7 +288,7 @@ class AttMidiValue : public Att { void ResetMidiValue(); /** Read the values for the attribute class **/ - bool ReadMidiValue(pugi::xml_node element); + bool ReadMidiValue(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMidiValue(pugi::xml_node element); @@ -323,7 +323,7 @@ class AttMidiValue2 : public Att { void ResetMidiValue2(); /** Read the values for the attribute class **/ - bool ReadMidiValue2(pugi::xml_node element); + bool ReadMidiValue2(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMidiValue2(pugi::xml_node element); @@ -358,7 +358,7 @@ class AttMidiVelocity : public Att { void ResetMidiVelocity(); /** Read the values for the attribute class **/ - bool ReadMidiVelocity(pugi::xml_node element); + bool ReadMidiVelocity(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMidiVelocity(pugi::xml_node element); @@ -393,7 +393,7 @@ class AttTimeBase : public Att { void ResetTimeBase(); /** Read the values for the attribute class **/ - bool ReadTimeBase(pugi::xml_node element); + bool ReadTimeBase(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTimeBase(pugi::xml_node element); diff --git a/libmei/dist/atts_neumes.cpp b/libmei/dist/atts_neumes.cpp index bb5c2b06872..ace74426456 100644 --- a/libmei/dist/atts_neumes.cpp +++ b/libmei/dist/atts_neumes.cpp @@ -39,17 +39,17 @@ void AttNcLog::ResetNcLog() m_pname = ""; } -bool AttNcLog::ReadNcLog(pugi::xml_node element) +bool AttNcLog::ReadNcLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("oct")) { this->SetOct(StrToStr(element.attribute("oct").value())); - element.remove_attribute("oct"); + if (removeAttr) element.remove_attribute("oct"); hasAttribute = true; } if (element.attribute("pname")) { this->SetPname(StrToStr(element.attribute("pname").value())); - element.remove_attribute("pname"); + if (removeAttr) element.remove_attribute("pname"); hasAttribute = true; } return hasAttribute; @@ -104,47 +104,47 @@ void AttNcForm::ResetNcForm() m_tilt = data_COMPASSDIRECTION(); } -bool AttNcForm::ReadNcForm(pugi::xml_node element) +bool AttNcForm::ReadNcForm(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("angled")) { this->SetAngled(StrToBoolean(element.attribute("angled").value())); - element.remove_attribute("angled"); + if (removeAttr) element.remove_attribute("angled"); hasAttribute = true; } if (element.attribute("con")) { this->SetCon(StrToNcFormCon(element.attribute("con").value())); - element.remove_attribute("con"); + if (removeAttr) element.remove_attribute("con"); hasAttribute = true; } if (element.attribute("curve")) { this->SetCurve(StrToNcFormCurve(element.attribute("curve").value())); - element.remove_attribute("curve"); + if (removeAttr) element.remove_attribute("curve"); hasAttribute = true; } if (element.attribute("hooked")) { this->SetHooked(StrToBoolean(element.attribute("hooked").value())); - element.remove_attribute("hooked"); + if (removeAttr) element.remove_attribute("hooked"); hasAttribute = true; } if (element.attribute("ligated")) { this->SetLigated(StrToBoolean(element.attribute("ligated").value())); - element.remove_attribute("ligated"); + if (removeAttr) element.remove_attribute("ligated"); hasAttribute = true; } if (element.attribute("rellen")) { this->SetRellen(StrToNcFormRellen(element.attribute("rellen").value())); - element.remove_attribute("rellen"); + if (removeAttr) element.remove_attribute("rellen"); hasAttribute = true; } if (element.attribute("sShape")) { this->SetSShape(StrToStr(element.attribute("sShape").value())); - element.remove_attribute("sShape"); + if (removeAttr) element.remove_attribute("sShape"); hasAttribute = true; } if (element.attribute("tilt")) { this->SetTilt(StrToCompassdirection(element.attribute("tilt").value())); - element.remove_attribute("tilt"); + if (removeAttr) element.remove_attribute("tilt"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_neumes.h b/libmei/dist/atts_neumes.h index 895eeb213d1..c63679f5882 100644 --- a/libmei/dist/atts_neumes.h +++ b/libmei/dist/atts_neumes.h @@ -38,7 +38,7 @@ class AttNcLog : public Att { void ResetNcLog(); /** Read the values for the attribute class **/ - bool ReadNcLog(pugi::xml_node element); + bool ReadNcLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteNcLog(pugi::xml_node element); @@ -79,7 +79,7 @@ class AttNcForm : public Att { void ResetNcForm(); /** Read the values for the attribute class **/ - bool ReadNcForm(pugi::xml_node element); + bool ReadNcForm(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteNcForm(pugi::xml_node element); diff --git a/libmei/dist/atts_pagebased.cpp b/libmei/dist/atts_pagebased.cpp index 3511117b00e..94c891e9000 100644 --- a/libmei/dist/atts_pagebased.cpp +++ b/libmei/dist/atts_pagebased.cpp @@ -41,27 +41,27 @@ void AttMargins::ResetMargins() m_rightmar = data_MEASUREMENTUNSIGNED(); } -bool AttMargins::ReadMargins(pugi::xml_node element) +bool AttMargins::ReadMargins(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("topmar")) { this->SetTopmar(StrToMeasurementunsigned(element.attribute("topmar").value())); - element.remove_attribute("topmar"); + if (removeAttr) element.remove_attribute("topmar"); hasAttribute = true; } if (element.attribute("botmar")) { this->SetBotmar(StrToMeasurementunsigned(element.attribute("botmar").value())); - element.remove_attribute("botmar"); + if (removeAttr) element.remove_attribute("botmar"); hasAttribute = true; } if (element.attribute("leftmar")) { this->SetLeftmar(StrToMeasurementunsigned(element.attribute("leftmar").value())); - element.remove_attribute("leftmar"); + if (removeAttr) element.remove_attribute("leftmar"); hasAttribute = true; } if (element.attribute("rightmar")) { this->SetRightmar(StrToMeasurementunsigned(element.attribute("rightmar").value())); - element.remove_attribute("rightmar"); + if (removeAttr) element.remove_attribute("rightmar"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_pagebased.h b/libmei/dist/atts_pagebased.h index 2febcfa8c0a..34d9dafef67 100644 --- a/libmei/dist/atts_pagebased.h +++ b/libmei/dist/atts_pagebased.h @@ -38,7 +38,7 @@ class AttMargins : public Att { void ResetMargins(); /** Read the values for the attribute class **/ - bool ReadMargins(pugi::xml_node element); + bool ReadMargins(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMargins(pugi::xml_node element); diff --git a/libmei/dist/atts_performance.cpp b/libmei/dist/atts_performance.cpp index b3f28cd29a7..865026751d1 100644 --- a/libmei/dist/atts_performance.cpp +++ b/libmei/dist/atts_performance.cpp @@ -38,12 +38,12 @@ void AttAlignment::ResetAlignment() m_when = ""; } -bool AttAlignment::ReadAlignment(pugi::xml_node element) +bool AttAlignment::ReadAlignment(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("when")) { this->SetWhen(StrToStr(element.attribute("when").value())); - element.remove_attribute("when"); + if (removeAttr) element.remove_attribute("when"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_performance.h b/libmei/dist/atts_performance.h index 119de0001d5..dbdb8508183 100644 --- a/libmei/dist/atts_performance.h +++ b/libmei/dist/atts_performance.h @@ -38,7 +38,7 @@ class AttAlignment : public Att { void ResetAlignment(); /** Read the values for the attribute class **/ - bool ReadAlignment(pugi::xml_node element); + bool ReadAlignment(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteAlignment(pugi::xml_node element); diff --git a/libmei/dist/atts_shared.cpp b/libmei/dist/atts_shared.cpp index 9595e4e23cd..978bc8bf7e0 100644 --- a/libmei/dist/atts_shared.cpp +++ b/libmei/dist/atts_shared.cpp @@ -38,12 +38,12 @@ void AttAccidLog::ResetAccidLog() m_func = accidLog_FUNC_NONE; } -bool AttAccidLog::ReadAccidLog(pugi::xml_node element) +bool AttAccidLog::ReadAccidLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("func")) { this->SetFunc(StrToAccidLogFunc(element.attribute("func").value())); - element.remove_attribute("func"); + if (removeAttr) element.remove_attribute("func"); hasAttribute = true; } return hasAttribute; @@ -82,12 +82,12 @@ void AttAccidental::ResetAccidental() m_accid = ACCIDENTAL_WRITTEN_NONE; } -bool AttAccidental::ReadAccidental(pugi::xml_node element) +bool AttAccidental::ReadAccidental(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("accid")) { this->SetAccid(StrToAccidentalWritten(element.attribute("accid").value())); - element.remove_attribute("accid"); + if (removeAttr) element.remove_attribute("accid"); hasAttribute = true; } return hasAttribute; @@ -126,12 +126,12 @@ void AttArticulation::ResetArticulation() m_artic = std::vector(); } -bool AttArticulation::ReadArticulation(pugi::xml_node element) +bool AttArticulation::ReadArticulation(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("artic")) { this->SetArtic(StrToArticulationList(element.attribute("artic").value())); - element.remove_attribute("artic"); + if (removeAttr) element.remove_attribute("artic"); hasAttribute = true; } return hasAttribute; @@ -170,12 +170,12 @@ void AttAttaccaLog::ResetAttaccaLog() m_target = ""; } -bool AttAttaccaLog::ReadAttaccaLog(pugi::xml_node element) +bool AttAttaccaLog::ReadAttaccaLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("target")) { this->SetTarget(StrToStr(element.attribute("target").value())); - element.remove_attribute("target"); + if (removeAttr) element.remove_attribute("target"); hasAttribute = true; } return hasAttribute; @@ -214,12 +214,12 @@ void AttAudience::ResetAudience() m_audience = audience_AUDIENCE_NONE; } -bool AttAudience::ReadAudience(pugi::xml_node element) +bool AttAudience::ReadAudience(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("audience")) { this->SetAudience(StrToAudienceAudience(element.attribute("audience").value())); - element.remove_attribute("audience"); + if (removeAttr) element.remove_attribute("audience"); hasAttribute = true; } return hasAttribute; @@ -258,12 +258,12 @@ void AttAugmentDots::ResetAugmentDots() m_dots = MEI_UNSET; } -bool AttAugmentDots::ReadAugmentDots(pugi::xml_node element) +bool AttAugmentDots::ReadAugmentDots(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("dots")) { this->SetDots(StrToInt(element.attribute("dots").value())); - element.remove_attribute("dots"); + if (removeAttr) element.remove_attribute("dots"); hasAttribute = true; } return hasAttribute; @@ -303,17 +303,17 @@ void AttAuthorized::ResetAuthorized() m_authUri = ""; } -bool AttAuthorized::ReadAuthorized(pugi::xml_node element) +bool AttAuthorized::ReadAuthorized(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("auth")) { this->SetAuth(StrToStr(element.attribute("auth").value())); - element.remove_attribute("auth"); + if (removeAttr) element.remove_attribute("auth"); hasAttribute = true; } if (element.attribute("auth.uri")) { this->SetAuthUri(StrToStr(element.attribute("auth.uri").value())); - element.remove_attribute("auth.uri"); + if (removeAttr) element.remove_attribute("auth.uri"); hasAttribute = true; } return hasAttribute; @@ -361,12 +361,12 @@ void AttBarLineLog::ResetBarLineLog() m_form = BARRENDITION_NONE; } -bool AttBarLineLog::ReadBarLineLog(pugi::xml_node element) +bool AttBarLineLog::ReadBarLineLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToBarrendition(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } return hasAttribute; @@ -407,22 +407,22 @@ void AttBarring::ResetBarring() m_barPlace = MEI_UNSET; } -bool AttBarring::ReadBarring(pugi::xml_node element) +bool AttBarring::ReadBarring(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("bar.len")) { this->SetBarLen(StrToDbl(element.attribute("bar.len").value())); - element.remove_attribute("bar.len"); + if (removeAttr) element.remove_attribute("bar.len"); hasAttribute = true; } if (element.attribute("bar.method")) { this->SetBarMethod(StrToBarmethod(element.attribute("bar.method").value())); - element.remove_attribute("bar.method"); + if (removeAttr) element.remove_attribute("bar.method"); hasAttribute = true; } if (element.attribute("bar.place")) { this->SetBarPlace(StrToInt(element.attribute("bar.place").value())); - element.remove_attribute("bar.place"); + if (removeAttr) element.remove_attribute("bar.place"); hasAttribute = true; } return hasAttribute; @@ -479,12 +479,12 @@ void AttBasic::ResetBasic() m_base = ""; } -bool AttBasic::ReadBasic(pugi::xml_node element) +bool AttBasic::ReadBasic(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("xml:base")) { this->SetBase(StrToStr(element.attribute("xml:base").value())); - element.remove_attribute("xml:base"); + if (removeAttr) element.remove_attribute("xml:base"); hasAttribute = true; } return hasAttribute; @@ -523,12 +523,12 @@ void AttBibl::ResetBibl() m_analog = ""; } -bool AttBibl::ReadBibl(pugi::xml_node element) +bool AttBibl::ReadBibl(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("analog")) { this->SetAnalog(StrToStr(element.attribute("analog").value())); - element.remove_attribute("analog"); + if (removeAttr) element.remove_attribute("analog"); hasAttribute = true; } return hasAttribute; @@ -567,12 +567,12 @@ void AttCalendared::ResetCalendared() m_calendar = ""; } -bool AttCalendared::ReadCalendared(pugi::xml_node element) +bool AttCalendared::ReadCalendared(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("calendar")) { this->SetCalendar(StrToStr(element.attribute("calendar").value())); - element.remove_attribute("calendar"); + if (removeAttr) element.remove_attribute("calendar"); hasAttribute = true; } return hasAttribute; @@ -611,12 +611,12 @@ void AttCanonical::ResetCanonical() m_codedval = ""; } -bool AttCanonical::ReadCanonical(pugi::xml_node element) +bool AttCanonical::ReadCanonical(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("codedval")) { this->SetCodedval(StrToStr(element.attribute("codedval").value())); - element.remove_attribute("codedval"); + if (removeAttr) element.remove_attribute("codedval"); hasAttribute = true; } return hasAttribute; @@ -655,12 +655,12 @@ void AttClassed::ResetClassed() m_class = ""; } -bool AttClassed::ReadClassed(pugi::xml_node element) +bool AttClassed::ReadClassed(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("class")) { this->SetClass(StrToStr(element.attribute("class").value())); - element.remove_attribute("class"); + if (removeAttr) element.remove_attribute("class"); hasAttribute = true; } return hasAttribute; @@ -699,12 +699,12 @@ void AttClefLog::ResetClefLog() m_cautionary = BOOLEAN_NONE; } -bool AttClefLog::ReadClefLog(pugi::xml_node element) +bool AttClefLog::ReadClefLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("cautionary")) { this->SetCautionary(StrToBoolean(element.attribute("cautionary").value())); - element.remove_attribute("cautionary"); + if (removeAttr) element.remove_attribute("cautionary"); hasAttribute = true; } return hasAttribute; @@ -743,12 +743,12 @@ void AttClefShape::ResetClefShape() m_shape = CLEFSHAPE_NONE; } -bool AttClefShape::ReadClefShape(pugi::xml_node element) +bool AttClefShape::ReadClefShape(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("shape")) { this->SetShape(StrToClefshape(element.attribute("shape").value())); - element.remove_attribute("shape"); + if (removeAttr) element.remove_attribute("shape"); hasAttribute = true; } return hasAttribute; @@ -790,27 +790,27 @@ void AttCleffingLog::ResetCleffingLog() m_clefDisPlace = STAFFREL_basic_NONE; } -bool AttCleffingLog::ReadCleffingLog(pugi::xml_node element) +bool AttCleffingLog::ReadCleffingLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("clef.shape")) { this->SetClefShape(StrToClefshape(element.attribute("clef.shape").value())); - element.remove_attribute("clef.shape"); + if (removeAttr) element.remove_attribute("clef.shape"); hasAttribute = true; } if (element.attribute("clef.line")) { this->SetClefLine(StrToInt(element.attribute("clef.line").value())); - element.remove_attribute("clef.line"); + if (removeAttr) element.remove_attribute("clef.line"); hasAttribute = true; } if (element.attribute("clef.dis")) { this->SetClefDis(StrToOctaveDis(element.attribute("clef.dis").value())); - element.remove_attribute("clef.dis"); + if (removeAttr) element.remove_attribute("clef.dis"); hasAttribute = true; } if (element.attribute("clef.dis.place")) { this->SetClefDisPlace(StrToStaffrelBasic(element.attribute("clef.dis.place").value())); - element.remove_attribute("clef.dis.place"); + if (removeAttr) element.remove_attribute("clef.dis.place"); hasAttribute = true; } return hasAttribute; @@ -876,12 +876,12 @@ void AttColor::ResetColor() m_color = ""; } -bool AttColor::ReadColor(pugi::xml_node element) +bool AttColor::ReadColor(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("color")) { this->SetColor(StrToStr(element.attribute("color").value())); - element.remove_attribute("color"); + if (removeAttr) element.remove_attribute("color"); hasAttribute = true; } return hasAttribute; @@ -920,12 +920,12 @@ void AttColoration::ResetColoration() m_colored = BOOLEAN_NONE; } -bool AttColoration::ReadColoration(pugi::xml_node element) +bool AttColoration::ReadColoration(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("colored")) { this->SetColored(StrToBoolean(element.attribute("colored").value())); - element.remove_attribute("colored"); + if (removeAttr) element.remove_attribute("colored"); hasAttribute = true; } return hasAttribute; @@ -964,12 +964,12 @@ void AttCoordX1::ResetCoordX1() m_coordX1 = 0.0; } -bool AttCoordX1::ReadCoordX1(pugi::xml_node element) +bool AttCoordX1::ReadCoordX1(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("coord.x1")) { this->SetCoordX1(StrToDbl(element.attribute("coord.x1").value())); - element.remove_attribute("coord.x1"); + if (removeAttr) element.remove_attribute("coord.x1"); hasAttribute = true; } return hasAttribute; @@ -1008,12 +1008,12 @@ void AttCoordX2::ResetCoordX2() m_coordX2 = 0.0; } -bool AttCoordX2::ReadCoordX2(pugi::xml_node element) +bool AttCoordX2::ReadCoordX2(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("coord.x2")) { this->SetCoordX2(StrToDbl(element.attribute("coord.x2").value())); - element.remove_attribute("coord.x2"); + if (removeAttr) element.remove_attribute("coord.x2"); hasAttribute = true; } return hasAttribute; @@ -1052,12 +1052,12 @@ void AttCoordY1::ResetCoordY1() m_coordY1 = 0.0; } -bool AttCoordY1::ReadCoordY1(pugi::xml_node element) +bool AttCoordY1::ReadCoordY1(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("coord.y1")) { this->SetCoordY1(StrToDbl(element.attribute("coord.y1").value())); - element.remove_attribute("coord.y1"); + if (removeAttr) element.remove_attribute("coord.y1"); hasAttribute = true; } return hasAttribute; @@ -1100,32 +1100,32 @@ void AttCoordinated::ResetCoordinated() m_rotate = 0.0; } -bool AttCoordinated::ReadCoordinated(pugi::xml_node element) +bool AttCoordinated::ReadCoordinated(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("ulx")) { this->SetUlx(StrToInt(element.attribute("ulx").value())); - element.remove_attribute("ulx"); + if (removeAttr) element.remove_attribute("ulx"); hasAttribute = true; } if (element.attribute("uly")) { this->SetUly(StrToInt(element.attribute("uly").value())); - element.remove_attribute("uly"); + if (removeAttr) element.remove_attribute("uly"); hasAttribute = true; } if (element.attribute("lrx")) { this->SetLrx(StrToInt(element.attribute("lrx").value())); - element.remove_attribute("lrx"); + if (removeAttr) element.remove_attribute("lrx"); hasAttribute = true; } if (element.attribute("lry")) { this->SetLry(StrToInt(element.attribute("lry").value())); - element.remove_attribute("lry"); + if (removeAttr) element.remove_attribute("lry"); hasAttribute = true; } if (element.attribute("rotate")) { this->SetRotate(StrToDbl(element.attribute("rotate").value())); - element.remove_attribute("rotate"); + if (removeAttr) element.remove_attribute("rotate"); hasAttribute = true; } return hasAttribute; @@ -1200,12 +1200,12 @@ void AttCue::ResetCue() m_cue = BOOLEAN_NONE; } -bool AttCue::ReadCue(pugi::xml_node element) +bool AttCue::ReadCue(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("cue")) { this->SetCue(StrToBoolean(element.attribute("cue").value())); - element.remove_attribute("cue"); + if (removeAttr) element.remove_attribute("cue"); hasAttribute = true; } return hasAttribute; @@ -1246,22 +1246,22 @@ void AttCurvature::ResetCurvature() m_curvedir = curvature_CURVEDIR_NONE; } -bool AttCurvature::ReadCurvature(pugi::xml_node element) +bool AttCurvature::ReadCurvature(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("bezier")) { this->SetBezier(StrToStr(element.attribute("bezier").value())); - element.remove_attribute("bezier"); + if (removeAttr) element.remove_attribute("bezier"); hasAttribute = true; } if (element.attribute("bulge")) { this->SetBulge(StrToBulge(element.attribute("bulge").value())); - element.remove_attribute("bulge"); + if (removeAttr) element.remove_attribute("bulge"); hasAttribute = true; } if (element.attribute("curvedir")) { this->SetCurvedir(StrToCurvatureCurvedir(element.attribute("curvedir").value())); - element.remove_attribute("curvedir"); + if (removeAttr) element.remove_attribute("curvedir"); hasAttribute = true; } return hasAttribute; @@ -1319,17 +1319,17 @@ void AttCurveRend::ResetCurveRend() m_lwidth = data_LINEWIDTH(); } -bool AttCurveRend::ReadCurveRend(pugi::xml_node element) +bool AttCurveRend::ReadCurveRend(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("lform")) { this->SetLform(StrToLineform(element.attribute("lform").value())); - element.remove_attribute("lform"); + if (removeAttr) element.remove_attribute("lform"); hasAttribute = true; } if (element.attribute("lwidth")) { this->SetLwidth(StrToLinewidth(element.attribute("lwidth").value())); - element.remove_attribute("lwidth"); + if (removeAttr) element.remove_attribute("lwidth"); hasAttribute = true; } return hasAttribute; @@ -1377,12 +1377,12 @@ void AttCustosLog::ResetCustosLog() m_target = ""; } -bool AttCustosLog::ReadCustosLog(pugi::xml_node element) +bool AttCustosLog::ReadCustosLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("target")) { this->SetTarget(StrToStr(element.attribute("target").value())); - element.remove_attribute("target"); + if (removeAttr) element.remove_attribute("target"); hasAttribute = true; } return hasAttribute; @@ -1421,12 +1421,12 @@ void AttDataPointing::ResetDataPointing() m_data = ""; } -bool AttDataPointing::ReadDataPointing(pugi::xml_node element) +bool AttDataPointing::ReadDataPointing(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("data")) { this->SetData(StrToStr(element.attribute("data").value())); - element.remove_attribute("data"); + if (removeAttr) element.remove_attribute("data"); hasAttribute = true; } return hasAttribute; @@ -1469,32 +1469,32 @@ void AttDatable::ResetDatable() m_startdate = ""; } -bool AttDatable::ReadDatable(pugi::xml_node element) +bool AttDatable::ReadDatable(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("enddate")) { this->SetEnddate(StrToStr(element.attribute("enddate").value())); - element.remove_attribute("enddate"); + if (removeAttr) element.remove_attribute("enddate"); hasAttribute = true; } if (element.attribute("isodate")) { this->SetIsodate(StrToStr(element.attribute("isodate").value())); - element.remove_attribute("isodate"); + if (removeAttr) element.remove_attribute("isodate"); hasAttribute = true; } if (element.attribute("notafter")) { this->SetNotafter(StrToStr(element.attribute("notafter").value())); - element.remove_attribute("notafter"); + if (removeAttr) element.remove_attribute("notafter"); hasAttribute = true; } if (element.attribute("notbefore")) { this->SetNotbefore(StrToStr(element.attribute("notbefore").value())); - element.remove_attribute("notbefore"); + if (removeAttr) element.remove_attribute("notbefore"); hasAttribute = true; } if (element.attribute("startdate")) { this->SetStartdate(StrToStr(element.attribute("startdate").value())); - element.remove_attribute("startdate"); + if (removeAttr) element.remove_attribute("startdate"); hasAttribute = true; } return hasAttribute; @@ -1573,32 +1573,32 @@ void AttDistances::ResetDistances() m_tempoDist = data_MEASUREMENTSIGNED(); } -bool AttDistances::ReadDistances(pugi::xml_node element) +bool AttDistances::ReadDistances(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("dir.dist")) { this->SetDirDist(StrToMeasurementsigned(element.attribute("dir.dist").value())); - element.remove_attribute("dir.dist"); + if (removeAttr) element.remove_attribute("dir.dist"); hasAttribute = true; } if (element.attribute("dynam.dist")) { this->SetDynamDist(StrToMeasurementsigned(element.attribute("dynam.dist").value())); - element.remove_attribute("dynam.dist"); + if (removeAttr) element.remove_attribute("dynam.dist"); hasAttribute = true; } if (element.attribute("harm.dist")) { this->SetHarmDist(StrToMeasurementsigned(element.attribute("harm.dist").value())); - element.remove_attribute("harm.dist"); + if (removeAttr) element.remove_attribute("harm.dist"); hasAttribute = true; } if (element.attribute("reh.dist")) { this->SetRehDist(StrToMeasurementsigned(element.attribute("reh.dist").value())); - element.remove_attribute("reh.dist"); + if (removeAttr) element.remove_attribute("reh.dist"); hasAttribute = true; } if (element.attribute("tempo.dist")) { this->SetTempoDist(StrToMeasurementsigned(element.attribute("tempo.dist").value())); - element.remove_attribute("tempo.dist"); + if (removeAttr) element.remove_attribute("tempo.dist"); hasAttribute = true; } return hasAttribute; @@ -1673,12 +1673,12 @@ void AttDotLog::ResetDotLog() m_form = dotLog_FORM_NONE; } -bool AttDotLog::ReadDotLog(pugi::xml_node element) +bool AttDotLog::ReadDotLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToDotLogForm(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } return hasAttribute; @@ -1717,12 +1717,12 @@ void AttDurationAdditive::ResetDurationAdditive() m_dur = DURATION_NONE; } -bool AttDurationAdditive::ReadDurationAdditive(pugi::xml_node element) +bool AttDurationAdditive::ReadDurationAdditive(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("dur")) { this->SetDur(StrToDuration(element.attribute("dur").value())); - element.remove_attribute("dur"); + if (removeAttr) element.remove_attribute("dur"); hasAttribute = true; } return hasAttribute; @@ -1763,22 +1763,22 @@ void AttDurationDefault::ResetDurationDefault() m_numbaseDefault = MEI_UNSET; } -bool AttDurationDefault::ReadDurationDefault(pugi::xml_node element) +bool AttDurationDefault::ReadDurationDefault(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("dur.default")) { this->SetDurDefault(StrToDuration(element.attribute("dur.default").value())); - element.remove_attribute("dur.default"); + if (removeAttr) element.remove_attribute("dur.default"); hasAttribute = true; } if (element.attribute("num.default")) { this->SetNumDefault(StrToInt(element.attribute("num.default").value())); - element.remove_attribute("num.default"); + if (removeAttr) element.remove_attribute("num.default"); hasAttribute = true; } if (element.attribute("numbase.default")) { this->SetNumbaseDefault(StrToInt(element.attribute("numbase.default").value())); - element.remove_attribute("numbase.default"); + if (removeAttr) element.remove_attribute("numbase.default"); hasAttribute = true; } return hasAttribute; @@ -1835,12 +1835,12 @@ void AttDurationLog::ResetDurationLog() m_dur = DURATION_NONE; } -bool AttDurationLog::ReadDurationLog(pugi::xml_node element) +bool AttDurationLog::ReadDurationLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("dur")) { this->SetDur(StrToDuration(element.attribute("dur").value())); - element.remove_attribute("dur"); + if (removeAttr) element.remove_attribute("dur"); hasAttribute = true; } return hasAttribute; @@ -1880,17 +1880,17 @@ void AttDurationRatio::ResetDurationRatio() m_numbase = MEI_UNSET; } -bool AttDurationRatio::ReadDurationRatio(pugi::xml_node element) +bool AttDurationRatio::ReadDurationRatio(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("num")) { this->SetNum(StrToInt(element.attribute("num").value())); - element.remove_attribute("num"); + if (removeAttr) element.remove_attribute("num"); hasAttribute = true; } if (element.attribute("numbase")) { this->SetNumbase(StrToInt(element.attribute("numbase").value())); - element.remove_attribute("numbase"); + if (removeAttr) element.remove_attribute("numbase"); hasAttribute = true; } return hasAttribute; @@ -1938,12 +1938,12 @@ void AttEnclosingChars::ResetEnclosingChars() m_enclose = ENCLOSURE_NONE; } -bool AttEnclosingChars::ReadEnclosingChars(pugi::xml_node element) +bool AttEnclosingChars::ReadEnclosingChars(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("enclose")) { this->SetEnclose(StrToEnclosure(element.attribute("enclose").value())); - element.remove_attribute("enclose"); + if (removeAttr) element.remove_attribute("enclose"); hasAttribute = true; } return hasAttribute; @@ -1982,12 +1982,12 @@ void AttEndings::ResetEndings() m_endingRend = endings_ENDINGREND_NONE; } -bool AttEndings::ReadEndings(pugi::xml_node element) +bool AttEndings::ReadEndings(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("ending.rend")) { this->SetEndingRend(StrToEndingsEndingrend(element.attribute("ending.rend").value())); - element.remove_attribute("ending.rend"); + if (removeAttr) element.remove_attribute("ending.rend"); hasAttribute = true; } return hasAttribute; @@ -2027,17 +2027,17 @@ void AttEvidence::ResetEvidence() m_evidence = ""; } -bool AttEvidence::ReadEvidence(pugi::xml_node element) +bool AttEvidence::ReadEvidence(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("cert")) { this->SetCert(StrToCertainty(element.attribute("cert").value())); - element.remove_attribute("cert"); + if (removeAttr) element.remove_attribute("cert"); hasAttribute = true; } if (element.attribute("evidence")) { this->SetEvidence(StrToStr(element.attribute("evidence").value())); - element.remove_attribute("evidence"); + if (removeAttr) element.remove_attribute("evidence"); hasAttribute = true; } return hasAttribute; @@ -2085,12 +2085,12 @@ void AttExtender::ResetExtender() m_extender = BOOLEAN_NONE; } -bool AttExtender::ReadExtender(pugi::xml_node element) +bool AttExtender::ReadExtender(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("extender")) { this->SetExtender(StrToBoolean(element.attribute("extender").value())); - element.remove_attribute("extender"); + if (removeAttr) element.remove_attribute("extender"); hasAttribute = true; } return hasAttribute; @@ -2129,12 +2129,12 @@ void AttExtent::ResetExtent() m_extent = ""; } -bool AttExtent::ReadExtent(pugi::xml_node element) +bool AttExtent::ReadExtent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("extent")) { this->SetExtent(StrToStr(element.attribute("extent").value())); - element.remove_attribute("extent"); + if (removeAttr) element.remove_attribute("extent"); hasAttribute = true; } return hasAttribute; @@ -2173,12 +2173,12 @@ void AttFermataPresent::ResetFermataPresent() m_fermata = STAFFREL_basic_NONE; } -bool AttFermataPresent::ReadFermataPresent(pugi::xml_node element) +bool AttFermataPresent::ReadFermataPresent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("fermata")) { this->SetFermata(StrToStaffrelBasic(element.attribute("fermata").value())); - element.remove_attribute("fermata"); + if (removeAttr) element.remove_attribute("fermata"); hasAttribute = true; } return hasAttribute; @@ -2217,12 +2217,12 @@ void AttFiling::ResetFiling() m_nonfiling = MEI_UNSET; } -bool AttFiling::ReadFiling(pugi::xml_node element) +bool AttFiling::ReadFiling(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("nonfiling")) { this->SetNonfiling(StrToInt(element.attribute("nonfiling").value())); - element.remove_attribute("nonfiling"); + if (removeAttr) element.remove_attribute("nonfiling"); hasAttribute = true; } return hasAttribute; @@ -2261,12 +2261,12 @@ void AttGrpSymLog::ResetGrpSymLog() m_level = MEI_UNSET; } -bool AttGrpSymLog::ReadGrpSymLog(pugi::xml_node element) +bool AttGrpSymLog::ReadGrpSymLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("level")) { this->SetLevel(StrToInt(element.attribute("level").value())); - element.remove_attribute("level"); + if (removeAttr) element.remove_attribute("level"); hasAttribute = true; } return hasAttribute; @@ -2305,12 +2305,12 @@ void AttHandIdent::ResetHandIdent() m_hand = ""; } -bool AttHandIdent::ReadHandIdent(pugi::xml_node element) +bool AttHandIdent::ReadHandIdent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("hand")) { this->SetHand(StrToStr(element.attribute("hand").value())); - element.remove_attribute("hand"); + if (removeAttr) element.remove_attribute("hand"); hasAttribute = true; } return hasAttribute; @@ -2349,12 +2349,12 @@ void AttHeight::ResetHeight() m_height = data_MEASUREMENTUNSIGNED(); } -bool AttHeight::ReadHeight(pugi::xml_node element) +bool AttHeight::ReadHeight(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("height")) { this->SetHeight(StrToMeasurementunsigned(element.attribute("height").value())); - element.remove_attribute("height"); + if (removeAttr) element.remove_attribute("height"); hasAttribute = true; } return hasAttribute; @@ -2393,12 +2393,12 @@ void AttHorizontalAlign::ResetHorizontalAlign() m_halign = HORIZONTALALIGNMENT_NONE; } -bool AttHorizontalAlign::ReadHorizontalAlign(pugi::xml_node element) +bool AttHorizontalAlign::ReadHorizontalAlign(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("halign")) { this->SetHalign(StrToHorizontalalignment(element.attribute("halign").value())); - element.remove_attribute("halign"); + if (removeAttr) element.remove_attribute("halign"); hasAttribute = true; } return hasAttribute; @@ -2437,12 +2437,12 @@ void AttInternetMedia::ResetInternetMedia() m_mimetype = ""; } -bool AttInternetMedia::ReadInternetMedia(pugi::xml_node element) +bool AttInternetMedia::ReadInternetMedia(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("mimetype")) { this->SetMimetype(StrToStr(element.attribute("mimetype").value())); - element.remove_attribute("mimetype"); + if (removeAttr) element.remove_attribute("mimetype"); hasAttribute = true; } return hasAttribute; @@ -2481,12 +2481,12 @@ void AttJoined::ResetJoined() m_join = ""; } -bool AttJoined::ReadJoined(pugi::xml_node element) +bool AttJoined::ReadJoined(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("join")) { this->SetJoin(StrToStr(element.attribute("join").value())); - element.remove_attribute("join"); + if (removeAttr) element.remove_attribute("join"); hasAttribute = true; } return hasAttribute; @@ -2525,12 +2525,12 @@ void AttKeySigLog::ResetKeySigLog() m_sig = std::make_pair(-1, ACCIDENTAL_WRITTEN_NONE); } -bool AttKeySigLog::ReadKeySigLog(pugi::xml_node element) +bool AttKeySigLog::ReadKeySigLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("sig")) { this->SetSig(StrToKeysignature(element.attribute("sig").value())); - element.remove_attribute("sig"); + if (removeAttr) element.remove_attribute("sig"); hasAttribute = true; } return hasAttribute; @@ -2569,12 +2569,12 @@ void AttKeySigDefaultLog::ResetKeySigDefaultLog() m_keySig = std::make_pair(-1, ACCIDENTAL_WRITTEN_NONE); } -bool AttKeySigDefaultLog::ReadKeySigDefaultLog(pugi::xml_node element) +bool AttKeySigDefaultLog::ReadKeySigDefaultLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("key.sig")) { this->SetKeySig(StrToKeysignature(element.attribute("key.sig").value())); - element.remove_attribute("key.sig"); + if (removeAttr) element.remove_attribute("key.sig"); hasAttribute = true; } return hasAttribute; @@ -2613,12 +2613,12 @@ void AttLabelled::ResetLabelled() m_label = ""; } -bool AttLabelled::ReadLabelled(pugi::xml_node element) +bool AttLabelled::ReadLabelled(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("label")) { this->SetLabel(StrToStr(element.attribute("label").value())); - element.remove_attribute("label"); + if (removeAttr) element.remove_attribute("label"); hasAttribute = true; } return hasAttribute; @@ -2658,17 +2658,17 @@ void AttLang::ResetLang() m_translit = ""; } -bool AttLang::ReadLang(pugi::xml_node element) +bool AttLang::ReadLang(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("xml:lang")) { this->SetLang(StrToStr(element.attribute("xml:lang").value())); - element.remove_attribute("xml:lang"); + if (removeAttr) element.remove_attribute("xml:lang"); hasAttribute = true; } if (element.attribute("translit")) { this->SetTranslit(StrToStr(element.attribute("translit").value())); - element.remove_attribute("translit"); + if (removeAttr) element.remove_attribute("translit"); hasAttribute = true; } return hasAttribute; @@ -2716,12 +2716,12 @@ void AttLayerLog::ResetLayerLog() m_def = ""; } -bool AttLayerLog::ReadLayerLog(pugi::xml_node element) +bool AttLayerLog::ReadLayerLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("def")) { this->SetDef(StrToStr(element.attribute("def").value())); - element.remove_attribute("def"); + if (removeAttr) element.remove_attribute("def"); hasAttribute = true; } return hasAttribute; @@ -2760,12 +2760,12 @@ void AttLayerIdent::ResetLayerIdent() m_layer = MEI_UNSET; } -bool AttLayerIdent::ReadLayerIdent(pugi::xml_node element) +bool AttLayerIdent::ReadLayerIdent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("layer")) { this->SetLayer(StrToInt(element.attribute("layer").value())); - element.remove_attribute("layer"); + if (removeAttr) element.remove_attribute("layer"); hasAttribute = true; } return hasAttribute; @@ -2804,12 +2804,12 @@ void AttLineLoc::ResetLineLoc() m_line = 0; } -bool AttLineLoc::ReadLineLoc(pugi::xml_node element) +bool AttLineLoc::ReadLineLoc(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("line")) { this->SetLine(StrToInt(element.attribute("line").value())); - element.remove_attribute("line"); + if (removeAttr) element.remove_attribute("line"); hasAttribute = true; } return hasAttribute; @@ -2851,27 +2851,27 @@ void AttLineRend::ResetLineRend() m_lstartsymSize = MEI_UNSET; } -bool AttLineRend::ReadLineRend(pugi::xml_node element) +bool AttLineRend::ReadLineRend(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("lendsym")) { this->SetLendsym(StrToLinestartendsymbol(element.attribute("lendsym").value())); - element.remove_attribute("lendsym"); + if (removeAttr) element.remove_attribute("lendsym"); hasAttribute = true; } if (element.attribute("lendsym.size")) { this->SetLendsymSize(StrToInt(element.attribute("lendsym.size").value())); - element.remove_attribute("lendsym.size"); + if (removeAttr) element.remove_attribute("lendsym.size"); hasAttribute = true; } if (element.attribute("lstartsym")) { this->SetLstartsym(StrToLinestartendsymbol(element.attribute("lstartsym").value())); - element.remove_attribute("lstartsym"); + if (removeAttr) element.remove_attribute("lstartsym"); hasAttribute = true; } if (element.attribute("lstartsym.size")) { this->SetLstartsymSize(StrToInt(element.attribute("lstartsym.size").value())); - element.remove_attribute("lstartsym.size"); + if (removeAttr) element.remove_attribute("lstartsym.size"); hasAttribute = true; } return hasAttribute; @@ -2939,22 +2939,22 @@ void AttLineRendBase::ResetLineRendBase() m_lwidth = data_LINEWIDTH(); } -bool AttLineRendBase::ReadLineRendBase(pugi::xml_node element) +bool AttLineRendBase::ReadLineRendBase(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("lform")) { this->SetLform(StrToLineform(element.attribute("lform").value())); - element.remove_attribute("lform"); + if (removeAttr) element.remove_attribute("lform"); hasAttribute = true; } if (element.attribute("lsegs")) { this->SetLsegs(StrToInt(element.attribute("lsegs").value())); - element.remove_attribute("lsegs"); + if (removeAttr) element.remove_attribute("lsegs"); hasAttribute = true; } if (element.attribute("lwidth")) { this->SetLwidth(StrToLinewidth(element.attribute("lwidth").value())); - element.remove_attribute("lwidth"); + if (removeAttr) element.remove_attribute("lwidth"); hasAttribute = true; } return hasAttribute; @@ -3018,47 +3018,47 @@ void AttLinking::ResetLinking() m_synch = ""; } -bool AttLinking::ReadLinking(pugi::xml_node element) +bool AttLinking::ReadLinking(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("copyof")) { this->SetCopyof(StrToStr(element.attribute("copyof").value())); - element.remove_attribute("copyof"); + if (removeAttr) element.remove_attribute("copyof"); hasAttribute = true; } if (element.attribute("corresp")) { this->SetCorresp(StrToStr(element.attribute("corresp").value())); - element.remove_attribute("corresp"); + if (removeAttr) element.remove_attribute("corresp"); hasAttribute = true; } if (element.attribute("follows")) { this->SetFollows(StrToStr(element.attribute("follows").value())); - element.remove_attribute("follows"); + if (removeAttr) element.remove_attribute("follows"); hasAttribute = true; } if (element.attribute("next")) { this->SetNext(StrToStr(element.attribute("next").value())); - element.remove_attribute("next"); + if (removeAttr) element.remove_attribute("next"); hasAttribute = true; } if (element.attribute("precedes")) { this->SetPrecedes(StrToStr(element.attribute("precedes").value())); - element.remove_attribute("precedes"); + if (removeAttr) element.remove_attribute("precedes"); hasAttribute = true; } if (element.attribute("prev")) { this->SetPrev(StrToStr(element.attribute("prev").value())); - element.remove_attribute("prev"); + if (removeAttr) element.remove_attribute("prev"); hasAttribute = true; } if (element.attribute("sameas")) { this->SetSameas(StrToStr(element.attribute("sameas").value())); - element.remove_attribute("sameas"); + if (removeAttr) element.remove_attribute("sameas"); hasAttribute = true; } if (element.attribute("synch")) { this->SetSynch(StrToStr(element.attribute("synch").value())); - element.remove_attribute("synch"); + if (removeAttr) element.remove_attribute("synch"); hasAttribute = true; } return hasAttribute; @@ -3165,37 +3165,37 @@ void AttLyricStyle::ResetLyricStyle() m_lyricWeight = FONTWEIGHT_NONE; } -bool AttLyricStyle::ReadLyricStyle(pugi::xml_node element) +bool AttLyricStyle::ReadLyricStyle(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("lyric.align")) { this->SetLyricAlign(StrToMeasurementsigned(element.attribute("lyric.align").value())); - element.remove_attribute("lyric.align"); + if (removeAttr) element.remove_attribute("lyric.align"); hasAttribute = true; } if (element.attribute("lyric.fam")) { this->SetLyricFam(StrToStr(element.attribute("lyric.fam").value())); - element.remove_attribute("lyric.fam"); + if (removeAttr) element.remove_attribute("lyric.fam"); hasAttribute = true; } if (element.attribute("lyric.name")) { this->SetLyricName(StrToStr(element.attribute("lyric.name").value())); - element.remove_attribute("lyric.name"); + if (removeAttr) element.remove_attribute("lyric.name"); hasAttribute = true; } if (element.attribute("lyric.size")) { this->SetLyricSize(StrToFontsize(element.attribute("lyric.size").value())); - element.remove_attribute("lyric.size"); + if (removeAttr) element.remove_attribute("lyric.size"); hasAttribute = true; } if (element.attribute("lyric.style")) { this->SetLyricStyle(StrToFontstyle(element.attribute("lyric.style").value())); - element.remove_attribute("lyric.style"); + if (removeAttr) element.remove_attribute("lyric.style"); hasAttribute = true; } if (element.attribute("lyric.weight")) { this->SetLyricWeight(StrToFontweight(element.attribute("lyric.weight").value())); - element.remove_attribute("lyric.weight"); + if (removeAttr) element.remove_attribute("lyric.weight"); hasAttribute = true; } return hasAttribute; @@ -3279,12 +3279,12 @@ void AttMeasureNumbers::ResetMeasureNumbers() m_mnumVisible = BOOLEAN_NONE; } -bool AttMeasureNumbers::ReadMeasureNumbers(pugi::xml_node element) +bool AttMeasureNumbers::ReadMeasureNumbers(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("mnum.visible")) { this->SetMnumVisible(StrToBoolean(element.attribute("mnum.visible").value())); - element.remove_attribute("mnum.visible"); + if (removeAttr) element.remove_attribute("mnum.visible"); hasAttribute = true; } return hasAttribute; @@ -3323,12 +3323,12 @@ void AttMeasurement::ResetMeasurement() m_unit = ""; } -bool AttMeasurement::ReadMeasurement(pugi::xml_node element) +bool AttMeasurement::ReadMeasurement(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("unit")) { this->SetUnit(StrToStr(element.attribute("unit").value())); - element.remove_attribute("unit"); + if (removeAttr) element.remove_attribute("unit"); hasAttribute = true; } return hasAttribute; @@ -3369,22 +3369,22 @@ void AttMediaBounds::ResetMediaBounds() m_betype = BETYPE_NONE; } -bool AttMediaBounds::ReadMediaBounds(pugi::xml_node element) +bool AttMediaBounds::ReadMediaBounds(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("begin")) { this->SetBegin(StrToStr(element.attribute("begin").value())); - element.remove_attribute("begin"); + if (removeAttr) element.remove_attribute("begin"); hasAttribute = true; } if (element.attribute("end")) { this->SetEnd(StrToStr(element.attribute("end").value())); - element.remove_attribute("end"); + if (removeAttr) element.remove_attribute("end"); hasAttribute = true; } if (element.attribute("betype")) { this->SetBetype(StrToBetype(element.attribute("betype").value())); - element.remove_attribute("betype"); + if (removeAttr) element.remove_attribute("betype"); hasAttribute = true; } return hasAttribute; @@ -3441,12 +3441,12 @@ void AttMedium::ResetMedium() m_medium = ""; } -bool AttMedium::ReadMedium(pugi::xml_node element) +bool AttMedium::ReadMedium(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("medium")) { this->SetMedium(StrToStr(element.attribute("medium").value())); - element.remove_attribute("medium"); + if (removeAttr) element.remove_attribute("medium"); hasAttribute = true; } return hasAttribute; @@ -3485,12 +3485,12 @@ void AttMeiVersion::ResetMeiVersion() m_meiversion = meiVersion_MEIVERSION_NONE; } -bool AttMeiVersion::ReadMeiVersion(pugi::xml_node element) +bool AttMeiVersion::ReadMeiVersion(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("meiversion")) { this->SetMeiversion(StrToMeiVersionMeiversion(element.attribute("meiversion").value())); - element.remove_attribute("meiversion"); + if (removeAttr) element.remove_attribute("meiversion"); hasAttribute = true; } return hasAttribute; @@ -3529,12 +3529,12 @@ void AttMetadataPointing::ResetMetadataPointing() m_decls = ""; } -bool AttMetadataPointing::ReadMetadataPointing(pugi::xml_node element) +bool AttMetadataPointing::ReadMetadataPointing(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("decls")) { this->SetDecls(StrToStr(element.attribute("decls").value())); - element.remove_attribute("decls"); + if (removeAttr) element.remove_attribute("decls"); hasAttribute = true; } return hasAttribute; @@ -3573,12 +3573,12 @@ void AttMeterConformance::ResetMeterConformance() m_metcon = meterConformance_METCON_NONE; } -bool AttMeterConformance::ReadMeterConformance(pugi::xml_node element) +bool AttMeterConformance::ReadMeterConformance(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("metcon")) { this->SetMetcon(StrToMeterConformanceMetcon(element.attribute("metcon").value())); - element.remove_attribute("metcon"); + if (removeAttr) element.remove_attribute("metcon"); hasAttribute = true; } return hasAttribute; @@ -3618,17 +3618,17 @@ void AttMeterConformanceBar::ResetMeterConformanceBar() m_control = BOOLEAN_NONE; } -bool AttMeterConformanceBar::ReadMeterConformanceBar(pugi::xml_node element) +bool AttMeterConformanceBar::ReadMeterConformanceBar(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("metcon")) { this->SetMetcon(StrToBoolean(element.attribute("metcon").value())); - element.remove_attribute("metcon"); + if (removeAttr) element.remove_attribute("metcon"); hasAttribute = true; } if (element.attribute("control")) { this->SetControl(StrToBoolean(element.attribute("control").value())); - element.remove_attribute("control"); + if (removeAttr) element.remove_attribute("control"); hasAttribute = true; } return hasAttribute; @@ -3678,22 +3678,22 @@ void AttMeterSigLog::ResetMeterSigLog() m_unit = MEI_UNSET; } -bool AttMeterSigLog::ReadMeterSigLog(pugi::xml_node element) +bool AttMeterSigLog::ReadMeterSigLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("count")) { this->SetCount(StrToMetercountPair(element.attribute("count").value())); - element.remove_attribute("count"); + if (removeAttr) element.remove_attribute("count"); hasAttribute = true; } if (element.attribute("sym")) { this->SetSym(StrToMetersign(element.attribute("sym").value())); - element.remove_attribute("sym"); + if (removeAttr) element.remove_attribute("sym"); hasAttribute = true; } if (element.attribute("unit")) { this->SetUnit(StrToInt(element.attribute("unit").value())); - element.remove_attribute("unit"); + if (removeAttr) element.remove_attribute("unit"); hasAttribute = true; } return hasAttribute; @@ -3752,22 +3752,22 @@ void AttMeterSigDefaultLog::ResetMeterSigDefaultLog() m_meterSym = METERSIGN_NONE; } -bool AttMeterSigDefaultLog::ReadMeterSigDefaultLog(pugi::xml_node element) +bool AttMeterSigDefaultLog::ReadMeterSigDefaultLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("meter.count")) { this->SetMeterCount(StrToMetercountPair(element.attribute("meter.count").value())); - element.remove_attribute("meter.count"); + if (removeAttr) element.remove_attribute("meter.count"); hasAttribute = true; } if (element.attribute("meter.unit")) { this->SetMeterUnit(StrToInt(element.attribute("meter.unit").value())); - element.remove_attribute("meter.unit"); + if (removeAttr) element.remove_attribute("meter.unit"); hasAttribute = true; } if (element.attribute("meter.sym")) { this->SetMeterSym(StrToMetersign(element.attribute("meter.sym").value())); - element.remove_attribute("meter.sym"); + if (removeAttr) element.remove_attribute("meter.sym"); hasAttribute = true; } return hasAttribute; @@ -3826,22 +3826,22 @@ void AttMmTempo::ResetMmTempo() m_mmDots = MEI_UNSET; } -bool AttMmTempo::ReadMmTempo(pugi::xml_node element) +bool AttMmTempo::ReadMmTempo(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("mm")) { this->SetMm(StrToDbl(element.attribute("mm").value())); - element.remove_attribute("mm"); + if (removeAttr) element.remove_attribute("mm"); hasAttribute = true; } if (element.attribute("mm.unit")) { this->SetMmUnit(StrToDuration(element.attribute("mm.unit").value())); - element.remove_attribute("mm.unit"); + if (removeAttr) element.remove_attribute("mm.unit"); hasAttribute = true; } if (element.attribute("mm.dots")) { this->SetMmDots(StrToInt(element.attribute("mm.dots").value())); - element.remove_attribute("mm.dots"); + if (removeAttr) element.remove_attribute("mm.dots"); hasAttribute = true; } return hasAttribute; @@ -3898,12 +3898,12 @@ void AttMultinumMeasures::ResetMultinumMeasures() m_multiNumber = BOOLEAN_NONE; } -bool AttMultinumMeasures::ReadMultinumMeasures(pugi::xml_node element) +bool AttMultinumMeasures::ReadMultinumMeasures(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("multi.number")) { this->SetMultiNumber(StrToBoolean(element.attribute("multi.number").value())); - element.remove_attribute("multi.number"); + if (removeAttr) element.remove_attribute("multi.number"); hasAttribute = true; } return hasAttribute; @@ -3942,12 +3942,12 @@ void AttNInteger::ResetNInteger() m_n = MEI_UNSET; } -bool AttNInteger::ReadNInteger(pugi::xml_node element) +bool AttNInteger::ReadNInteger(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("n")) { this->SetN(StrToInt(element.attribute("n").value())); - element.remove_attribute("n"); + if (removeAttr) element.remove_attribute("n"); hasAttribute = true; } return hasAttribute; @@ -3986,12 +3986,12 @@ void AttNNumberLike::ResetNNumberLike() m_n = ""; } -bool AttNNumberLike::ReadNNumberLike(pugi::xml_node element) +bool AttNNumberLike::ReadNNumberLike(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("n")) { this->SetN(StrToStr(element.attribute("n").value())); - element.remove_attribute("n"); + if (removeAttr) element.remove_attribute("n"); hasAttribute = true; } return hasAttribute; @@ -4031,17 +4031,17 @@ void AttName::ResetName() m_role = ""; } -bool AttName::ReadName(pugi::xml_node element) +bool AttName::ReadName(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("nymref")) { this->SetNymref(StrToStr(element.attribute("nymref").value())); - element.remove_attribute("nymref"); + if (removeAttr) element.remove_attribute("nymref"); hasAttribute = true; } if (element.attribute("role")) { this->SetRole(StrToStr(element.attribute("role").value())); - element.remove_attribute("role"); + if (removeAttr) element.remove_attribute("role"); hasAttribute = true; } return hasAttribute; @@ -4090,17 +4090,17 @@ void AttNotationStyle::ResetNotationStyle() m_musicSize = data_FONTSIZE(); } -bool AttNotationStyle::ReadNotationStyle(pugi::xml_node element) +bool AttNotationStyle::ReadNotationStyle(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("music.name")) { this->SetMusicName(StrToStr(element.attribute("music.name").value())); - element.remove_attribute("music.name"); + if (removeAttr) element.remove_attribute("music.name"); hasAttribute = true; } if (element.attribute("music.size")) { this->SetMusicSize(StrToFontsize(element.attribute("music.size").value())); - element.remove_attribute("music.size"); + if (removeAttr) element.remove_attribute("music.size"); hasAttribute = true; } return hasAttribute; @@ -4156,52 +4156,52 @@ void AttNoteHeads::ResetNoteHeads() m_headVisible = BOOLEAN_NONE; } -bool AttNoteHeads::ReadNoteHeads(pugi::xml_node element) +bool AttNoteHeads::ReadNoteHeads(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("head.altsym")) { this->SetHeadAltsym(StrToStr(element.attribute("head.altsym").value())); - element.remove_attribute("head.altsym"); + if (removeAttr) element.remove_attribute("head.altsym"); hasAttribute = true; } if (element.attribute("head.auth")) { this->SetHeadAuth(StrToStr(element.attribute("head.auth").value())); - element.remove_attribute("head.auth"); + if (removeAttr) element.remove_attribute("head.auth"); hasAttribute = true; } if (element.attribute("head.color")) { this->SetHeadColor(StrToStr(element.attribute("head.color").value())); - element.remove_attribute("head.color"); + if (removeAttr) element.remove_attribute("head.color"); hasAttribute = true; } if (element.attribute("head.fill")) { this->SetHeadFill(StrToFill(element.attribute("head.fill").value())); - element.remove_attribute("head.fill"); + if (removeAttr) element.remove_attribute("head.fill"); hasAttribute = true; } if (element.attribute("head.fillcolor")) { this->SetHeadFillcolor(StrToStr(element.attribute("head.fillcolor").value())); - element.remove_attribute("head.fillcolor"); + if (removeAttr) element.remove_attribute("head.fillcolor"); hasAttribute = true; } if (element.attribute("head.mod")) { this->SetHeadMod(StrToNoteheadmodifier(element.attribute("head.mod").value())); - element.remove_attribute("head.mod"); + if (removeAttr) element.remove_attribute("head.mod"); hasAttribute = true; } if (element.attribute("head.rotation")) { this->SetHeadRotation(StrToRotation(element.attribute("head.rotation").value())); - element.remove_attribute("head.rotation"); + if (removeAttr) element.remove_attribute("head.rotation"); hasAttribute = true; } if (element.attribute("head.shape")) { this->SetHeadShape(StrToHeadshape(element.attribute("head.shape").value())); - element.remove_attribute("head.shape"); + if (removeAttr) element.remove_attribute("head.shape"); hasAttribute = true; } if (element.attribute("head.visible")) { this->SetHeadVisible(StrToBoolean(element.attribute("head.visible").value())); - element.remove_attribute("head.visible"); + if (removeAttr) element.remove_attribute("head.visible"); hasAttribute = true; } return hasAttribute; @@ -4312,12 +4312,12 @@ void AttOctave::ResetOctave() m_oct = -127; } -bool AttOctave::ReadOctave(pugi::xml_node element) +bool AttOctave::ReadOctave(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("oct")) { this->SetOct(StrToOctave(element.attribute("oct").value())); - element.remove_attribute("oct"); + if (removeAttr) element.remove_attribute("oct"); hasAttribute = true; } return hasAttribute; @@ -4356,12 +4356,12 @@ void AttOctaveDefault::ResetOctaveDefault() m_octDefault = -127; } -bool AttOctaveDefault::ReadOctaveDefault(pugi::xml_node element) +bool AttOctaveDefault::ReadOctaveDefault(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("oct.default")) { this->SetOctDefault(StrToOctave(element.attribute("oct.default").value())); - element.remove_attribute("oct.default"); + if (removeAttr) element.remove_attribute("oct.default"); hasAttribute = true; } return hasAttribute; @@ -4401,17 +4401,17 @@ void AttOctaveDisplacement::ResetOctaveDisplacement() m_disPlace = STAFFREL_basic_NONE; } -bool AttOctaveDisplacement::ReadOctaveDisplacement(pugi::xml_node element) +bool AttOctaveDisplacement::ReadOctaveDisplacement(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("dis")) { this->SetDis(StrToOctaveDis(element.attribute("dis").value())); - element.remove_attribute("dis"); + if (removeAttr) element.remove_attribute("dis"); hasAttribute = true; } if (element.attribute("dis.place")) { this->SetDisPlace(StrToStaffrelBasic(element.attribute("dis.place").value())); - element.remove_attribute("dis.place"); + if (removeAttr) element.remove_attribute("dis.place"); hasAttribute = true; } return hasAttribute; @@ -4459,12 +4459,12 @@ void AttOneLineStaff::ResetOneLineStaff() m_ontheline = BOOLEAN_NONE; } -bool AttOneLineStaff::ReadOneLineStaff(pugi::xml_node element) +bool AttOneLineStaff::ReadOneLineStaff(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("ontheline")) { this->SetOntheline(StrToBoolean(element.attribute("ontheline").value())); - element.remove_attribute("ontheline"); + if (removeAttr) element.remove_attribute("ontheline"); hasAttribute = true; } return hasAttribute; @@ -4503,12 +4503,12 @@ void AttOptimization::ResetOptimization() m_optimize = BOOLEAN_NONE; } -bool AttOptimization::ReadOptimization(pugi::xml_node element) +bool AttOptimization::ReadOptimization(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("optimize")) { this->SetOptimize(StrToBoolean(element.attribute("optimize").value())); - element.remove_attribute("optimize"); + if (removeAttr) element.remove_attribute("optimize"); hasAttribute = true; } return hasAttribute; @@ -4547,12 +4547,12 @@ void AttOriginLayerIdent::ResetOriginLayerIdent() m_originLayer = ""; } -bool AttOriginLayerIdent::ReadOriginLayerIdent(pugi::xml_node element) +bool AttOriginLayerIdent::ReadOriginLayerIdent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("origin.layer")) { this->SetOriginLayer(StrToStr(element.attribute("origin.layer").value())); - element.remove_attribute("origin.layer"); + if (removeAttr) element.remove_attribute("origin.layer"); hasAttribute = true; } return hasAttribute; @@ -4591,12 +4591,12 @@ void AttOriginStaffIdent::ResetOriginStaffIdent() m_originStaff = ""; } -bool AttOriginStaffIdent::ReadOriginStaffIdent(pugi::xml_node element) +bool AttOriginStaffIdent::ReadOriginStaffIdent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("origin.staff")) { this->SetOriginStaff(StrToStr(element.attribute("origin.staff").value())); - element.remove_attribute("origin.staff"); + if (removeAttr) element.remove_attribute("origin.staff"); hasAttribute = true; } return hasAttribute; @@ -4636,17 +4636,17 @@ void AttOriginStartEndId::ResetOriginStartEndId() m_originEndid = ""; } -bool AttOriginStartEndId::ReadOriginStartEndId(pugi::xml_node element) +bool AttOriginStartEndId::ReadOriginStartEndId(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("origin.startid")) { this->SetOriginStartid(StrToStr(element.attribute("origin.startid").value())); - element.remove_attribute("origin.startid"); + if (removeAttr) element.remove_attribute("origin.startid"); hasAttribute = true; } if (element.attribute("origin.endid")) { this->SetOriginEndid(StrToStr(element.attribute("origin.endid").value())); - element.remove_attribute("origin.endid"); + if (removeAttr) element.remove_attribute("origin.endid"); hasAttribute = true; } return hasAttribute; @@ -4695,17 +4695,17 @@ void AttOriginTimestampLog::ResetOriginTimestampLog() m_originTstamp2 = std::make_pair(-1, -1.0); } -bool AttOriginTimestampLog::ReadOriginTimestampLog(pugi::xml_node element) +bool AttOriginTimestampLog::ReadOriginTimestampLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("origin.tstamp")) { this->SetOriginTstamp(StrToMeasurebeat(element.attribute("origin.tstamp").value())); - element.remove_attribute("origin.tstamp"); + if (removeAttr) element.remove_attribute("origin.tstamp"); hasAttribute = true; } if (element.attribute("origin.tstamp2")) { this->SetOriginTstamp2(StrToMeasurebeat(element.attribute("origin.tstamp2").value())); - element.remove_attribute("origin.tstamp2"); + if (removeAttr) element.remove_attribute("origin.tstamp2"); hasAttribute = true; } return hasAttribute; @@ -4760,47 +4760,47 @@ void AttPages::ResetPages() m_pageScale = ""; } -bool AttPages::ReadPages(pugi::xml_node element) +bool AttPages::ReadPages(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("page.height")) { this->SetPageHeight(StrToMeasurementunsigned(element.attribute("page.height").value())); - element.remove_attribute("page.height"); + if (removeAttr) element.remove_attribute("page.height"); hasAttribute = true; } if (element.attribute("page.width")) { this->SetPageWidth(StrToMeasurementunsigned(element.attribute("page.width").value())); - element.remove_attribute("page.width"); + if (removeAttr) element.remove_attribute("page.width"); hasAttribute = true; } if (element.attribute("page.topmar")) { this->SetPageTopmar(StrToMeasurementunsigned(element.attribute("page.topmar").value())); - element.remove_attribute("page.topmar"); + if (removeAttr) element.remove_attribute("page.topmar"); hasAttribute = true; } if (element.attribute("page.botmar")) { this->SetPageBotmar(StrToMeasurementunsigned(element.attribute("page.botmar").value())); - element.remove_attribute("page.botmar"); + if (removeAttr) element.remove_attribute("page.botmar"); hasAttribute = true; } if (element.attribute("page.leftmar")) { this->SetPageLeftmar(StrToMeasurementunsigned(element.attribute("page.leftmar").value())); - element.remove_attribute("page.leftmar"); + if (removeAttr) element.remove_attribute("page.leftmar"); hasAttribute = true; } if (element.attribute("page.rightmar")) { this->SetPageRightmar(StrToMeasurementunsigned(element.attribute("page.rightmar").value())); - element.remove_attribute("page.rightmar"); + if (removeAttr) element.remove_attribute("page.rightmar"); hasAttribute = true; } if (element.attribute("page.panels")) { this->SetPagePanels(StrToStr(element.attribute("page.panels").value())); - element.remove_attribute("page.panels"); + if (removeAttr) element.remove_attribute("page.panels"); hasAttribute = true; } if (element.attribute("page.scale")) { this->SetPageScale(StrToStr(element.attribute("page.scale").value())); - element.remove_attribute("page.scale"); + if (removeAttr) element.remove_attribute("page.scale"); hasAttribute = true; } return hasAttribute; @@ -4903,17 +4903,17 @@ void AttPartIdent::ResetPartIdent() m_partstaff = ""; } -bool AttPartIdent::ReadPartIdent(pugi::xml_node element) +bool AttPartIdent::ReadPartIdent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("part")) { this->SetPart(StrToStr(element.attribute("part").value())); - element.remove_attribute("part"); + if (removeAttr) element.remove_attribute("part"); hasAttribute = true; } if (element.attribute("partstaff")) { this->SetPartstaff(StrToStr(element.attribute("partstaff").value())); - element.remove_attribute("partstaff"); + if (removeAttr) element.remove_attribute("partstaff"); hasAttribute = true; } return hasAttribute; @@ -4961,12 +4961,12 @@ void AttPitch::ResetPitch() m_pname = PITCHNAME_NONE; } -bool AttPitch::ReadPitch(pugi::xml_node element) +bool AttPitch::ReadPitch(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("pname")) { this->SetPname(StrToPitchname(element.attribute("pname").value())); - element.remove_attribute("pname"); + if (removeAttr) element.remove_attribute("pname"); hasAttribute = true; } return hasAttribute; @@ -5005,12 +5005,12 @@ void AttPlacementOnStaff::ResetPlacementOnStaff() m_onstaff = BOOLEAN_NONE; } -bool AttPlacementOnStaff::ReadPlacementOnStaff(pugi::xml_node element) +bool AttPlacementOnStaff::ReadPlacementOnStaff(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("onstaff")) { this->SetOnstaff(StrToBoolean(element.attribute("onstaff").value())); - element.remove_attribute("onstaff"); + if (removeAttr) element.remove_attribute("onstaff"); hasAttribute = true; } return hasAttribute; @@ -5049,12 +5049,12 @@ void AttPlacementRelEvent::ResetPlacementRelEvent() m_place = data_STAFFREL(); } -bool AttPlacementRelEvent::ReadPlacementRelEvent(pugi::xml_node element) +bool AttPlacementRelEvent::ReadPlacementRelEvent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("place")) { this->SetPlace(StrToStaffrel(element.attribute("place").value())); - element.remove_attribute("place"); + if (removeAttr) element.remove_attribute("place"); hasAttribute = true; } return hasAttribute; @@ -5093,12 +5093,12 @@ void AttPlacementRelStaff::ResetPlacementRelStaff() m_place = data_STAFFREL(); } -bool AttPlacementRelStaff::ReadPlacementRelStaff(pugi::xml_node element) +bool AttPlacementRelStaff::ReadPlacementRelStaff(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("place")) { this->SetPlace(StrToStaffrel(element.attribute("place").value())); - element.remove_attribute("place"); + if (removeAttr) element.remove_attribute("place"); hasAttribute = true; } return hasAttribute; @@ -5137,12 +5137,12 @@ void AttPlist::ResetPlist() m_plist = std::vector(); } -bool AttPlist::ReadPlist(pugi::xml_node element) +bool AttPlist::ReadPlist(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("plist")) { this->SetPlist(StrToXsdAnyURIList(element.attribute("plist").value())); - element.remove_attribute("plist"); + if (removeAttr) element.remove_attribute("plist"); hasAttribute = true; } return hasAttribute; @@ -5185,32 +5185,32 @@ void AttPointing::ResetPointing() m_targettype = ""; } -bool AttPointing::ReadPointing(pugi::xml_node element) +bool AttPointing::ReadPointing(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("xlink:actuate")) { this->SetActuate(StrToStr(element.attribute("xlink:actuate").value())); - element.remove_attribute("xlink:actuate"); + if (removeAttr) element.remove_attribute("xlink:actuate"); hasAttribute = true; } if (element.attribute("xlink:role")) { this->SetRole(StrToStr(element.attribute("xlink:role").value())); - element.remove_attribute("xlink:role"); + if (removeAttr) element.remove_attribute("xlink:role"); hasAttribute = true; } if (element.attribute("xlink:show")) { this->SetShow(StrToStr(element.attribute("xlink:show").value())); - element.remove_attribute("xlink:show"); + if (removeAttr) element.remove_attribute("xlink:show"); hasAttribute = true; } if (element.attribute("target")) { this->SetTarget(StrToStr(element.attribute("target").value())); - element.remove_attribute("target"); + if (removeAttr) element.remove_attribute("target"); hasAttribute = true; } if (element.attribute("targettype")) { this->SetTargettype(StrToStr(element.attribute("targettype").value())); - element.remove_attribute("targettype"); + if (removeAttr) element.remove_attribute("targettype"); hasAttribute = true; } return hasAttribute; @@ -5285,12 +5285,12 @@ void AttQuantity::ResetQuantity() m_quantity = 0.0; } -bool AttQuantity::ReadQuantity(pugi::xml_node element) +bool AttQuantity::ReadQuantity(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("quantity")) { this->SetQuantity(StrToDbl(element.attribute("quantity").value())); - element.remove_attribute("quantity"); + if (removeAttr) element.remove_attribute("quantity"); hasAttribute = true; } return hasAttribute; @@ -5333,32 +5333,32 @@ void AttRanging::ResetRanging() m_confidence = 0.0; } -bool AttRanging::ReadRanging(pugi::xml_node element) +bool AttRanging::ReadRanging(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("atleast")) { this->SetAtleast(StrToDbl(element.attribute("atleast").value())); - element.remove_attribute("atleast"); + if (removeAttr) element.remove_attribute("atleast"); hasAttribute = true; } if (element.attribute("atmost")) { this->SetAtmost(StrToDbl(element.attribute("atmost").value())); - element.remove_attribute("atmost"); + if (removeAttr) element.remove_attribute("atmost"); hasAttribute = true; } if (element.attribute("min")) { this->SetMin(StrToDbl(element.attribute("min").value())); - element.remove_attribute("min"); + if (removeAttr) element.remove_attribute("min"); hasAttribute = true; } if (element.attribute("max")) { this->SetMax(StrToDbl(element.attribute("max").value())); - element.remove_attribute("max"); + if (removeAttr) element.remove_attribute("max"); hasAttribute = true; } if (element.attribute("confidence")) { this->SetConfidence(StrToDbl(element.attribute("confidence").value())); - element.remove_attribute("confidence"); + if (removeAttr) element.remove_attribute("confidence"); hasAttribute = true; } return hasAttribute; @@ -5433,12 +5433,12 @@ void AttResponsibility::ResetResponsibility() m_resp = ""; } -bool AttResponsibility::ReadResponsibility(pugi::xml_node element) +bool AttResponsibility::ReadResponsibility(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("resp")) { this->SetResp(StrToStr(element.attribute("resp").value())); - element.remove_attribute("resp"); + if (removeAttr) element.remove_attribute("resp"); hasAttribute = true; } return hasAttribute; @@ -5477,12 +5477,12 @@ void AttRestdurationLog::ResetRestdurationLog() m_dur = DURATION_NONE; } -bool AttRestdurationLog::ReadRestdurationLog(pugi::xml_node element) +bool AttRestdurationLog::ReadRestdurationLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("dur")) { this->SetDur(StrToDuration(element.attribute("dur").value())); - element.remove_attribute("dur"); + if (removeAttr) element.remove_attribute("dur"); hasAttribute = true; } return hasAttribute; @@ -5521,12 +5521,12 @@ void AttScalable::ResetScalable() m_scale = -1.0; } -bool AttScalable::ReadScalable(pugi::xml_node element) +bool AttScalable::ReadScalable(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("scale")) { this->SetScale(StrToPercent(element.attribute("scale").value())); - element.remove_attribute("scale"); + if (removeAttr) element.remove_attribute("scale"); hasAttribute = true; } return hasAttribute; @@ -5565,12 +5565,12 @@ void AttSequence::ResetSequence() m_seq = MEI_UNSET; } -bool AttSequence::ReadSequence(pugi::xml_node element) +bool AttSequence::ReadSequence(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("seq")) { this->SetSeq(StrToInt(element.attribute("seq").value())); - element.remove_attribute("seq"); + if (removeAttr) element.remove_attribute("seq"); hasAttribute = true; } return hasAttribute; @@ -5609,12 +5609,12 @@ void AttSlashCount::ResetSlashCount() m_slash = 0; } -bool AttSlashCount::ReadSlashCount(pugi::xml_node element) +bool AttSlashCount::ReadSlashCount(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("slash")) { this->SetSlash(StrToInt(element.attribute("slash").value())); - element.remove_attribute("slash"); + if (removeAttr) element.remove_attribute("slash"); hasAttribute = true; } return hasAttribute; @@ -5653,12 +5653,12 @@ void AttSlurPresent::ResetSlurPresent() m_slur = ""; } -bool AttSlurPresent::ReadSlurPresent(pugi::xml_node element) +bool AttSlurPresent::ReadSlurPresent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("slur")) { this->SetSlur(StrToStr(element.attribute("slur").value())); - element.remove_attribute("slur"); + if (removeAttr) element.remove_attribute("slur"); hasAttribute = true; } return hasAttribute; @@ -5697,12 +5697,12 @@ void AttSource::ResetSource() m_source = ""; } -bool AttSource::ReadSource(pugi::xml_node element) +bool AttSource::ReadSource(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("source")) { this->SetSource(StrToStr(element.attribute("source").value())); - element.remove_attribute("source"); + if (removeAttr) element.remove_attribute("source"); hasAttribute = true; } return hasAttribute; @@ -5744,27 +5744,27 @@ void AttSpacing::ResetSpacing() m_spacingSystem = data_MEASUREMENTSIGNED(); } -bool AttSpacing::ReadSpacing(pugi::xml_node element) +bool AttSpacing::ReadSpacing(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("spacing.packexp")) { this->SetSpacingPackexp(StrToDbl(element.attribute("spacing.packexp").value())); - element.remove_attribute("spacing.packexp"); + if (removeAttr) element.remove_attribute("spacing.packexp"); hasAttribute = true; } if (element.attribute("spacing.packfact")) { this->SetSpacingPackfact(StrToDbl(element.attribute("spacing.packfact").value())); - element.remove_attribute("spacing.packfact"); + if (removeAttr) element.remove_attribute("spacing.packfact"); hasAttribute = true; } if (element.attribute("spacing.staff")) { this->SetSpacingStaff(StrToMeasurementsigned(element.attribute("spacing.staff").value())); - element.remove_attribute("spacing.staff"); + if (removeAttr) element.remove_attribute("spacing.staff"); hasAttribute = true; } if (element.attribute("spacing.system")) { this->SetSpacingSystem(StrToMeasurementsigned(element.attribute("spacing.system").value())); - element.remove_attribute("spacing.system"); + if (removeAttr) element.remove_attribute("spacing.system"); hasAttribute = true; } return hasAttribute; @@ -5830,12 +5830,12 @@ void AttStaffLog::ResetStaffLog() m_def = ""; } -bool AttStaffLog::ReadStaffLog(pugi::xml_node element) +bool AttStaffLog::ReadStaffLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("def")) { this->SetDef(StrToStr(element.attribute("def").value())); - element.remove_attribute("def"); + if (removeAttr) element.remove_attribute("def"); hasAttribute = true; } return hasAttribute; @@ -5874,12 +5874,12 @@ void AttStaffDefLog::ResetStaffDefLog() m_lines = MEI_UNSET; } -bool AttStaffDefLog::ReadStaffDefLog(pugi::xml_node element) +bool AttStaffDefLog::ReadStaffDefLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("lines")) { this->SetLines(StrToInt(element.attribute("lines").value())); - element.remove_attribute("lines"); + if (removeAttr) element.remove_attribute("lines"); hasAttribute = true; } return hasAttribute; @@ -5918,12 +5918,12 @@ void AttStaffGroupingSym::ResetStaffGroupingSym() m_symbol = staffGroupingSym_SYMBOL_NONE; } -bool AttStaffGroupingSym::ReadStaffGroupingSym(pugi::xml_node element) +bool AttStaffGroupingSym::ReadStaffGroupingSym(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("symbol")) { this->SetSymbol(StrToStaffGroupingSymSymbol(element.attribute("symbol").value())); - element.remove_attribute("symbol"); + if (removeAttr) element.remove_attribute("symbol"); hasAttribute = true; } return hasAttribute; @@ -5962,12 +5962,12 @@ void AttStaffIdent::ResetStaffIdent() m_staff = std::vector(); } -bool AttStaffIdent::ReadStaffIdent(pugi::xml_node element) +bool AttStaffIdent::ReadStaffIdent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("staff")) { this->SetStaff(StrToXsdPositiveIntegerList(element.attribute("staff").value())); - element.remove_attribute("staff"); + if (removeAttr) element.remove_attribute("staff"); hasAttribute = true; } return hasAttribute; @@ -6008,22 +6008,22 @@ void AttStaffItems::ResetStaffItems() m_betweenorder = data_STAFFITEM(); } -bool AttStaffItems::ReadStaffItems(pugi::xml_node element) +bool AttStaffItems::ReadStaffItems(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("aboveorder")) { this->SetAboveorder(StrToStaffitem(element.attribute("aboveorder").value())); - element.remove_attribute("aboveorder"); + if (removeAttr) element.remove_attribute("aboveorder"); hasAttribute = true; } if (element.attribute("beloworder")) { this->SetBeloworder(StrToStaffitem(element.attribute("beloworder").value())); - element.remove_attribute("beloworder"); + if (removeAttr) element.remove_attribute("beloworder"); hasAttribute = true; } if (element.attribute("betweenorder")) { this->SetBetweenorder(StrToStaffitem(element.attribute("betweenorder").value())); - element.remove_attribute("betweenorder"); + if (removeAttr) element.remove_attribute("betweenorder"); hasAttribute = true; } return hasAttribute; @@ -6080,12 +6080,12 @@ void AttStaffLoc::ResetStaffLoc() m_loc = MEI_UNSET; } -bool AttStaffLoc::ReadStaffLoc(pugi::xml_node element) +bool AttStaffLoc::ReadStaffLoc(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("loc")) { this->SetLoc(StrToInt(element.attribute("loc").value())); - element.remove_attribute("loc"); + if (removeAttr) element.remove_attribute("loc"); hasAttribute = true; } return hasAttribute; @@ -6125,17 +6125,17 @@ void AttStaffLocPitched::ResetStaffLocPitched() m_oloc = -127; } -bool AttStaffLocPitched::ReadStaffLocPitched(pugi::xml_node element) +bool AttStaffLocPitched::ReadStaffLocPitched(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("ploc")) { this->SetPloc(StrToPitchname(element.attribute("ploc").value())); - element.remove_attribute("ploc"); + if (removeAttr) element.remove_attribute("ploc"); hasAttribute = true; } if (element.attribute("oloc")) { this->SetOloc(StrToOctave(element.attribute("oloc").value())); - element.remove_attribute("oloc"); + if (removeAttr) element.remove_attribute("oloc"); hasAttribute = true; } return hasAttribute; @@ -6183,12 +6183,12 @@ void AttStartEndId::ResetStartEndId() m_endid = ""; } -bool AttStartEndId::ReadStartEndId(pugi::xml_node element) +bool AttStartEndId::ReadStartEndId(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("endid")) { this->SetEndid(StrToStr(element.attribute("endid").value())); - element.remove_attribute("endid"); + if (removeAttr) element.remove_attribute("endid"); hasAttribute = true; } return hasAttribute; @@ -6227,12 +6227,12 @@ void AttStartId::ResetStartId() m_startid = ""; } -bool AttStartId::ReadStartId(pugi::xml_node element) +bool AttStartId::ReadStartId(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("startid")) { this->SetStartid(StrToStr(element.attribute("startid").value())); - element.remove_attribute("startid"); + if (removeAttr) element.remove_attribute("startid"); hasAttribute = true; } return hasAttribute; @@ -6278,47 +6278,47 @@ void AttStems::ResetStems() m_stemY = 0.0; } -bool AttStems::ReadStems(pugi::xml_node element) +bool AttStems::ReadStems(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("stem.dir")) { this->SetStemDir(StrToStemdirection(element.attribute("stem.dir").value())); - element.remove_attribute("stem.dir"); + if (removeAttr) element.remove_attribute("stem.dir"); hasAttribute = true; } if (element.attribute("stem.len")) { this->SetStemLen(StrToDbl(element.attribute("stem.len").value())); - element.remove_attribute("stem.len"); + if (removeAttr) element.remove_attribute("stem.len"); hasAttribute = true; } if (element.attribute("stem.mod")) { this->SetStemMod(StrToStemmodifier(element.attribute("stem.mod").value())); - element.remove_attribute("stem.mod"); + if (removeAttr) element.remove_attribute("stem.mod"); hasAttribute = true; } if (element.attribute("stem.pos")) { this->SetStemPos(StrToStemposition(element.attribute("stem.pos").value())); - element.remove_attribute("stem.pos"); + if (removeAttr) element.remove_attribute("stem.pos"); hasAttribute = true; } if (element.attribute("stem.sameas")) { this->SetStemSameas(StrToStr(element.attribute("stem.sameas").value())); - element.remove_attribute("stem.sameas"); + if (removeAttr) element.remove_attribute("stem.sameas"); hasAttribute = true; } if (element.attribute("stem.visible")) { this->SetStemVisible(StrToBoolean(element.attribute("stem.visible").value())); - element.remove_attribute("stem.visible"); + if (removeAttr) element.remove_attribute("stem.visible"); hasAttribute = true; } if (element.attribute("stem.x")) { this->SetStemX(StrToDbl(element.attribute("stem.x").value())); - element.remove_attribute("stem.x"); + if (removeAttr) element.remove_attribute("stem.x"); hasAttribute = true; } if (element.attribute("stem.y")) { this->SetStemY(StrToDbl(element.attribute("stem.y").value())); - element.remove_attribute("stem.y"); + if (removeAttr) element.remove_attribute("stem.y"); hasAttribute = true; } return hasAttribute; @@ -6421,17 +6421,17 @@ void AttSylLog::ResetSylLog() m_wordpos = sylLog_WORDPOS_NONE; } -bool AttSylLog::ReadSylLog(pugi::xml_node element) +bool AttSylLog::ReadSylLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("con")) { this->SetCon(StrToSylLogCon(element.attribute("con").value())); - element.remove_attribute("con"); + if (removeAttr) element.remove_attribute("con"); hasAttribute = true; } if (element.attribute("wordpos")) { this->SetWordpos(StrToSylLogWordpos(element.attribute("wordpos").value())); - element.remove_attribute("wordpos"); + if (removeAttr) element.remove_attribute("wordpos"); hasAttribute = true; } return hasAttribute; @@ -6479,12 +6479,12 @@ void AttSylText::ResetSylText() m_syl = ""; } -bool AttSylText::ReadSylText(pugi::xml_node element) +bool AttSylText::ReadSylText(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("syl")) { this->SetSyl(StrToStr(element.attribute("syl").value())); - element.remove_attribute("syl"); + if (removeAttr) element.remove_attribute("syl"); hasAttribute = true; } return hasAttribute; @@ -6526,27 +6526,27 @@ void AttSystems::ResetSystems() m_systemTopmar = data_MEASUREMENTUNSIGNED(); } -bool AttSystems::ReadSystems(pugi::xml_node element) +bool AttSystems::ReadSystems(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("system.leftline")) { this->SetSystemLeftline(StrToBoolean(element.attribute("system.leftline").value())); - element.remove_attribute("system.leftline"); + if (removeAttr) element.remove_attribute("system.leftline"); hasAttribute = true; } if (element.attribute("system.leftmar")) { this->SetSystemLeftmar(StrToMeasurementunsigned(element.attribute("system.leftmar").value())); - element.remove_attribute("system.leftmar"); + if (removeAttr) element.remove_attribute("system.leftmar"); hasAttribute = true; } if (element.attribute("system.rightmar")) { this->SetSystemRightmar(StrToMeasurementunsigned(element.attribute("system.rightmar").value())); - element.remove_attribute("system.rightmar"); + if (removeAttr) element.remove_attribute("system.rightmar"); hasAttribute = true; } if (element.attribute("system.topmar")) { this->SetSystemTopmar(StrToMeasurementunsigned(element.attribute("system.topmar").value())); - element.remove_attribute("system.topmar"); + if (removeAttr) element.remove_attribute("system.topmar"); hasAttribute = true; } return hasAttribute; @@ -6612,12 +6612,12 @@ void AttTargetEval::ResetTargetEval() m_evaluate = targetEval_EVALUATE_NONE; } -bool AttTargetEval::ReadTargetEval(pugi::xml_node element) +bool AttTargetEval::ReadTargetEval(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("evaluate")) { this->SetEvaluate(StrToTargetEvalEvaluate(element.attribute("evaluate").value())); - element.remove_attribute("evaluate"); + if (removeAttr) element.remove_attribute("evaluate"); hasAttribute = true; } return hasAttribute; @@ -6656,12 +6656,12 @@ void AttTempoLog::ResetTempoLog() m_func = tempoLog_FUNC_NONE; } -bool AttTempoLog::ReadTempoLog(pugi::xml_node element) +bool AttTempoLog::ReadTempoLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("func")) { this->SetFunc(StrToTempoLogFunc(element.attribute("func").value())); - element.remove_attribute("func"); + if (removeAttr) element.remove_attribute("func"); hasAttribute = true; } return hasAttribute; @@ -6701,17 +6701,17 @@ void AttTextRendition::ResetTextRendition() m_rend = TEXTRENDITION_NONE; } -bool AttTextRendition::ReadTextRendition(pugi::xml_node element) +bool AttTextRendition::ReadTextRendition(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("altrend")) { this->SetAltrend(StrToStr(element.attribute("altrend").value())); - element.remove_attribute("altrend"); + if (removeAttr) element.remove_attribute("altrend"); hasAttribute = true; } if (element.attribute("rend")) { this->SetRend(StrToTextrendition(element.attribute("rend").value())); - element.remove_attribute("rend"); + if (removeAttr) element.remove_attribute("rend"); hasAttribute = true; } return hasAttribute; @@ -6763,32 +6763,32 @@ void AttTextStyle::ResetTextStyle() m_textWeight = FONTWEIGHT_NONE; } -bool AttTextStyle::ReadTextStyle(pugi::xml_node element) +bool AttTextStyle::ReadTextStyle(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("text.fam")) { this->SetTextFam(StrToStr(element.attribute("text.fam").value())); - element.remove_attribute("text.fam"); + if (removeAttr) element.remove_attribute("text.fam"); hasAttribute = true; } if (element.attribute("text.name")) { this->SetTextName(StrToStr(element.attribute("text.name").value())); - element.remove_attribute("text.name"); + if (removeAttr) element.remove_attribute("text.name"); hasAttribute = true; } if (element.attribute("text.size")) { this->SetTextSize(StrToFontsize(element.attribute("text.size").value())); - element.remove_attribute("text.size"); + if (removeAttr) element.remove_attribute("text.size"); hasAttribute = true; } if (element.attribute("text.style")) { this->SetTextStyle(StrToFontstyle(element.attribute("text.style").value())); - element.remove_attribute("text.style"); + if (removeAttr) element.remove_attribute("text.style"); hasAttribute = true; } if (element.attribute("text.weight")) { this->SetTextWeight(StrToFontweight(element.attribute("text.weight").value())); - element.remove_attribute("text.weight"); + if (removeAttr) element.remove_attribute("text.weight"); hasAttribute = true; } return hasAttribute; @@ -6863,12 +6863,12 @@ void AttTiePresent::ResetTiePresent() m_tie = TIE_NONE; } -bool AttTiePresent::ReadTiePresent(pugi::xml_node element) +bool AttTiePresent::ReadTiePresent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("tie")) { this->SetTie(StrToTie(element.attribute("tie").value())); - element.remove_attribute("tie"); + if (removeAttr) element.remove_attribute("tie"); hasAttribute = true; } return hasAttribute; @@ -6907,12 +6907,12 @@ void AttTimestampLog::ResetTimestampLog() m_tstamp = -1.0; } -bool AttTimestampLog::ReadTimestampLog(pugi::xml_node element) +bool AttTimestampLog::ReadTimestampLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("tstamp")) { this->SetTstamp(StrToDbl(element.attribute("tstamp").value())); - element.remove_attribute("tstamp"); + if (removeAttr) element.remove_attribute("tstamp"); hasAttribute = true; } return hasAttribute; @@ -6951,12 +6951,12 @@ void AttTimestamp2Log::ResetTimestamp2Log() m_tstamp2 = std::make_pair(-1, -1.0); } -bool AttTimestamp2Log::ReadTimestamp2Log(pugi::xml_node element) +bool AttTimestamp2Log::ReadTimestamp2Log(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("tstamp2")) { this->SetTstamp2(StrToMeasurebeat(element.attribute("tstamp2").value())); - element.remove_attribute("tstamp2"); + if (removeAttr) element.remove_attribute("tstamp2"); hasAttribute = true; } return hasAttribute; @@ -6996,17 +6996,17 @@ void AttTransposition::ResetTransposition() m_transSemi = MEI_UNSET; } -bool AttTransposition::ReadTransposition(pugi::xml_node element) +bool AttTransposition::ReadTransposition(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("trans.diat")) { this->SetTransDiat(StrToInt(element.attribute("trans.diat").value())); - element.remove_attribute("trans.diat"); + if (removeAttr) element.remove_attribute("trans.diat"); hasAttribute = true; } if (element.attribute("trans.semi")) { this->SetTransSemi(StrToInt(element.attribute("trans.semi").value())); - element.remove_attribute("trans.semi"); + if (removeAttr) element.remove_attribute("trans.semi"); hasAttribute = true; } return hasAttribute; @@ -7056,22 +7056,22 @@ void AttTuning::ResetTuning() m_tuneTemper = TEMPERAMENT_NONE; } -bool AttTuning::ReadTuning(pugi::xml_node element) +bool AttTuning::ReadTuning(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("tune.Hz")) { this->SetTuneHz(StrToDbl(element.attribute("tune.Hz").value())); - element.remove_attribute("tune.Hz"); + if (removeAttr) element.remove_attribute("tune.Hz"); hasAttribute = true; } if (element.attribute("tune.pname")) { this->SetTunePname(StrToPitchname(element.attribute("tune.pname").value())); - element.remove_attribute("tune.pname"); + if (removeAttr) element.remove_attribute("tune.pname"); hasAttribute = true; } if (element.attribute("tune.temper")) { this->SetTuneTemper(StrToTemperament(element.attribute("tune.temper").value())); - element.remove_attribute("tune.temper"); + if (removeAttr) element.remove_attribute("tune.temper"); hasAttribute = true; } return hasAttribute; @@ -7128,12 +7128,12 @@ void AttTupletPresent::ResetTupletPresent() m_tuplet = ""; } -bool AttTupletPresent::ReadTupletPresent(pugi::xml_node element) +bool AttTupletPresent::ReadTupletPresent(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("tuplet")) { this->SetTuplet(StrToStr(element.attribute("tuplet").value())); - element.remove_attribute("tuplet"); + if (removeAttr) element.remove_attribute("tuplet"); hasAttribute = true; } return hasAttribute; @@ -7172,12 +7172,12 @@ void AttTyped::ResetTyped() m_type = ""; } -bool AttTyped::ReadTyped(pugi::xml_node element) +bool AttTyped::ReadTyped(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("type")) { this->SetType(StrToStr(element.attribute("type").value())); - element.remove_attribute("type"); + if (removeAttr) element.remove_attribute("type"); hasAttribute = true; } return hasAttribute; @@ -7222,42 +7222,42 @@ void AttTypography::ResetTypography() m_lineheight = ""; } -bool AttTypography::ReadTypography(pugi::xml_node element) +bool AttTypography::ReadTypography(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("fontfam")) { this->SetFontfam(StrToStr(element.attribute("fontfam").value())); - element.remove_attribute("fontfam"); + if (removeAttr) element.remove_attribute("fontfam"); hasAttribute = true; } if (element.attribute("fontname")) { this->SetFontname(StrToStr(element.attribute("fontname").value())); - element.remove_attribute("fontname"); + if (removeAttr) element.remove_attribute("fontname"); hasAttribute = true; } if (element.attribute("fontsize")) { this->SetFontsize(StrToFontsize(element.attribute("fontsize").value())); - element.remove_attribute("fontsize"); + if (removeAttr) element.remove_attribute("fontsize"); hasAttribute = true; } if (element.attribute("fontstyle")) { this->SetFontstyle(StrToFontstyle(element.attribute("fontstyle").value())); - element.remove_attribute("fontstyle"); + if (removeAttr) element.remove_attribute("fontstyle"); hasAttribute = true; } if (element.attribute("fontweight")) { this->SetFontweight(StrToFontweight(element.attribute("fontweight").value())); - element.remove_attribute("fontweight"); + if (removeAttr) element.remove_attribute("fontweight"); hasAttribute = true; } if (element.attribute("letterspacing")) { this->SetLetterspacing(StrToDbl(element.attribute("letterspacing").value())); - element.remove_attribute("letterspacing"); + if (removeAttr) element.remove_attribute("letterspacing"); hasAttribute = true; } if (element.attribute("lineheight")) { this->SetLineheight(StrToStr(element.attribute("lineheight").value())); - element.remove_attribute("lineheight"); + if (removeAttr) element.remove_attribute("lineheight"); hasAttribute = true; } return hasAttribute; @@ -7350,12 +7350,12 @@ void AttVerticalAlign::ResetVerticalAlign() m_valign = VERTICALALIGNMENT_NONE; } -bool AttVerticalAlign::ReadVerticalAlign(pugi::xml_node element) +bool AttVerticalAlign::ReadVerticalAlign(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("valign")) { this->SetValign(StrToVerticalalignment(element.attribute("valign").value())); - element.remove_attribute("valign"); + if (removeAttr) element.remove_attribute("valign"); hasAttribute = true; } return hasAttribute; @@ -7394,12 +7394,12 @@ void AttVerticalGroup::ResetVerticalGroup() m_vgrp = MEI_UNSET; } -bool AttVerticalGroup::ReadVerticalGroup(pugi::xml_node element) +bool AttVerticalGroup::ReadVerticalGroup(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("vgrp")) { this->SetVgrp(StrToInt(element.attribute("vgrp").value())); - element.remove_attribute("vgrp"); + if (removeAttr) element.remove_attribute("vgrp"); hasAttribute = true; } return hasAttribute; @@ -7438,12 +7438,12 @@ void AttVisibility::ResetVisibility() m_visible = BOOLEAN_NONE; } -bool AttVisibility::ReadVisibility(pugi::xml_node element) +bool AttVisibility::ReadVisibility(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("visible")) { this->SetVisible(StrToBoolean(element.attribute("visible").value())); - element.remove_attribute("visible"); + if (removeAttr) element.remove_attribute("visible"); hasAttribute = true; } return hasAttribute; @@ -7482,12 +7482,12 @@ void AttVisualOffsetHo::ResetVisualOffsetHo() m_ho = data_MEASUREMENTSIGNED(); } -bool AttVisualOffsetHo::ReadVisualOffsetHo(pugi::xml_node element) +bool AttVisualOffsetHo::ReadVisualOffsetHo(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("ho")) { this->SetHo(StrToMeasurementsigned(element.attribute("ho").value())); - element.remove_attribute("ho"); + if (removeAttr) element.remove_attribute("ho"); hasAttribute = true; } return hasAttribute; @@ -7526,12 +7526,12 @@ void AttVisualOffsetTo::ResetVisualOffsetTo() m_to = 0.0; } -bool AttVisualOffsetTo::ReadVisualOffsetTo(pugi::xml_node element) +bool AttVisualOffsetTo::ReadVisualOffsetTo(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("to")) { this->SetTo(StrToDbl(element.attribute("to").value())); - element.remove_attribute("to"); + if (removeAttr) element.remove_attribute("to"); hasAttribute = true; } return hasAttribute; @@ -7570,12 +7570,12 @@ void AttVisualOffsetVo::ResetVisualOffsetVo() m_vo = data_MEASUREMENTSIGNED(); } -bool AttVisualOffsetVo::ReadVisualOffsetVo(pugi::xml_node element) +bool AttVisualOffsetVo::ReadVisualOffsetVo(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("vo")) { this->SetVo(StrToMeasurementsigned(element.attribute("vo").value())); - element.remove_attribute("vo"); + if (removeAttr) element.remove_attribute("vo"); hasAttribute = true; } return hasAttribute; @@ -7615,17 +7615,17 @@ void AttVisualOffset2Ho::ResetVisualOffset2Ho() m_endho = data_MEASUREMENTSIGNED(); } -bool AttVisualOffset2Ho::ReadVisualOffset2Ho(pugi::xml_node element) +bool AttVisualOffset2Ho::ReadVisualOffset2Ho(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("startho")) { this->SetStartho(StrToMeasurementsigned(element.attribute("startho").value())); - element.remove_attribute("startho"); + if (removeAttr) element.remove_attribute("startho"); hasAttribute = true; } if (element.attribute("endho")) { this->SetEndho(StrToMeasurementsigned(element.attribute("endho").value())); - element.remove_attribute("endho"); + if (removeAttr) element.remove_attribute("endho"); hasAttribute = true; } return hasAttribute; @@ -7674,17 +7674,17 @@ void AttVisualOffset2To::ResetVisualOffset2To() m_endto = 0.0; } -bool AttVisualOffset2To::ReadVisualOffset2To(pugi::xml_node element) +bool AttVisualOffset2To::ReadVisualOffset2To(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("startto")) { this->SetStartto(StrToDbl(element.attribute("startto").value())); - element.remove_attribute("startto"); + if (removeAttr) element.remove_attribute("startto"); hasAttribute = true; } if (element.attribute("endto")) { this->SetEndto(StrToDbl(element.attribute("endto").value())); - element.remove_attribute("endto"); + if (removeAttr) element.remove_attribute("endto"); hasAttribute = true; } return hasAttribute; @@ -7733,17 +7733,17 @@ void AttVisualOffset2Vo::ResetVisualOffset2Vo() m_endvo = data_MEASUREMENTSIGNED(); } -bool AttVisualOffset2Vo::ReadVisualOffset2Vo(pugi::xml_node element) +bool AttVisualOffset2Vo::ReadVisualOffset2Vo(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("startvo")) { this->SetStartvo(StrToMeasurementsigned(element.attribute("startvo").value())); - element.remove_attribute("startvo"); + if (removeAttr) element.remove_attribute("startvo"); hasAttribute = true; } if (element.attribute("endvo")) { this->SetEndvo(StrToMeasurementsigned(element.attribute("endvo").value())); - element.remove_attribute("endvo"); + if (removeAttr) element.remove_attribute("endvo"); hasAttribute = true; } return hasAttribute; @@ -7791,12 +7791,12 @@ void AttVoltaGroupingSym::ResetVoltaGroupingSym() m_voltasym = voltaGroupingSym_VOLTASYM_NONE; } -bool AttVoltaGroupingSym::ReadVoltaGroupingSym(pugi::xml_node element) +bool AttVoltaGroupingSym::ReadVoltaGroupingSym(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("voltasym")) { this->SetVoltasym(StrToVoltaGroupingSymVoltasym(element.attribute("voltasym").value())); - element.remove_attribute("voltasym"); + if (removeAttr) element.remove_attribute("voltasym"); hasAttribute = true; } return hasAttribute; @@ -7835,12 +7835,12 @@ void AttWhitespace::ResetWhitespace() m_space = ""; } -bool AttWhitespace::ReadWhitespace(pugi::xml_node element) +bool AttWhitespace::ReadWhitespace(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("xml:space")) { this->SetSpace(StrToStr(element.attribute("xml:space").value())); - element.remove_attribute("xml:space"); + if (removeAttr) element.remove_attribute("xml:space"); hasAttribute = true; } return hasAttribute; @@ -7879,12 +7879,12 @@ void AttWidth::ResetWidth() m_width = data_MEASUREMENTUNSIGNED(); } -bool AttWidth::ReadWidth(pugi::xml_node element) +bool AttWidth::ReadWidth(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("width")) { this->SetWidth(StrToMeasurementunsigned(element.attribute("width").value())); - element.remove_attribute("width"); + if (removeAttr) element.remove_attribute("width"); hasAttribute = true; } return hasAttribute; @@ -7924,17 +7924,17 @@ void AttXy::ResetXy() m_y = 0.0; } -bool AttXy::ReadXy(pugi::xml_node element) +bool AttXy::ReadXy(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("x")) { this->SetX(StrToDbl(element.attribute("x").value())); - element.remove_attribute("x"); + if (removeAttr) element.remove_attribute("x"); hasAttribute = true; } if (element.attribute("y")) { this->SetY(StrToDbl(element.attribute("y").value())); - element.remove_attribute("y"); + if (removeAttr) element.remove_attribute("y"); hasAttribute = true; } return hasAttribute; @@ -7983,17 +7983,17 @@ void AttXy2::ResetXy2() m_y2 = 0.0; } -bool AttXy2::ReadXy2(pugi::xml_node element) +bool AttXy2::ReadXy2(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("x2")) { this->SetX2(StrToDbl(element.attribute("x2").value())); - element.remove_attribute("x2"); + if (removeAttr) element.remove_attribute("x2"); hasAttribute = true; } if (element.attribute("y2")) { this->SetY2(StrToDbl(element.attribute("y2").value())); - element.remove_attribute("y2"); + if (removeAttr) element.remove_attribute("y2"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_shared.h b/libmei/dist/atts_shared.h index fae862c7e70..51e2d7f57e5 100644 --- a/libmei/dist/atts_shared.h +++ b/libmei/dist/atts_shared.h @@ -38,7 +38,7 @@ class AttAccidLog : public Att { void ResetAccidLog(); /** Read the values for the attribute class **/ - bool ReadAccidLog(pugi::xml_node element); + bool ReadAccidLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteAccidLog(pugi::xml_node element); @@ -73,7 +73,7 @@ class AttAccidental : public Att { void ResetAccidental(); /** Read the values for the attribute class **/ - bool ReadAccidental(pugi::xml_node element); + bool ReadAccidental(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteAccidental(pugi::xml_node element); @@ -108,7 +108,7 @@ class AttArticulation : public Att { void ResetArticulation(); /** Read the values for the attribute class **/ - bool ReadArticulation(pugi::xml_node element); + bool ReadArticulation(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteArticulation(pugi::xml_node element); @@ -149,7 +149,7 @@ class AttAttaccaLog : public Att { void ResetAttaccaLog(); /** Read the values for the attribute class **/ - bool ReadAttaccaLog(pugi::xml_node element); + bool ReadAttaccaLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteAttaccaLog(pugi::xml_node element); @@ -184,7 +184,7 @@ class AttAudience : public Att { void ResetAudience(); /** Read the values for the attribute class **/ - bool ReadAudience(pugi::xml_node element); + bool ReadAudience(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteAudience(pugi::xml_node element); @@ -219,7 +219,7 @@ class AttAugmentDots : public Att { void ResetAugmentDots(); /** Read the values for the attribute class **/ - bool ReadAugmentDots(pugi::xml_node element); + bool ReadAugmentDots(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteAugmentDots(pugi::xml_node element); @@ -254,7 +254,7 @@ class AttAuthorized : public Att { void ResetAuthorized(); /** Read the values for the attribute class **/ - bool ReadAuthorized(pugi::xml_node element); + bool ReadAuthorized(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteAuthorized(pugi::xml_node element); @@ -303,7 +303,7 @@ class AttBarLineLog : public Att { void ResetBarLineLog(); /** Read the values for the attribute class **/ - bool ReadBarLineLog(pugi::xml_node element); + bool ReadBarLineLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBarLineLog(pugi::xml_node element); @@ -338,7 +338,7 @@ class AttBarring : public Att { void ResetBarring(); /** Read the values for the attribute class **/ - bool ReadBarring(pugi::xml_node element); + bool ReadBarring(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBarring(pugi::xml_node element); @@ -392,7 +392,7 @@ class AttBasic : public Att { void ResetBasic(); /** Read the values for the attribute class **/ - bool ReadBasic(pugi::xml_node element); + bool ReadBasic(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBasic(pugi::xml_node element); @@ -427,7 +427,7 @@ class AttBibl : public Att { void ResetBibl(); /** Read the values for the attribute class **/ - bool ReadBibl(pugi::xml_node element); + bool ReadBibl(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBibl(pugi::xml_node element); @@ -465,7 +465,7 @@ class AttCalendared : public Att { void ResetCalendared(); /** Read the values for the attribute class **/ - bool ReadCalendared(pugi::xml_node element); + bool ReadCalendared(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCalendared(pugi::xml_node element); @@ -503,7 +503,7 @@ class AttCanonical : public Att { void ResetCanonical(); /** Read the values for the attribute class **/ - bool ReadCanonical(pugi::xml_node element); + bool ReadCanonical(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCanonical(pugi::xml_node element); @@ -542,7 +542,7 @@ class AttClassed : public Att { void ResetClassed(); /** Read the values for the attribute class **/ - bool ReadClassed(pugi::xml_node element); + bool ReadClassed(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteClassed(pugi::xml_node element); @@ -580,7 +580,7 @@ class AttClefLog : public Att { void ResetClefLog(); /** Read the values for the attribute class **/ - bool ReadClefLog(pugi::xml_node element); + bool ReadClefLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteClefLog(pugi::xml_node element); @@ -618,7 +618,7 @@ class AttClefShape : public Att { void ResetClefShape(); /** Read the values for the attribute class **/ - bool ReadClefShape(pugi::xml_node element); + bool ReadClefShape(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteClefShape(pugi::xml_node element); @@ -653,7 +653,7 @@ class AttCleffingLog : public Att { void ResetCleffingLog(); /** Read the values for the attribute class **/ - bool ReadCleffingLog(pugi::xml_node element); + bool ReadCleffingLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCleffingLog(pugi::xml_node element); @@ -710,7 +710,7 @@ class AttColor : public Att { void ResetColor(); /** Read the values for the attribute class **/ - bool ReadColor(pugi::xml_node element); + bool ReadColor(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteColor(pugi::xml_node element); @@ -748,7 +748,7 @@ class AttColoration : public Att { void ResetColoration(); /** Read the values for the attribute class **/ - bool ReadColoration(pugi::xml_node element); + bool ReadColoration(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteColoration(pugi::xml_node element); @@ -790,7 +790,7 @@ class AttCoordX1 : public Att { void ResetCoordX1(); /** Read the values for the attribute class **/ - bool ReadCoordX1(pugi::xml_node element); + bool ReadCoordX1(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCoordX1(pugi::xml_node element); @@ -825,7 +825,7 @@ class AttCoordX2 : public Att { void ResetCoordX2(); /** Read the values for the attribute class **/ - bool ReadCoordX2(pugi::xml_node element); + bool ReadCoordX2(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCoordX2(pugi::xml_node element); @@ -860,7 +860,7 @@ class AttCoordY1 : public Att { void ResetCoordY1(); /** Read the values for the attribute class **/ - bool ReadCoordY1(pugi::xml_node element); + bool ReadCoordY1(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCoordY1(pugi::xml_node element); @@ -895,7 +895,7 @@ class AttCoordinated : public Att { void ResetCoordinated(); /** Read the values for the attribute class **/ - bool ReadCoordinated(pugi::xml_node element); + bool ReadCoordinated(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCoordinated(pugi::xml_node element); @@ -959,7 +959,7 @@ class AttCue : public Att { void ResetCue(); /** Read the values for the attribute class **/ - bool ReadCue(pugi::xml_node element); + bool ReadCue(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCue(pugi::xml_node element); @@ -994,7 +994,7 @@ class AttCurvature : public Att { void ResetCurvature(); /** Read the values for the attribute class **/ - bool ReadCurvature(pugi::xml_node element); + bool ReadCurvature(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCurvature(pugi::xml_node element); @@ -1053,7 +1053,7 @@ class AttCurveRend : public Att { void ResetCurveRend(); /** Read the values for the attribute class **/ - bool ReadCurveRend(pugi::xml_node element); + bool ReadCurveRend(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCurveRend(pugi::xml_node element); @@ -1096,7 +1096,7 @@ class AttCustosLog : public Att { void ResetCustosLog(); /** Read the values for the attribute class **/ - bool ReadCustosLog(pugi::xml_node element); + bool ReadCustosLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCustosLog(pugi::xml_node element); @@ -1131,7 +1131,7 @@ class AttDataPointing : public Att { void ResetDataPointing(); /** Read the values for the attribute class **/ - bool ReadDataPointing(pugi::xml_node element); + bool ReadDataPointing(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteDataPointing(pugi::xml_node element); @@ -1166,7 +1166,7 @@ class AttDatable : public Att { void ResetDatable(); /** Read the values for the attribute class **/ - bool ReadDatable(pugi::xml_node element); + bool ReadDatable(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteDatable(pugi::xml_node element); @@ -1225,7 +1225,7 @@ class AttDistances : public Att { void ResetDistances(); /** Read the values for the attribute class **/ - bool ReadDistances(pugi::xml_node element); + bool ReadDistances(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteDistances(pugi::xml_node element); @@ -1287,7 +1287,7 @@ class AttDotLog : public Att { void ResetDotLog(); /** Read the values for the attribute class **/ - bool ReadDotLog(pugi::xml_node element); + bool ReadDotLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteDotLog(pugi::xml_node element); @@ -1322,7 +1322,7 @@ class AttDurationAdditive : public Att { void ResetDurationAdditive(); /** Read the values for the attribute class **/ - bool ReadDurationAdditive(pugi::xml_node element); + bool ReadDurationAdditive(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteDurationAdditive(pugi::xml_node element); @@ -1360,7 +1360,7 @@ class AttDurationDefault : public Att { void ResetDurationDefault(); /** Read the values for the attribute class **/ - bool ReadDurationDefault(pugi::xml_node element); + bool ReadDurationDefault(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteDurationDefault(pugi::xml_node element); @@ -1417,7 +1417,7 @@ class AttDurationLog : public Att { void ResetDurationLog(); /** Read the values for the attribute class **/ - bool ReadDurationLog(pugi::xml_node element); + bool ReadDurationLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteDurationLog(pugi::xml_node element); @@ -1455,7 +1455,7 @@ class AttDurationRatio : public Att { void ResetDurationRatio(); /** Read the values for the attribute class **/ - bool ReadDurationRatio(pugi::xml_node element); + bool ReadDurationRatio(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteDurationRatio(pugi::xml_node element); @@ -1499,7 +1499,7 @@ class AttEnclosingChars : public Att { void ResetEnclosingChars(); /** Read the values for the attribute class **/ - bool ReadEnclosingChars(pugi::xml_node element); + bool ReadEnclosingChars(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteEnclosingChars(pugi::xml_node element); @@ -1539,7 +1539,7 @@ class AttEndings : public Att { void ResetEndings(); /** Read the values for the attribute class **/ - bool ReadEndings(pugi::xml_node element); + bool ReadEndings(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteEndings(pugi::xml_node element); @@ -1574,7 +1574,7 @@ class AttEvidence : public Att { void ResetEvidence(); /** Read the values for the attribute class **/ - bool ReadEvidence(pugi::xml_node element); + bool ReadEvidence(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteEvidence(pugi::xml_node element); @@ -1618,7 +1618,7 @@ class AttExtender : public Att { void ResetExtender(); /** Read the values for the attribute class **/ - bool ReadExtender(pugi::xml_node element); + bool ReadExtender(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteExtender(pugi::xml_node element); @@ -1653,7 +1653,7 @@ class AttExtent : public Att { void ResetExtent(); /** Read the values for the attribute class **/ - bool ReadExtent(pugi::xml_node element); + bool ReadExtent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteExtent(pugi::xml_node element); @@ -1692,7 +1692,7 @@ class AttFermataPresent : public Att { void ResetFermataPresent(); /** Read the values for the attribute class **/ - bool ReadFermataPresent(pugi::xml_node element); + bool ReadFermataPresent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteFermataPresent(pugi::xml_node element); @@ -1731,7 +1731,7 @@ class AttFiling : public Att { void ResetFiling(); /** Read the values for the attribute class **/ - bool ReadFiling(pugi::xml_node element); + bool ReadFiling(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteFiling(pugi::xml_node element); @@ -1769,7 +1769,7 @@ class AttGrpSymLog : public Att { void ResetGrpSymLog(); /** Read the values for the attribute class **/ - bool ReadGrpSymLog(pugi::xml_node element); + bool ReadGrpSymLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteGrpSymLog(pugi::xml_node element); @@ -1804,7 +1804,7 @@ class AttHandIdent : public Att { void ResetHandIdent(); /** Read the values for the attribute class **/ - bool ReadHandIdent(pugi::xml_node element); + bool ReadHandIdent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteHandIdent(pugi::xml_node element); @@ -1842,7 +1842,7 @@ class AttHeight : public Att { void ResetHeight(); /** Read the values for the attribute class **/ - bool ReadHeight(pugi::xml_node element); + bool ReadHeight(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteHeight(pugi::xml_node element); @@ -1877,7 +1877,7 @@ class AttHorizontalAlign : public Att { void ResetHorizontalAlign(); /** Read the values for the attribute class **/ - bool ReadHorizontalAlign(pugi::xml_node element); + bool ReadHorizontalAlign(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteHorizontalAlign(pugi::xml_node element); @@ -1912,7 +1912,7 @@ class AttInternetMedia : public Att { void ResetInternetMedia(); /** Read the values for the attribute class **/ - bool ReadInternetMedia(pugi::xml_node element); + bool ReadInternetMedia(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteInternetMedia(pugi::xml_node element); @@ -1951,7 +1951,7 @@ class AttJoined : public Att { void ResetJoined(); /** Read the values for the attribute class **/ - bool ReadJoined(pugi::xml_node element); + bool ReadJoined(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteJoined(pugi::xml_node element); @@ -1993,7 +1993,7 @@ class AttKeySigLog : public Att { void ResetKeySigLog(); /** Read the values for the attribute class **/ - bool ReadKeySigLog(pugi::xml_node element); + bool ReadKeySigLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteKeySigLog(pugi::xml_node element); @@ -2028,7 +2028,7 @@ class AttKeySigDefaultLog : public Att { void ResetKeySigDefaultLog(); /** Read the values for the attribute class **/ - bool ReadKeySigDefaultLog(pugi::xml_node element); + bool ReadKeySigDefaultLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteKeySigDefaultLog(pugi::xml_node element); @@ -2063,7 +2063,7 @@ class AttLabelled : public Att { void ResetLabelled(); /** Read the values for the attribute class **/ - bool ReadLabelled(pugi::xml_node element); + bool ReadLabelled(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLabelled(pugi::xml_node element); @@ -2102,7 +2102,7 @@ class AttLang : public Att { void ResetLang(); /** Read the values for the attribute class **/ - bool ReadLang(pugi::xml_node element); + bool ReadLang(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLang(pugi::xml_node element); @@ -2143,7 +2143,7 @@ class AttLayerLog : public Att { void ResetLayerLog(); /** Read the values for the attribute class **/ - bool ReadLayerLog(pugi::xml_node element); + bool ReadLayerLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLayerLog(pugi::xml_node element); @@ -2178,7 +2178,7 @@ class AttLayerIdent : public Att { void ResetLayerIdent(); /** Read the values for the attribute class **/ - bool ReadLayerIdent(pugi::xml_node element); + bool ReadLayerIdent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLayerIdent(pugi::xml_node element); @@ -2213,7 +2213,7 @@ class AttLineLoc : public Att { void ResetLineLoc(); /** Read the values for the attribute class **/ - bool ReadLineLoc(pugi::xml_node element); + bool ReadLineLoc(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLineLoc(pugi::xml_node element); @@ -2252,7 +2252,7 @@ class AttLineRend : public Att { void ResetLineRend(); /** Read the values for the attribute class **/ - bool ReadLineRend(pugi::xml_node element); + bool ReadLineRend(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLineRend(pugi::xml_node element); @@ -2305,7 +2305,7 @@ class AttLineRendBase : public Att { void ResetLineRendBase(); /** Read the values for the attribute class **/ - bool ReadLineRendBase(pugi::xml_node element); + bool ReadLineRendBase(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLineRendBase(pugi::xml_node element); @@ -2360,7 +2360,7 @@ class AttLinking : public Att { void ResetLinking(); /** Read the values for the attribute class **/ - bool ReadLinking(pugi::xml_node element); + bool ReadLinking(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLinking(pugi::xml_node element); @@ -2449,7 +2449,7 @@ class AttLyricStyle : public Att { void ResetLyricStyle(); /** Read the values for the attribute class **/ - bool ReadLyricStyle(pugi::xml_node element); + bool ReadLyricStyle(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLyricStyle(pugi::xml_node element); @@ -2516,7 +2516,7 @@ class AttMeasureNumbers : public Att { void ResetMeasureNumbers(); /** Read the values for the attribute class **/ - bool ReadMeasureNumbers(pugi::xml_node element); + bool ReadMeasureNumbers(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMeasureNumbers(pugi::xml_node element); @@ -2551,7 +2551,7 @@ class AttMeasurement : public Att { void ResetMeasurement(); /** Read the values for the attribute class **/ - bool ReadMeasurement(pugi::xml_node element); + bool ReadMeasurement(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMeasurement(pugi::xml_node element); @@ -2586,7 +2586,7 @@ class AttMediaBounds : public Att { void ResetMediaBounds(); /** Read the values for the attribute class **/ - bool ReadMediaBounds(pugi::xml_node element); + bool ReadMediaBounds(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMediaBounds(pugi::xml_node element); @@ -2646,7 +2646,7 @@ class AttMedium : public Att { void ResetMedium(); /** Read the values for the attribute class **/ - bool ReadMedium(pugi::xml_node element); + bool ReadMedium(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMedium(pugi::xml_node element); @@ -2681,7 +2681,7 @@ class AttMeiVersion : public Att { void ResetMeiVersion(); /** Read the values for the attribute class **/ - bool ReadMeiVersion(pugi::xml_node element); + bool ReadMeiVersion(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMeiVersion(pugi::xml_node element); @@ -2716,7 +2716,7 @@ class AttMetadataPointing : public Att { void ResetMetadataPointing(); /** Read the values for the attribute class **/ - bool ReadMetadataPointing(pugi::xml_node element); + bool ReadMetadataPointing(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMetadataPointing(pugi::xml_node element); @@ -2755,7 +2755,7 @@ class AttMeterConformance : public Att { void ResetMeterConformance(); /** Read the values for the attribute class **/ - bool ReadMeterConformance(pugi::xml_node element); + bool ReadMeterConformance(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMeterConformance(pugi::xml_node element); @@ -2793,7 +2793,7 @@ class AttMeterConformanceBar : public Att { void ResetMeterConformanceBar(); /** Read the values for the attribute class **/ - bool ReadMeterConformanceBar(pugi::xml_node element); + bool ReadMeterConformanceBar(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMeterConformanceBar(pugi::xml_node element); @@ -2843,7 +2843,7 @@ class AttMeterSigLog : public Att { void ResetMeterSigLog(); /** Read the values for the attribute class **/ - bool ReadMeterSigLog(pugi::xml_node element); + bool ReadMeterSigLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMeterSigLog(pugi::xml_node element); @@ -2893,7 +2893,7 @@ class AttMeterSigDefaultLog : public Att { void ResetMeterSigDefaultLog(); /** Read the values for the attribute class **/ - bool ReadMeterSigDefaultLog(pugi::xml_node element); + bool ReadMeterSigDefaultLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMeterSigDefaultLog(pugi::xml_node element); @@ -2951,7 +2951,7 @@ class AttMmTempo : public Att { void ResetMmTempo(); /** Read the values for the attribute class **/ - bool ReadMmTempo(pugi::xml_node element); + bool ReadMmTempo(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMmTempo(pugi::xml_node element); @@ -3004,7 +3004,7 @@ class AttMultinumMeasures : public Att { void ResetMultinumMeasures(); /** Read the values for the attribute class **/ - bool ReadMultinumMeasures(pugi::xml_node element); + bool ReadMultinumMeasures(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMultinumMeasures(pugi::xml_node element); @@ -3042,7 +3042,7 @@ class AttNInteger : public Att { void ResetNInteger(); /** Read the values for the attribute class **/ - bool ReadNInteger(pugi::xml_node element); + bool ReadNInteger(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteNInteger(pugi::xml_node element); @@ -3081,7 +3081,7 @@ class AttNNumberLike : public Att { void ResetNNumberLike(); /** Read the values for the attribute class **/ - bool ReadNNumberLike(pugi::xml_node element); + bool ReadNNumberLike(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteNNumberLike(pugi::xml_node element); @@ -3120,7 +3120,7 @@ class AttName : public Att { void ResetName(); /** Read the values for the attribute class **/ - bool ReadName(pugi::xml_node element); + bool ReadName(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteName(pugi::xml_node element); @@ -3167,7 +3167,7 @@ class AttNotationStyle : public Att { void ResetNotationStyle(); /** Read the values for the attribute class **/ - bool ReadNotationStyle(pugi::xml_node element); + bool ReadNotationStyle(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteNotationStyle(pugi::xml_node element); @@ -3210,7 +3210,7 @@ class AttNoteHeads : public Att { void ResetNoteHeads(); /** Read the values for the attribute class **/ - bool ReadNoteHeads(pugi::xml_node element); + bool ReadNoteHeads(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteNoteHeads(pugi::xml_node element); @@ -3307,7 +3307,7 @@ class AttOctave : public Att { void ResetOctave(); /** Read the values for the attribute class **/ - bool ReadOctave(pugi::xml_node element); + bool ReadOctave(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteOctave(pugi::xml_node element); @@ -3342,7 +3342,7 @@ class AttOctaveDefault : public Att { void ResetOctaveDefault(); /** Read the values for the attribute class **/ - bool ReadOctaveDefault(pugi::xml_node element); + bool ReadOctaveDefault(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteOctaveDefault(pugi::xml_node element); @@ -3381,7 +3381,7 @@ class AttOctaveDisplacement : public Att { void ResetOctaveDisplacement(); /** Read the values for the attribute class **/ - bool ReadOctaveDisplacement(pugi::xml_node element); + bool ReadOctaveDisplacement(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteOctaveDisplacement(pugi::xml_node element); @@ -3422,7 +3422,7 @@ class AttOneLineStaff : public Att { void ResetOneLineStaff(); /** Read the values for the attribute class **/ - bool ReadOneLineStaff(pugi::xml_node element); + bool ReadOneLineStaff(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteOneLineStaff(pugi::xml_node element); @@ -3461,7 +3461,7 @@ class AttOptimization : public Att { void ResetOptimization(); /** Read the values for the attribute class **/ - bool ReadOptimization(pugi::xml_node element); + bool ReadOptimization(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteOptimization(pugi::xml_node element); @@ -3499,7 +3499,7 @@ class AttOriginLayerIdent : public Att { void ResetOriginLayerIdent(); /** Read the values for the attribute class **/ - bool ReadOriginLayerIdent(pugi::xml_node element); + bool ReadOriginLayerIdent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteOriginLayerIdent(pugi::xml_node element); @@ -3534,7 +3534,7 @@ class AttOriginStaffIdent : public Att { void ResetOriginStaffIdent(); /** Read the values for the attribute class **/ - bool ReadOriginStaffIdent(pugi::xml_node element); + bool ReadOriginStaffIdent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteOriginStaffIdent(pugi::xml_node element); @@ -3572,7 +3572,7 @@ class AttOriginStartEndId : public Att { void ResetOriginStartEndId(); /** Read the values for the attribute class **/ - bool ReadOriginStartEndId(pugi::xml_node element); + bool ReadOriginStartEndId(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteOriginStartEndId(pugi::xml_node element); @@ -3613,7 +3613,7 @@ class AttOriginTimestampLog : public Att { void ResetOriginTimestampLog(); /** Read the values for the attribute class **/ - bool ReadOriginTimestampLog(pugi::xml_node element); + bool ReadOriginTimestampLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteOriginTimestampLog(pugi::xml_node element); @@ -3661,7 +3661,7 @@ class AttPages : public Att { void ResetPages(); /** Read the values for the attribute class **/ - bool ReadPages(pugi::xml_node element); + bool ReadPages(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePages(pugi::xml_node element); @@ -3744,7 +3744,7 @@ class AttPartIdent : public Att { void ResetPartIdent(); /** Read the values for the attribute class **/ - bool ReadPartIdent(pugi::xml_node element); + bool ReadPartIdent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePartIdent(pugi::xml_node element); @@ -3791,7 +3791,7 @@ class AttPitch : public Att { void ResetPitch(); /** Read the values for the attribute class **/ - bool ReadPitch(pugi::xml_node element); + bool ReadPitch(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePitch(pugi::xml_node element); @@ -3826,7 +3826,7 @@ class AttPlacementOnStaff : public Att { void ResetPlacementOnStaff(); /** Read the values for the attribute class **/ - bool ReadPlacementOnStaff(pugi::xml_node element); + bool ReadPlacementOnStaff(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePlacementOnStaff(pugi::xml_node element); @@ -3864,7 +3864,7 @@ class AttPlacementRelEvent : public Att { void ResetPlacementRelEvent(); /** Read the values for the attribute class **/ - bool ReadPlacementRelEvent(pugi::xml_node element); + bool ReadPlacementRelEvent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePlacementRelEvent(pugi::xml_node element); @@ -3899,7 +3899,7 @@ class AttPlacementRelStaff : public Att { void ResetPlacementRelStaff(); /** Read the values for the attribute class **/ - bool ReadPlacementRelStaff(pugi::xml_node element); + bool ReadPlacementRelStaff(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePlacementRelStaff(pugi::xml_node element); @@ -3934,7 +3934,7 @@ class AttPlist : public Att { void ResetPlist(); /** Read the values for the attribute class **/ - bool ReadPlist(pugi::xml_node element); + bool ReadPlist(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePlist(pugi::xml_node element); @@ -3975,7 +3975,7 @@ class AttPointing : public Att { void ResetPointing(); /** Read the values for the attribute class **/ - bool ReadPointing(pugi::xml_node element); + bool ReadPointing(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePointing(pugi::xml_node element); @@ -4040,7 +4040,7 @@ class AttQuantity : public Att { void ResetQuantity(); /** Read the values for the attribute class **/ - bool ReadQuantity(pugi::xml_node element); + bool ReadQuantity(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteQuantity(pugi::xml_node element); @@ -4078,7 +4078,7 @@ class AttRanging : public Att { void ResetRanging(); /** Read the values for the attribute class **/ - bool ReadRanging(pugi::xml_node element); + bool ReadRanging(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteRanging(pugi::xml_node element); @@ -4147,7 +4147,7 @@ class AttResponsibility : public Att { void ResetResponsibility(); /** Read the values for the attribute class **/ - bool ReadResponsibility(pugi::xml_node element); + bool ReadResponsibility(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteResponsibility(pugi::xml_node element); @@ -4186,7 +4186,7 @@ class AttRestdurationLog : public Att { void ResetRestdurationLog(); /** Read the values for the attribute class **/ - bool ReadRestdurationLog(pugi::xml_node element); + bool ReadRestdurationLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteRestdurationLog(pugi::xml_node element); @@ -4224,7 +4224,7 @@ class AttScalable : public Att { void ResetScalable(); /** Read the values for the attribute class **/ - bool ReadScalable(pugi::xml_node element); + bool ReadScalable(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteScalable(pugi::xml_node element); @@ -4259,7 +4259,7 @@ class AttSequence : public Att { void ResetSequence(); /** Read the values for the attribute class **/ - bool ReadSequence(pugi::xml_node element); + bool ReadSequence(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSequence(pugi::xml_node element); @@ -4297,7 +4297,7 @@ class AttSlashCount : public Att { void ResetSlashCount(); /** Read the values for the attribute class **/ - bool ReadSlashCount(pugi::xml_node element); + bool ReadSlashCount(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSlashCount(pugi::xml_node element); @@ -4332,7 +4332,7 @@ class AttSlurPresent : public Att { void ResetSlurPresent(); /** Read the values for the attribute class **/ - bool ReadSlurPresent(pugi::xml_node element); + bool ReadSlurPresent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSlurPresent(pugi::xml_node element); @@ -4371,7 +4371,7 @@ class AttSource : public Att { void ResetSource(); /** Read the values for the attribute class **/ - bool ReadSource(pugi::xml_node element); + bool ReadSource(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSource(pugi::xml_node element); @@ -4411,7 +4411,7 @@ class AttSpacing : public Att { void ResetSpacing(); /** Read the values for the attribute class **/ - bool ReadSpacing(pugi::xml_node element); + bool ReadSpacing(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSpacing(pugi::xml_node element); @@ -4473,7 +4473,7 @@ class AttStaffLog : public Att { void ResetStaffLog(); /** Read the values for the attribute class **/ - bool ReadStaffLog(pugi::xml_node element); + bool ReadStaffLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStaffLog(pugi::xml_node element); @@ -4508,7 +4508,7 @@ class AttStaffDefLog : public Att { void ResetStaffDefLog(); /** Read the values for the attribute class **/ - bool ReadStaffDefLog(pugi::xml_node element); + bool ReadStaffDefLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStaffDefLog(pugi::xml_node element); @@ -4543,7 +4543,7 @@ class AttStaffGroupingSym : public Att { void ResetStaffGroupingSym(); /** Read the values for the attribute class **/ - bool ReadStaffGroupingSym(pugi::xml_node element); + bool ReadStaffGroupingSym(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStaffGroupingSym(pugi::xml_node element); @@ -4578,7 +4578,7 @@ class AttStaffIdent : public Att { void ResetStaffIdent(); /** Read the values for the attribute class **/ - bool ReadStaffIdent(pugi::xml_node element); + bool ReadStaffIdent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStaffIdent(pugi::xml_node element); @@ -4617,7 +4617,7 @@ class AttStaffItems : public Att { void ResetStaffItems(); /** Read the values for the attribute class **/ - bool ReadStaffItems(pugi::xml_node element); + bool ReadStaffItems(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStaffItems(pugi::xml_node element); @@ -4670,7 +4670,7 @@ class AttStaffLoc : public Att { void ResetStaffLoc(); /** Read the values for the attribute class **/ - bool ReadStaffLoc(pugi::xml_node element); + bool ReadStaffLoc(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStaffLoc(pugi::xml_node element); @@ -4705,7 +4705,7 @@ class AttStaffLocPitched : public Att { void ResetStaffLocPitched(); /** Read the values for the attribute class **/ - bool ReadStaffLocPitched(pugi::xml_node element); + bool ReadStaffLocPitched(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStaffLocPitched(pugi::xml_node element); @@ -4746,7 +4746,7 @@ class AttStartEndId : public Att { void ResetStartEndId(); /** Read the values for the attribute class **/ - bool ReadStartEndId(pugi::xml_node element); + bool ReadStartEndId(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStartEndId(pugi::xml_node element); @@ -4784,7 +4784,7 @@ class AttStartId : public Att { void ResetStartId(); /** Read the values for the attribute class **/ - bool ReadStartId(pugi::xml_node element); + bool ReadStartId(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStartId(pugi::xml_node element); @@ -4822,7 +4822,7 @@ class AttStems : public Att { void ResetStems(); /** Read the values for the attribute class **/ - bool ReadStems(pugi::xml_node element); + bool ReadStems(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStems(pugi::xml_node element); @@ -4906,7 +4906,7 @@ class AttSylLog : public Att { void ResetSylLog(); /** Read the values for the attribute class **/ - bool ReadSylLog(pugi::xml_node element); + bool ReadSylLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSylLog(pugi::xml_node element); @@ -4950,7 +4950,7 @@ class AttSylText : public Att { void ResetSylText(); /** Read the values for the attribute class **/ - bool ReadSylText(pugi::xml_node element); + bool ReadSylText(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSylText(pugi::xml_node element); @@ -4985,7 +4985,7 @@ class AttSystems : public Att { void ResetSystems(); /** Read the values for the attribute class **/ - bool ReadSystems(pugi::xml_node element); + bool ReadSystems(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSystems(pugi::xml_node element); @@ -5051,7 +5051,7 @@ class AttTargetEval : public Att { void ResetTargetEval(); /** Read the values for the attribute class **/ - bool ReadTargetEval(pugi::xml_node element); + bool ReadTargetEval(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTargetEval(pugi::xml_node element); @@ -5089,7 +5089,7 @@ class AttTempoLog : public Att { void ResetTempoLog(); /** Read the values for the attribute class **/ - bool ReadTempoLog(pugi::xml_node element); + bool ReadTempoLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTempoLog(pugi::xml_node element); @@ -5124,7 +5124,7 @@ class AttTextRendition : public Att { void ResetTextRendition(); /** Read the values for the attribute class **/ - bool ReadTextRendition(pugi::xml_node element); + bool ReadTextRendition(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTextRendition(pugi::xml_node element); @@ -5165,7 +5165,7 @@ class AttTextStyle : public Att { void ResetTextStyle(); /** Read the values for the attribute class **/ - bool ReadTextStyle(pugi::xml_node element); + bool ReadTextStyle(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTextStyle(pugi::xml_node element); @@ -5241,7 +5241,7 @@ class AttTiePresent : public Att { void ResetTiePresent(); /** Read the values for the attribute class **/ - bool ReadTiePresent(pugi::xml_node element); + bool ReadTiePresent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTiePresent(pugi::xml_node element); @@ -5280,7 +5280,7 @@ class AttTimestampLog : public Att { void ResetTimestampLog(); /** Read the values for the attribute class **/ - bool ReadTimestampLog(pugi::xml_node element); + bool ReadTimestampLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTimestampLog(pugi::xml_node element); @@ -5318,7 +5318,7 @@ class AttTimestamp2Log : public Att { void ResetTimestamp2Log(); /** Read the values for the attribute class **/ - bool ReadTimestamp2Log(pugi::xml_node element); + bool ReadTimestamp2Log(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTimestamp2Log(pugi::xml_node element); @@ -5356,7 +5356,7 @@ class AttTransposition : public Att { void ResetTransposition(); /** Read the values for the attribute class **/ - bool ReadTransposition(pugi::xml_node element); + bool ReadTransposition(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTransposition(pugi::xml_node element); @@ -5403,7 +5403,7 @@ class AttTuning : public Att { void ResetTuning(); /** Read the values for the attribute class **/ - bool ReadTuning(pugi::xml_node element); + bool ReadTuning(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTuning(pugi::xml_node element); @@ -5453,7 +5453,7 @@ class AttTupletPresent : public Att { void ResetTupletPresent(); /** Read the values for the attribute class **/ - bool ReadTupletPresent(pugi::xml_node element); + bool ReadTupletPresent(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTupletPresent(pugi::xml_node element); @@ -5492,7 +5492,7 @@ class AttTyped : public Att { void ResetTyped(); /** Read the values for the attribute class **/ - bool ReadTyped(pugi::xml_node element); + bool ReadTyped(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTyped(pugi::xml_node element); @@ -5530,7 +5530,7 @@ class AttTypography : public Att { void ResetTypography(); /** Read the values for the attribute class **/ - bool ReadTypography(pugi::xml_node element); + bool ReadTypography(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTypography(pugi::xml_node element); @@ -5610,7 +5610,7 @@ class AttVerticalAlign : public Att { void ResetVerticalAlign(); /** Read the values for the attribute class **/ - bool ReadVerticalAlign(pugi::xml_node element); + bool ReadVerticalAlign(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteVerticalAlign(pugi::xml_node element); @@ -5645,7 +5645,7 @@ class AttVerticalGroup : public Att { void ResetVerticalGroup(); /** Read the values for the attribute class **/ - bool ReadVerticalGroup(pugi::xml_node element); + bool ReadVerticalGroup(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteVerticalGroup(pugi::xml_node element); @@ -5680,7 +5680,7 @@ class AttVisibility : public Att { void ResetVisibility(); /** Read the values for the attribute class **/ - bool ReadVisibility(pugi::xml_node element); + bool ReadVisibility(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteVisibility(pugi::xml_node element); @@ -5718,7 +5718,7 @@ class AttVisualOffsetHo : public Att { void ResetVisualOffsetHo(); /** Read the values for the attribute class **/ - bool ReadVisualOffsetHo(pugi::xml_node element); + bool ReadVisualOffsetHo(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteVisualOffsetHo(pugi::xml_node element); @@ -5757,7 +5757,7 @@ class AttVisualOffsetTo : public Att { void ResetVisualOffsetTo(); /** Read the values for the attribute class **/ - bool ReadVisualOffsetTo(pugi::xml_node element); + bool ReadVisualOffsetTo(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteVisualOffsetTo(pugi::xml_node element); @@ -5795,7 +5795,7 @@ class AttVisualOffsetVo : public Att { void ResetVisualOffsetVo(); /** Read the values for the attribute class **/ - bool ReadVisualOffsetVo(pugi::xml_node element); + bool ReadVisualOffsetVo(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteVisualOffsetVo(pugi::xml_node element); @@ -5834,7 +5834,7 @@ class AttVisualOffset2Ho : public Att { void ResetVisualOffset2Ho(); /** Read the values for the attribute class **/ - bool ReadVisualOffset2Ho(pugi::xml_node element); + bool ReadVisualOffset2Ho(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteVisualOffset2Ho(pugi::xml_node element); @@ -5881,7 +5881,7 @@ class AttVisualOffset2To : public Att { void ResetVisualOffset2To(); /** Read the values for the attribute class **/ - bool ReadVisualOffset2To(pugi::xml_node element); + bool ReadVisualOffset2To(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteVisualOffset2To(pugi::xml_node element); @@ -5928,7 +5928,7 @@ class AttVisualOffset2Vo : public Att { void ResetVisualOffset2Vo(); /** Read the values for the attribute class **/ - bool ReadVisualOffset2Vo(pugi::xml_node element); + bool ReadVisualOffset2Vo(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteVisualOffset2Vo(pugi::xml_node element); @@ -5975,7 +5975,7 @@ class AttVoltaGroupingSym : public Att { void ResetVoltaGroupingSym(); /** Read the values for the attribute class **/ - bool ReadVoltaGroupingSym(pugi::xml_node element); + bool ReadVoltaGroupingSym(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteVoltaGroupingSym(pugi::xml_node element); @@ -6010,7 +6010,7 @@ class AttWhitespace : public Att { void ResetWhitespace(); /** Read the values for the attribute class **/ - bool ReadWhitespace(pugi::xml_node element); + bool ReadWhitespace(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteWhitespace(pugi::xml_node element); @@ -6045,7 +6045,7 @@ class AttWidth : public Att { void ResetWidth(); /** Read the values for the attribute class **/ - bool ReadWidth(pugi::xml_node element); + bool ReadWidth(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteWidth(pugi::xml_node element); @@ -6080,7 +6080,7 @@ class AttXy : public Att { void ResetXy(); /** Read the values for the attribute class **/ - bool ReadXy(pugi::xml_node element); + bool ReadXy(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteXy(pugi::xml_node element); @@ -6129,7 +6129,7 @@ class AttXy2 : public Att { void ResetXy2(); /** Read the values for the attribute class **/ - bool ReadXy2(pugi::xml_node element); + bool ReadXy2(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteXy2(pugi::xml_node element); diff --git a/libmei/dist/atts_usersymbols.cpp b/libmei/dist/atts_usersymbols.cpp index aa15fb9130c..f77e11f0ca3 100644 --- a/libmei/dist/atts_usersymbols.cpp +++ b/libmei/dist/atts_usersymbols.cpp @@ -38,12 +38,12 @@ void AttAltSym::ResetAltSym() m_altsym = ""; } -bool AttAltSym::ReadAltSym(pugi::xml_node element) +bool AttAltSym::ReadAltSym(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("altsym")) { this->SetAltsym(StrToStr(element.attribute("altsym").value())); - element.remove_attribute("altsym"); + if (removeAttr) element.remove_attribute("altsym"); hasAttribute = true; } return hasAttribute; @@ -82,12 +82,12 @@ void AttAnchoredTextLog::ResetAnchoredTextLog() m_func = ""; } -bool AttAnchoredTextLog::ReadAnchoredTextLog(pugi::xml_node element) +bool AttAnchoredTextLog::ReadAnchoredTextLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("func")) { this->SetFunc(StrToStr(element.attribute("func").value())); - element.remove_attribute("func"); + if (removeAttr) element.remove_attribute("func"); hasAttribute = true; } return hasAttribute; @@ -126,12 +126,12 @@ void AttCurveLog::ResetCurveLog() m_func = ""; } -bool AttCurveLog::ReadCurveLog(pugi::xml_node element) +bool AttCurveLog::ReadCurveLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("func")) { this->SetFunc(StrToStr(element.attribute("func").value())); - element.remove_attribute("func"); + if (removeAttr) element.remove_attribute("func"); hasAttribute = true; } return hasAttribute; @@ -170,12 +170,12 @@ void AttLineLog::ResetLineLog() m_func = ""; } -bool AttLineLog::ReadLineLog(pugi::xml_node element) +bool AttLineLog::ReadLineLog(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("func")) { this->SetFunc(StrToStr(element.attribute("func").value())); - element.remove_attribute("func"); + if (removeAttr) element.remove_attribute("func"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_usersymbols.h b/libmei/dist/atts_usersymbols.h index 1a18d331fc7..70d0d44d083 100644 --- a/libmei/dist/atts_usersymbols.h +++ b/libmei/dist/atts_usersymbols.h @@ -38,7 +38,7 @@ class AttAltSym : public Att { void ResetAltSym(); /** Read the values for the attribute class **/ - bool ReadAltSym(pugi::xml_node element); + bool ReadAltSym(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteAltSym(pugi::xml_node element); @@ -77,7 +77,7 @@ class AttAnchoredTextLog : public Att { void ResetAnchoredTextLog(); /** Read the values for the attribute class **/ - bool ReadAnchoredTextLog(pugi::xml_node element); + bool ReadAnchoredTextLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteAnchoredTextLog(pugi::xml_node element); @@ -112,7 +112,7 @@ class AttCurveLog : public Att { void ResetCurveLog(); /** Read the values for the attribute class **/ - bool ReadCurveLog(pugi::xml_node element); + bool ReadCurveLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCurveLog(pugi::xml_node element); @@ -147,7 +147,7 @@ class AttLineLog : public Att { void ResetLineLog(); /** Read the values for the attribute class **/ - bool ReadLineLog(pugi::xml_node element); + bool ReadLineLog(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLineLog(pugi::xml_node element); diff --git a/libmei/dist/atts_visual.cpp b/libmei/dist/atts_visual.cpp index da29d03ed99..6f46b78cdae 100644 --- a/libmei/dist/atts_visual.cpp +++ b/libmei/dist/atts_visual.cpp @@ -38,12 +38,12 @@ void AttAnnotVis::ResetAnnotVis() m_place = data_PLACEMENT(); } -bool AttAnnotVis::ReadAnnotVis(pugi::xml_node element) +bool AttAnnotVis::ReadAnnotVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("place")) { this->SetPlace(StrToPlacement(element.attribute("place").value())); - element.remove_attribute("place"); + if (removeAttr) element.remove_attribute("place"); hasAttribute = true; } return hasAttribute; @@ -88,42 +88,42 @@ void AttArpegVis::ResetArpegVis() m_lineWidth = data_LINEWIDTH(); } -bool AttArpegVis::ReadArpegVis(pugi::xml_node element) +bool AttArpegVis::ReadArpegVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("arrow")) { this->SetArrow(StrToBoolean(element.attribute("arrow").value())); - element.remove_attribute("arrow"); + if (removeAttr) element.remove_attribute("arrow"); hasAttribute = true; } if (element.attribute("arrow.shape")) { this->SetArrowShape(StrToLinestartendsymbol(element.attribute("arrow.shape").value())); - element.remove_attribute("arrow.shape"); + if (removeAttr) element.remove_attribute("arrow.shape"); hasAttribute = true; } if (element.attribute("arrow.size")) { this->SetArrowSize(StrToInt(element.attribute("arrow.size").value())); - element.remove_attribute("arrow.size"); + if (removeAttr) element.remove_attribute("arrow.size"); hasAttribute = true; } if (element.attribute("arrow.color")) { this->SetArrowColor(StrToStr(element.attribute("arrow.color").value())); - element.remove_attribute("arrow.color"); + if (removeAttr) element.remove_attribute("arrow.color"); hasAttribute = true; } if (element.attribute("arrow.fillcolor")) { this->SetArrowFillcolor(StrToStr(element.attribute("arrow.fillcolor").value())); - element.remove_attribute("arrow.fillcolor"); + if (removeAttr) element.remove_attribute("arrow.fillcolor"); hasAttribute = true; } if (element.attribute("line.form")) { this->SetLineForm(StrToLineform(element.attribute("line.form").value())); - element.remove_attribute("line.form"); + if (removeAttr) element.remove_attribute("line.form"); hasAttribute = true; } if (element.attribute("line.width")) { this->SetLineWidth(StrToLinewidth(element.attribute("line.width").value())); - element.remove_attribute("line.width"); + if (removeAttr) element.remove_attribute("line.width"); hasAttribute = true; } return hasAttribute; @@ -218,22 +218,22 @@ void AttBarLineVis::ResetBarLineVis() m_place = MEI_UNSET; } -bool AttBarLineVis::ReadBarLineVis(pugi::xml_node element) +bool AttBarLineVis::ReadBarLineVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("len")) { this->SetLen(StrToDbl(element.attribute("len").value())); - element.remove_attribute("len"); + if (removeAttr) element.remove_attribute("len"); hasAttribute = true; } if (element.attribute("method")) { this->SetMethod(StrToBarmethod(element.attribute("method").value())); - element.remove_attribute("method"); + if (removeAttr) element.remove_attribute("method"); hasAttribute = true; } if (element.attribute("place")) { this->SetPlace(StrToInt(element.attribute("place").value())); - element.remove_attribute("place"); + if (removeAttr) element.remove_attribute("place"); hasAttribute = true; } return hasAttribute; @@ -292,22 +292,22 @@ void AttBeamingVis::ResetBeamingVis() m_beamSlope = 0.0; } -bool AttBeamingVis::ReadBeamingVis(pugi::xml_node element) +bool AttBeamingVis::ReadBeamingVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("beam.color")) { this->SetBeamColor(StrToStr(element.attribute("beam.color").value())); - element.remove_attribute("beam.color"); + if (removeAttr) element.remove_attribute("beam.color"); hasAttribute = true; } if (element.attribute("beam.rend")) { this->SetBeamRend(StrToBeamingVisBeamrend(element.attribute("beam.rend").value())); - element.remove_attribute("beam.rend"); + if (removeAttr) element.remove_attribute("beam.rend"); hasAttribute = true; } if (element.attribute("beam.slope")) { this->SetBeamSlope(StrToDbl(element.attribute("beam.slope").value())); - element.remove_attribute("beam.slope"); + if (removeAttr) element.remove_attribute("beam.slope"); hasAttribute = true; } return hasAttribute; @@ -364,12 +364,12 @@ void AttBeatRptVis::ResetBeatRptVis() m_slash = BEATRPT_REND_NONE; } -bool AttBeatRptVis::ReadBeatRptVis(pugi::xml_node element) +bool AttBeatRptVis::ReadBeatRptVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("slash")) { this->SetSlash(StrToBeatrptRend(element.attribute("slash").value())); - element.remove_attribute("slash"); + if (removeAttr) element.remove_attribute("slash"); hasAttribute = true; } return hasAttribute; @@ -408,12 +408,12 @@ void AttChordVis::ResetChordVis() m_cluster = CLUSTER_NONE; } -bool AttChordVis::ReadChordVis(pugi::xml_node element) +bool AttChordVis::ReadChordVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("cluster")) { this->SetCluster(StrToCluster(element.attribute("cluster").value())); - element.remove_attribute("cluster"); + if (removeAttr) element.remove_attribute("cluster"); hasAttribute = true; } return hasAttribute; @@ -453,17 +453,17 @@ void AttCleffingVis::ResetCleffingVis() m_clefVisible = BOOLEAN_NONE; } -bool AttCleffingVis::ReadCleffingVis(pugi::xml_node element) +bool AttCleffingVis::ReadCleffingVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("clef.color")) { this->SetClefColor(StrToStr(element.attribute("clef.color").value())); - element.remove_attribute("clef.color"); + if (removeAttr) element.remove_attribute("clef.color"); hasAttribute = true; } if (element.attribute("clef.visible")) { this->SetClefVisible(StrToBoolean(element.attribute("clef.visible").value())); - element.remove_attribute("clef.visible"); + if (removeAttr) element.remove_attribute("clef.visible"); hasAttribute = true; } return hasAttribute; @@ -512,17 +512,17 @@ void AttEpisemaVis::ResetEpisemaVis() m_place = data_EVENTREL(); } -bool AttEpisemaVis::ReadEpisemaVis(pugi::xml_node element) +bool AttEpisemaVis::ReadEpisemaVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToEpisemaVisForm(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } if (element.attribute("place")) { this->SetPlace(StrToEventrel(element.attribute("place").value())); - element.remove_attribute("place"); + if (removeAttr) element.remove_attribute("place"); hasAttribute = true; } return hasAttribute; @@ -572,22 +572,22 @@ void AttFTremVis::ResetFTremVis() m_floatGap = data_MEASUREMENTUNSIGNED(); } -bool AttFTremVis::ReadFTremVis(pugi::xml_node element) +bool AttFTremVis::ReadFTremVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("beams")) { this->SetBeams(StrToInt(element.attribute("beams").value())); - element.remove_attribute("beams"); + if (removeAttr) element.remove_attribute("beams"); hasAttribute = true; } if (element.attribute("beams.float")) { this->SetBeamsFloat(StrToInt(element.attribute("beams.float").value())); - element.remove_attribute("beams.float"); + if (removeAttr) element.remove_attribute("beams.float"); hasAttribute = true; } if (element.attribute("float.gap")) { this->SetFloatGap(StrToMeasurementunsigned(element.attribute("float.gap").value())); - element.remove_attribute("float.gap"); + if (removeAttr) element.remove_attribute("float.gap"); hasAttribute = true; } return hasAttribute; @@ -645,17 +645,17 @@ void AttFermataVis::ResetFermataVis() m_shape = fermataVis_SHAPE_NONE; } -bool AttFermataVis::ReadFermataVis(pugi::xml_node element) +bool AttFermataVis::ReadFermataVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToFermataVisForm(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } if (element.attribute("shape")) { this->SetShape(StrToFermataVisShape(element.attribute("shape").value())); - element.remove_attribute("shape"); + if (removeAttr) element.remove_attribute("shape"); hasAttribute = true; } return hasAttribute; @@ -703,12 +703,12 @@ void AttFingGrpVis::ResetFingGrpVis() m_orient = fingGrpVis_ORIENT_NONE; } -bool AttFingGrpVis::ReadFingGrpVis(pugi::xml_node element) +bool AttFingGrpVis::ReadFingGrpVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("orient")) { this->SetOrient(StrToFingGrpVisOrient(element.attribute("orient").value())); - element.remove_attribute("orient"); + if (removeAttr) element.remove_attribute("orient"); hasAttribute = true; } return hasAttribute; @@ -750,27 +750,27 @@ void AttHairpinVis::ResetHairpinVis() m_angleOptimize = BOOLEAN_NONE; } -bool AttHairpinVis::ReadHairpinVis(pugi::xml_node element) +bool AttHairpinVis::ReadHairpinVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("opening")) { this->SetOpening(StrToMeasurementunsigned(element.attribute("opening").value())); - element.remove_attribute("opening"); + if (removeAttr) element.remove_attribute("opening"); hasAttribute = true; } if (element.attribute("closed")) { this->SetClosed(StrToBoolean(element.attribute("closed").value())); - element.remove_attribute("closed"); + if (removeAttr) element.remove_attribute("closed"); hasAttribute = true; } if (element.attribute("opening.vertical")) { this->SetOpeningVertical(StrToBoolean(element.attribute("opening.vertical").value())); - element.remove_attribute("opening.vertical"); + if (removeAttr) element.remove_attribute("opening.vertical"); hasAttribute = true; } if (element.attribute("angle.optimize")) { this->SetAngleOptimize(StrToBoolean(element.attribute("angle.optimize").value())); - element.remove_attribute("angle.optimize"); + if (removeAttr) element.remove_attribute("angle.optimize"); hasAttribute = true; } return hasAttribute; @@ -836,12 +836,12 @@ void AttHarmVis::ResetHarmVis() m_rendgrid = harmVis_RENDGRID_NONE; } -bool AttHarmVis::ReadHarmVis(pugi::xml_node element) +bool AttHarmVis::ReadHarmVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("rendgrid")) { this->SetRendgrid(StrToHarmVisRendgrid(element.attribute("rendgrid").value())); - element.remove_attribute("rendgrid"); + if (removeAttr) element.remove_attribute("rendgrid"); hasAttribute = true; } return hasAttribute; @@ -881,17 +881,17 @@ void AttHispanTickVis::ResetHispanTickVis() m_tilt = data_COMPASSDIRECTION(); } -bool AttHispanTickVis::ReadHispanTickVis(pugi::xml_node element) +bool AttHispanTickVis::ReadHispanTickVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("place")) { this->SetPlace(StrToEventrel(element.attribute("place").value())); - element.remove_attribute("place"); + if (removeAttr) element.remove_attribute("place"); hasAttribute = true; } if (element.attribute("tilt")) { this->SetTilt(StrToCompassdirection(element.attribute("tilt").value())); - element.remove_attribute("tilt"); + if (removeAttr) element.remove_attribute("tilt"); hasAttribute = true; } return hasAttribute; @@ -939,12 +939,12 @@ void AttKeySigVis::ResetKeySigVis() m_sigShowchange = BOOLEAN_NONE; } -bool AttKeySigVis::ReadKeySigVis(pugi::xml_node element) +bool AttKeySigVis::ReadKeySigVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("sig.showchange")) { this->SetSigShowchange(StrToBoolean(element.attribute("sig.showchange").value())); - element.remove_attribute("sig.showchange"); + if (removeAttr) element.remove_attribute("sig.showchange"); hasAttribute = true; } return hasAttribute; @@ -984,17 +984,17 @@ void AttKeySigDefaultVis::ResetKeySigDefaultVis() m_keysigShowchange = BOOLEAN_NONE; } -bool AttKeySigDefaultVis::ReadKeySigDefaultVis(pugi::xml_node element) +bool AttKeySigDefaultVis::ReadKeySigDefaultVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("keysig.show")) { this->SetKeysigShow(StrToBoolean(element.attribute("keysig.show").value())); - element.remove_attribute("keysig.show"); + if (removeAttr) element.remove_attribute("keysig.show"); hasAttribute = true; } if (element.attribute("keysig.showchange")) { this->SetKeysigShowchange(StrToBoolean(element.attribute("keysig.showchange").value())); - element.remove_attribute("keysig.showchange"); + if (removeAttr) element.remove_attribute("keysig.showchange"); hasAttribute = true; } return hasAttribute; @@ -1042,12 +1042,12 @@ void AttLigatureVis::ResetLigatureVis() m_form = LIGATUREFORM_NONE; } -bool AttLigatureVis::ReadLigatureVis(pugi::xml_node element) +bool AttLigatureVis::ReadLigatureVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToLigatureform(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } return hasAttribute; @@ -1091,37 +1091,37 @@ void AttLineVis::ResetLineVis() m_startsymSize = MEI_UNSET; } -bool AttLineVis::ReadLineVis(pugi::xml_node element) +bool AttLineVis::ReadLineVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToLineform(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } if (element.attribute("width")) { this->SetWidth(StrToLinewidth(element.attribute("width").value())); - element.remove_attribute("width"); + if (removeAttr) element.remove_attribute("width"); hasAttribute = true; } if (element.attribute("endsym")) { this->SetEndsym(StrToLinestartendsymbol(element.attribute("endsym").value())); - element.remove_attribute("endsym"); + if (removeAttr) element.remove_attribute("endsym"); hasAttribute = true; } if (element.attribute("endsym.size")) { this->SetEndsymSize(StrToInt(element.attribute("endsym.size").value())); - element.remove_attribute("endsym.size"); + if (removeAttr) element.remove_attribute("endsym.size"); hasAttribute = true; } if (element.attribute("startsym")) { this->SetStartsym(StrToLinestartendsymbol(element.attribute("startsym").value())); - element.remove_attribute("startsym"); + if (removeAttr) element.remove_attribute("startsym"); hasAttribute = true; } if (element.attribute("startsym.size")) { this->SetStartsymSize(StrToInt(element.attribute("startsym.size").value())); - element.remove_attribute("startsym.size"); + if (removeAttr) element.remove_attribute("startsym.size"); hasAttribute = true; } return hasAttribute; @@ -1206,17 +1206,17 @@ void AttLiquescentVis::ResetLiquescentVis() m_looped = BOOLEAN_NONE; } -bool AttLiquescentVis::ReadLiquescentVis(pugi::xml_node element) +bool AttLiquescentVis::ReadLiquescentVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("curve")) { this->SetCurve(StrToLiquescentVisCurve(element.attribute("curve").value())); - element.remove_attribute("curve"); + if (removeAttr) element.remove_attribute("curve"); hasAttribute = true; } if (element.attribute("looped")) { this->SetLooped(StrToBoolean(element.attribute("looped").value())); - element.remove_attribute("looped"); + if (removeAttr) element.remove_attribute("looped"); hasAttribute = true; } return hasAttribute; @@ -1267,27 +1267,27 @@ void AttMensurVis::ResetMensurVis() m_sign = MENSURATIONSIGN_NONE; } -bool AttMensurVis::ReadMensurVis(pugi::xml_node element) +bool AttMensurVis::ReadMensurVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("dot")) { this->SetDot(StrToBoolean(element.attribute("dot").value())); - element.remove_attribute("dot"); + if (removeAttr) element.remove_attribute("dot"); hasAttribute = true; } if (element.attribute("form")) { this->SetForm(StrToMensurVisForm(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } if (element.attribute("orient")) { this->SetOrient(StrToOrientation(element.attribute("orient").value())); - element.remove_attribute("orient"); + if (removeAttr) element.remove_attribute("orient"); hasAttribute = true; } if (element.attribute("sign")) { this->SetSign(StrToMensurationsign(element.attribute("sign").value())); - element.remove_attribute("sign"); + if (removeAttr) element.remove_attribute("sign"); hasAttribute = true; } return hasAttribute; @@ -1360,47 +1360,47 @@ void AttMensuralVis::ResetMensuralVis() m_mensurSlash = MEI_UNSET; } -bool AttMensuralVis::ReadMensuralVis(pugi::xml_node element) +bool AttMensuralVis::ReadMensuralVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("mensur.color")) { this->SetMensurColor(StrToStr(element.attribute("mensur.color").value())); - element.remove_attribute("mensur.color"); + if (removeAttr) element.remove_attribute("mensur.color"); hasAttribute = true; } if (element.attribute("mensur.dot")) { this->SetMensurDot(StrToBoolean(element.attribute("mensur.dot").value())); - element.remove_attribute("mensur.dot"); + if (removeAttr) element.remove_attribute("mensur.dot"); hasAttribute = true; } if (element.attribute("mensur.form")) { this->SetMensurForm(StrToMensuralVisMensurform(element.attribute("mensur.form").value())); - element.remove_attribute("mensur.form"); + if (removeAttr) element.remove_attribute("mensur.form"); hasAttribute = true; } if (element.attribute("mensur.loc")) { this->SetMensurLoc(StrToInt(element.attribute("mensur.loc").value())); - element.remove_attribute("mensur.loc"); + if (removeAttr) element.remove_attribute("mensur.loc"); hasAttribute = true; } if (element.attribute("mensur.orient")) { this->SetMensurOrient(StrToOrientation(element.attribute("mensur.orient").value())); - element.remove_attribute("mensur.orient"); + if (removeAttr) element.remove_attribute("mensur.orient"); hasAttribute = true; } if (element.attribute("mensur.sign")) { this->SetMensurSign(StrToMensurationsign(element.attribute("mensur.sign").value())); - element.remove_attribute("mensur.sign"); + if (removeAttr) element.remove_attribute("mensur.sign"); hasAttribute = true; } if (element.attribute("mensur.size")) { this->SetMensurSize(StrToFontsize(element.attribute("mensur.size").value())); - element.remove_attribute("mensur.size"); + if (removeAttr) element.remove_attribute("mensur.size"); hasAttribute = true; } if (element.attribute("mensur.slash")) { this->SetMensurSlash(StrToInt(element.attribute("mensur.slash").value())); - element.remove_attribute("mensur.slash"); + if (removeAttr) element.remove_attribute("mensur.slash"); hasAttribute = true; } return hasAttribute; @@ -1502,12 +1502,12 @@ void AttMeterSigVis::ResetMeterSigVis() m_form = METERFORM_NONE; } -bool AttMeterSigVis::ReadMeterSigVis(pugi::xml_node element) +bool AttMeterSigVis::ReadMeterSigVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToMeterform(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } return hasAttribute; @@ -1547,17 +1547,17 @@ void AttMeterSigDefaultVis::ResetMeterSigDefaultVis() m_meterShowchange = BOOLEAN_NONE; } -bool AttMeterSigDefaultVis::ReadMeterSigDefaultVis(pugi::xml_node element) +bool AttMeterSigDefaultVis::ReadMeterSigDefaultVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("meter.form")) { this->SetMeterForm(StrToMeterform(element.attribute("meter.form").value())); - element.remove_attribute("meter.form"); + if (removeAttr) element.remove_attribute("meter.form"); hasAttribute = true; } if (element.attribute("meter.showchange")) { this->SetMeterShowchange(StrToBoolean(element.attribute("meter.showchange").value())); - element.remove_attribute("meter.showchange"); + if (removeAttr) element.remove_attribute("meter.showchange"); hasAttribute = true; } return hasAttribute; @@ -1605,12 +1605,12 @@ void AttMultiRestVis::ResetMultiRestVis() m_block = BOOLEAN_NONE; } -bool AttMultiRestVis::ReadMultiRestVis(pugi::xml_node element) +bool AttMultiRestVis::ReadMultiRestVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("block")) { this->SetBlock(StrToBoolean(element.attribute("block").value())); - element.remove_attribute("block"); + if (removeAttr) element.remove_attribute("block"); hasAttribute = true; } return hasAttribute; @@ -1649,12 +1649,12 @@ void AttPbVis::ResetPbVis() m_folium = pbVis_FOLIUM_NONE; } -bool AttPbVis::ReadPbVis(pugi::xml_node element) +bool AttPbVis::ReadPbVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("folium")) { this->SetFolium(StrToPbVisFolium(element.attribute("folium").value())); - element.remove_attribute("folium"); + if (removeAttr) element.remove_attribute("folium"); hasAttribute = true; } return hasAttribute; @@ -1693,12 +1693,12 @@ void AttPedalVis::ResetPedalVis() m_form = PEDALSTYLE_NONE; } -bool AttPedalVis::ReadPedalVis(pugi::xml_node element) +bool AttPedalVis::ReadPedalVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToPedalstyle(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } return hasAttribute; @@ -1738,17 +1738,17 @@ void AttPlicaVis::ResetPlicaVis() m_len = data_MEASUREMENTUNSIGNED(); } -bool AttPlicaVis::ReadPlicaVis(pugi::xml_node element) +bool AttPlicaVis::ReadPlicaVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("dir")) { this->SetDir(StrToStemdirectionBasic(element.attribute("dir").value())); - element.remove_attribute("dir"); + if (removeAttr) element.remove_attribute("dir"); hasAttribute = true; } if (element.attribute("len")) { this->SetLen(StrToMeasurementunsigned(element.attribute("len").value())); - element.remove_attribute("len"); + if (removeAttr) element.remove_attribute("len"); hasAttribute = true; } return hasAttribute; @@ -1796,12 +1796,12 @@ void AttQuilismaVis::ResetQuilismaVis() m_waves = MEI_UNSET; } -bool AttQuilismaVis::ReadQuilismaVis(pugi::xml_node element) +bool AttQuilismaVis::ReadQuilismaVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("waves")) { this->SetWaves(StrToInt(element.attribute("waves").value())); - element.remove_attribute("waves"); + if (removeAttr) element.remove_attribute("waves"); hasAttribute = true; } return hasAttribute; @@ -1840,12 +1840,12 @@ void AttSbVis::ResetSbVis() m_form = sbVis_FORM_NONE; } -bool AttSbVis::ReadSbVis(pugi::xml_node element) +bool AttSbVis::ReadSbVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("form")) { this->SetForm(StrToSbVisForm(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } return hasAttribute; @@ -1884,12 +1884,12 @@ void AttScoreDefVis::ResetScoreDefVis() m_vuHeight = ""; } -bool AttScoreDefVis::ReadScoreDefVis(pugi::xml_node element) +bool AttScoreDefVis::ReadScoreDefVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("vu.height")) { this->SetVuHeight(StrToStr(element.attribute("vu.height").value())); - element.remove_attribute("vu.height"); + if (removeAttr) element.remove_attribute("vu.height"); hasAttribute = true; } return hasAttribute; @@ -1928,12 +1928,12 @@ void AttSectionVis::ResetSectionVis() m_restart = BOOLEAN_NONE; } -bool AttSectionVis::ReadSectionVis(pugi::xml_node element) +bool AttSectionVis::ReadSectionVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("restart")) { this->SetRestart(StrToBoolean(element.attribute("restart").value())); - element.remove_attribute("restart"); + if (removeAttr) element.remove_attribute("restart"); hasAttribute = true; } return hasAttribute; @@ -1972,12 +1972,12 @@ void AttSignifLetVis::ResetSignifLetVis() m_place = data_EVENTREL(); } -bool AttSignifLetVis::ReadSignifLetVis(pugi::xml_node element) +bool AttSignifLetVis::ReadSignifLetVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("place")) { this->SetPlace(StrToEventrel(element.attribute("place").value())); - element.remove_attribute("place"); + if (removeAttr) element.remove_attribute("place"); hasAttribute = true; } return hasAttribute; @@ -2016,12 +2016,12 @@ void AttSpaceVis::ResetSpaceVis() m_compressable = BOOLEAN_NONE; } -bool AttSpaceVis::ReadSpaceVis(pugi::xml_node element) +bool AttSpaceVis::ReadSpaceVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("compressable")) { this->SetCompressable(StrToBoolean(element.attribute("compressable").value())); - element.remove_attribute("compressable"); + if (removeAttr) element.remove_attribute("compressable"); hasAttribute = true; } return hasAttribute; @@ -2064,32 +2064,32 @@ void AttStaffDefVis::ResetStaffDefVis() m_spacing = data_MEASUREMENTSIGNED(); } -bool AttStaffDefVis::ReadStaffDefVis(pugi::xml_node element) +bool AttStaffDefVis::ReadStaffDefVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("grid.show")) { this->SetGridShow(StrToBoolean(element.attribute("grid.show").value())); - element.remove_attribute("grid.show"); + if (removeAttr) element.remove_attribute("grid.show"); hasAttribute = true; } if (element.attribute("layerscheme")) { this->SetLayerscheme(StrToLayerscheme(element.attribute("layerscheme").value())); - element.remove_attribute("layerscheme"); + if (removeAttr) element.remove_attribute("layerscheme"); hasAttribute = true; } if (element.attribute("lines.color")) { this->SetLinesColor(StrToStr(element.attribute("lines.color").value())); - element.remove_attribute("lines.color"); + if (removeAttr) element.remove_attribute("lines.color"); hasAttribute = true; } if (element.attribute("lines.visible")) { this->SetLinesVisible(StrToBoolean(element.attribute("lines.visible").value())); - element.remove_attribute("lines.visible"); + if (removeAttr) element.remove_attribute("lines.visible"); hasAttribute = true; } if (element.attribute("spacing")) { this->SetSpacing(StrToMeasurementsigned(element.attribute("spacing").value())); - element.remove_attribute("spacing"); + if (removeAttr) element.remove_attribute("spacing"); hasAttribute = true; } return hasAttribute; @@ -2164,12 +2164,12 @@ void AttStaffGrpVis::ResetStaffGrpVis() m_barThru = BOOLEAN_NONE; } -bool AttStaffGrpVis::ReadStaffGrpVis(pugi::xml_node element) +bool AttStaffGrpVis::ReadStaffGrpVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("bar.thru")) { this->SetBarThru(StrToBoolean(element.attribute("bar.thru").value())); - element.remove_attribute("bar.thru"); + if (removeAttr) element.remove_attribute("bar.thru"); hasAttribute = true; } return hasAttribute; @@ -2213,37 +2213,37 @@ void AttStemVis::ResetStemVis() m_flagForm = FLAGFORM_mensural_NONE; } -bool AttStemVis::ReadStemVis(pugi::xml_node element) +bool AttStemVis::ReadStemVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("pos")) { this->SetPos(StrToStemposition(element.attribute("pos").value())); - element.remove_attribute("pos"); + if (removeAttr) element.remove_attribute("pos"); hasAttribute = true; } if (element.attribute("len")) { this->SetLen(StrToMeasurementunsigned(element.attribute("len").value())); - element.remove_attribute("len"); + if (removeAttr) element.remove_attribute("len"); hasAttribute = true; } if (element.attribute("form")) { this->SetForm(StrToStemformMensural(element.attribute("form").value())); - element.remove_attribute("form"); + if (removeAttr) element.remove_attribute("form"); hasAttribute = true; } if (element.attribute("dir")) { this->SetDir(StrToStemdirection(element.attribute("dir").value())); - element.remove_attribute("dir"); + if (removeAttr) element.remove_attribute("dir"); hasAttribute = true; } if (element.attribute("flag.pos")) { this->SetFlagPos(StrToFlagposMensural(element.attribute("flag.pos").value())); - element.remove_attribute("flag.pos"); + if (removeAttr) element.remove_attribute("flag.pos"); hasAttribute = true; } if (element.attribute("flag.form")) { this->SetFlagForm(StrToFlagformMensural(element.attribute("flag.form").value())); - element.remove_attribute("flag.form"); + if (removeAttr) element.remove_attribute("flag.form"); hasAttribute = true; } return hasAttribute; @@ -2330,27 +2330,27 @@ void AttTupletVis::ResetTupletVis() m_numFormat = tupletVis_NUMFORMAT_NONE; } -bool AttTupletVis::ReadTupletVis(pugi::xml_node element) +bool AttTupletVis::ReadTupletVis(pugi::xml_node element, bool removeAttr) { bool hasAttribute = false; if (element.attribute("bracket.place")) { this->SetBracketPlace(StrToStaffrelBasic(element.attribute("bracket.place").value())); - element.remove_attribute("bracket.place"); + if (removeAttr) element.remove_attribute("bracket.place"); hasAttribute = true; } if (element.attribute("bracket.visible")) { this->SetBracketVisible(StrToBoolean(element.attribute("bracket.visible").value())); - element.remove_attribute("bracket.visible"); + if (removeAttr) element.remove_attribute("bracket.visible"); hasAttribute = true; } if (element.attribute("dur.visible")) { this->SetDurVisible(StrToBoolean(element.attribute("dur.visible").value())); - element.remove_attribute("dur.visible"); + if (removeAttr) element.remove_attribute("dur.visible"); hasAttribute = true; } if (element.attribute("num.format")) { this->SetNumFormat(StrToTupletVisNumformat(element.attribute("num.format").value())); - element.remove_attribute("num.format"); + if (removeAttr) element.remove_attribute("num.format"); hasAttribute = true; } return hasAttribute; diff --git a/libmei/dist/atts_visual.h b/libmei/dist/atts_visual.h index a5a70ff8718..a369ab4d368 100644 --- a/libmei/dist/atts_visual.h +++ b/libmei/dist/atts_visual.h @@ -38,7 +38,7 @@ class AttAnnotVis : public Att { void ResetAnnotVis(); /** Read the values for the attribute class **/ - bool ReadAnnotVis(pugi::xml_node element); + bool ReadAnnotVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteAnnotVis(pugi::xml_node element); @@ -75,7 +75,7 @@ class AttArpegVis : public Att { void ResetArpegVis(); /** Read the values for the attribute class **/ - bool ReadArpegVis(pugi::xml_node element); + bool ReadArpegVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteArpegVis(pugi::xml_node element); @@ -148,7 +148,7 @@ class AttBarLineVis : public Att { void ResetBarLineVis(); /** Read the values for the attribute class **/ - bool ReadBarLineVis(pugi::xml_node element); + bool ReadBarLineVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBarLineVis(pugi::xml_node element); @@ -199,7 +199,7 @@ class AttBeamingVis : public Att { void ResetBeamingVis(); /** Read the values for the attribute class **/ - bool ReadBeamingVis(pugi::xml_node element); + bool ReadBeamingVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBeamingVis(pugi::xml_node element); @@ -246,7 +246,7 @@ class AttBeatRptVis : public Att { void ResetBeatRptVis(); /** Read the values for the attribute class **/ - bool ReadBeatRptVis(pugi::xml_node element); + bool ReadBeatRptVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteBeatRptVis(pugi::xml_node element); @@ -281,7 +281,7 @@ class AttChordVis : public Att { void ResetChordVis(); /** Read the values for the attribute class **/ - bool ReadChordVis(pugi::xml_node element); + bool ReadChordVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteChordVis(pugi::xml_node element); @@ -321,7 +321,7 @@ class AttCleffingVis : public Att { void ResetCleffingVis(); /** Read the values for the attribute class **/ - bool ReadCleffingVis(pugi::xml_node element); + bool ReadCleffingVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteCleffingVis(pugi::xml_node element); @@ -362,7 +362,7 @@ class AttEpisemaVis : public Att { void ResetEpisemaVis(); /** Read the values for the attribute class **/ - bool ReadEpisemaVis(pugi::xml_node element); + bool ReadEpisemaVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteEpisemaVis(pugi::xml_node element); @@ -403,7 +403,7 @@ class AttFTremVis : public Att { void ResetFTremVis(); /** Read the values for the attribute class **/ - bool ReadFTremVis(pugi::xml_node element); + bool ReadFTremVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteFTremVis(pugi::xml_node element); @@ -450,7 +450,7 @@ class AttFermataVis : public Att { void ResetFermataVis(); /** Read the values for the attribute class **/ - bool ReadFermataVis(pugi::xml_node element); + bool ReadFermataVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteFermataVis(pugi::xml_node element); @@ -491,7 +491,7 @@ class AttFingGrpVis : public Att { void ResetFingGrpVis(); /** Read the values for the attribute class **/ - bool ReadFingGrpVis(pugi::xml_node element); + bool ReadFingGrpVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteFingGrpVis(pugi::xml_node element); @@ -526,7 +526,7 @@ class AttHairpinVis : public Att { void ResetHairpinVis(); /** Read the values for the attribute class **/ - bool ReadHairpinVis(pugi::xml_node element); + bool ReadHairpinVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteHairpinVis(pugi::xml_node element); @@ -593,7 +593,7 @@ class AttHarmVis : public Att { void ResetHarmVis(); /** Read the values for the attribute class **/ - bool ReadHarmVis(pugi::xml_node element); + bool ReadHarmVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteHarmVis(pugi::xml_node element); @@ -628,7 +628,7 @@ class AttHispanTickVis : public Att { void ResetHispanTickVis(); /** Read the values for the attribute class **/ - bool ReadHispanTickVis(pugi::xml_node element); + bool ReadHispanTickVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteHispanTickVis(pugi::xml_node element); @@ -669,7 +669,7 @@ class AttKeySigVis : public Att { void ResetKeySigVis(); /** Read the values for the attribute class **/ - bool ReadKeySigVis(pugi::xml_node element); + bool ReadKeySigVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteKeySigVis(pugi::xml_node element); @@ -704,7 +704,7 @@ class AttKeySigDefaultVis : public Att { void ResetKeySigDefaultVis(); /** Read the values for the attribute class **/ - bool ReadKeySigDefaultVis(pugi::xml_node element); + bool ReadKeySigDefaultVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteKeySigDefaultVis(pugi::xml_node element); @@ -745,7 +745,7 @@ class AttLigatureVis : public Att { void ResetLigatureVis(); /** Read the values for the attribute class **/ - bool ReadLigatureVis(pugi::xml_node element); + bool ReadLigatureVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLigatureVis(pugi::xml_node element); @@ -780,7 +780,7 @@ class AttLineVis : public Att { void ResetLineVis(); /** Read the values for the attribute class **/ - bool ReadLineVis(pugi::xml_node element); + bool ReadLineVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLineVis(pugi::xml_node element); @@ -847,7 +847,7 @@ class AttLiquescentVis : public Att { void ResetLiquescentVis(); /** Read the values for the attribute class **/ - bool ReadLiquescentVis(pugi::xml_node element); + bool ReadLiquescentVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteLiquescentVis(pugi::xml_node element); @@ -888,7 +888,7 @@ class AttMensurVis : public Att { void ResetMensurVis(); /** Read the values for the attribute class **/ - bool ReadMensurVis(pugi::xml_node element); + bool ReadMensurVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMensurVis(pugi::xml_node element); @@ -941,7 +941,7 @@ class AttMensuralVis : public Att { void ResetMensuralVis(); /** Read the values for the attribute class **/ - bool ReadMensuralVis(pugi::xml_node element); + bool ReadMensuralVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMensuralVis(pugi::xml_node element); @@ -1026,7 +1026,7 @@ class AttMeterSigVis : public Att { void ResetMeterSigVis(); /** Read the values for the attribute class **/ - bool ReadMeterSigVis(pugi::xml_node element); + bool ReadMeterSigVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMeterSigVis(pugi::xml_node element); @@ -1061,7 +1061,7 @@ class AttMeterSigDefaultVis : public Att { void ResetMeterSigDefaultVis(); /** Read the values for the attribute class **/ - bool ReadMeterSigDefaultVis(pugi::xml_node element); + bool ReadMeterSigDefaultVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMeterSigDefaultVis(pugi::xml_node element); @@ -1105,7 +1105,7 @@ class AttMultiRestVis : public Att { void ResetMultiRestVis(); /** Read the values for the attribute class **/ - bool ReadMultiRestVis(pugi::xml_node element); + bool ReadMultiRestVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteMultiRestVis(pugi::xml_node element); @@ -1144,7 +1144,7 @@ class AttPbVis : public Att { void ResetPbVis(); /** Read the values for the attribute class **/ - bool ReadPbVis(pugi::xml_node element); + bool ReadPbVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePbVis(pugi::xml_node element); @@ -1182,7 +1182,7 @@ class AttPedalVis : public Att { void ResetPedalVis(); /** Read the values for the attribute class **/ - bool ReadPedalVis(pugi::xml_node element); + bool ReadPedalVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePedalVis(pugi::xml_node element); @@ -1217,7 +1217,7 @@ class AttPlicaVis : public Att { void ResetPlicaVis(); /** Read the values for the attribute class **/ - bool ReadPlicaVis(pugi::xml_node element); + bool ReadPlicaVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WritePlicaVis(pugi::xml_node element); @@ -1262,7 +1262,7 @@ class AttQuilismaVis : public Att { void ResetQuilismaVis(); /** Read the values for the attribute class **/ - bool ReadQuilismaVis(pugi::xml_node element); + bool ReadQuilismaVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteQuilismaVis(pugi::xml_node element); @@ -1297,7 +1297,7 @@ class AttSbVis : public Att { void ResetSbVis(); /** Read the values for the attribute class **/ - bool ReadSbVis(pugi::xml_node element); + bool ReadSbVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSbVis(pugi::xml_node element); @@ -1332,7 +1332,7 @@ class AttScoreDefVis : public Att { void ResetScoreDefVis(); /** Read the values for the attribute class **/ - bool ReadScoreDefVis(pugi::xml_node element); + bool ReadScoreDefVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteScoreDefVis(pugi::xml_node element); @@ -1371,7 +1371,7 @@ class AttSectionVis : public Att { void ResetSectionVis(); /** Read the values for the attribute class **/ - bool ReadSectionVis(pugi::xml_node element); + bool ReadSectionVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSectionVis(pugi::xml_node element); @@ -1406,7 +1406,7 @@ class AttSignifLetVis : public Att { void ResetSignifLetVis(); /** Read the values for the attribute class **/ - bool ReadSignifLetVis(pugi::xml_node element); + bool ReadSignifLetVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSignifLetVis(pugi::xml_node element); @@ -1441,7 +1441,7 @@ class AttSpaceVis : public Att { void ResetSpaceVis(); /** Read the values for the attribute class **/ - bool ReadSpaceVis(pugi::xml_node element); + bool ReadSpaceVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteSpaceVis(pugi::xml_node element); @@ -1479,7 +1479,7 @@ class AttStaffDefVis : public Att { void ResetStaffDefVis(); /** Read the values for the attribute class **/ - bool ReadStaffDefVis(pugi::xml_node element); + bool ReadStaffDefVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStaffDefVis(pugi::xml_node element); @@ -1543,7 +1543,7 @@ class AttStaffGrpVis : public Att { void ResetStaffGrpVis(); /** Read the values for the attribute class **/ - bool ReadStaffGrpVis(pugi::xml_node element); + bool ReadStaffGrpVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStaffGrpVis(pugi::xml_node element); @@ -1581,7 +1581,7 @@ class AttStemVis : public Att { void ResetStemVis(); /** Read the values for the attribute class **/ - bool ReadStemVis(pugi::xml_node element); + bool ReadStemVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteStemVis(pugi::xml_node element); @@ -1656,7 +1656,7 @@ class AttTupletVis : public Att { void ResetTupletVis(); /** Read the values for the attribute class **/ - bool ReadTupletVis(pugi::xml_node element); + bool ReadTupletVis(pugi::xml_node element, bool removeAttr = true); /** Write the values for the attribute class **/ bool WriteTupletVis(pugi::xml_node element);