@@ -798,12 +798,11 @@ std::string WiresharkField::wiresharkDissectCodeImpl(const WiresharkField* refFi
798798 auto prependFileName = relPath + strings::genPrependFileSuffixStr ();
799799 auto extendFileName = relPath + strings::genExtendFileSuffixStr ();
800800
801- bool replaced = false ;
802801 bool extended = false ;
803802 util::GenReplacementMap repl = {
804803 {" REG" , wiresharkFieldRegistration (refField)},
805804 {" NAME" , wiresharkDissectName (refField)},
806- {" REPLACE" , wiresharkGenerator. genReadCodeInjectCode (replaceFileName, " Replace this function body " , &replaced) },
805+ {" REPLACE" , m_customCode. m_read },
807806 {" PREPEND" , wiresharkGenerator.genReadCodeInjectCode (prependFileName, " Prepend here" )},
808807 {" EXTEND" , wiresharkGenerator.genReadCodeInjectCode (extendFileName, " Extend function above" , &extended)},
809808 {" NAME_VAR" , wiresharkNameDefInternal (refField)},
@@ -816,7 +815,7 @@ std::string WiresharkField::wiresharkDissectCodeImpl(const WiresharkField* refFi
816815 repl[" MEMBERS" ] = wiresharkMembersDissectCodeImpl ();
817816 }
818817
819- if (!replaced ) {
818+ if (!m_customCode. m_hasRead ) {
820819 repl[" BODY" ] = wiresharkDissectBodyInternal (refField);
821820 }
822821
@@ -1033,16 +1032,15 @@ std::string WiresharkField::wiresharkValidFuncCodeImpl(const WiresharkField* ref
10331032 auto replaceFileName = relPath + strings::genReplaceFileSuffixStr ();
10341033 auto extendFileName = relPath + strings::genExtendFileSuffixStr ();
10351034
1036- bool replaced = false ;
10371035 bool extended = false ;
10381036 util::GenReplacementMap repl = {
10391037 {" NAME" , wiresharkValidFuncName (refField)},
1040- {" REPLACE" , wiresharkGenerator. genReadCodeInjectCode (replaceFileName, " Replace this function body " , &replaced) },
1038+ {" REPLACE" , m_customCode. m_valid },
10411039 {" EXTEND" , wiresharkGenerator.genReadCodeInjectCode (extendFileName, " Extend function above" , &extended)},
10421040 {" FIELD" , wiresharkFieldStr ()},
10431041 };
10441042
1045- if (!replaced ) {
1043+ if (!m_customCode. m_hasValid ) {
10461044 repl[" BODY" ] = wiresharkValidFuncBodyImpl (refField);
10471045 }
10481046
@@ -1259,7 +1257,8 @@ bool WiresharkField::wiresharkHasOverrideCode() const
12591257 return
12601258 m_customCode.m_hasRead ||
12611259 m_customCode.m_hasValid ||
1262- m_customCode.m_hasName ;
1260+ m_customCode.m_hasName ||
1261+ m_customCode.m_hasValue ;
12631262}
12641263
12651264std::string WiresharkField::wiresharkDissectSignature ()
@@ -1586,16 +1585,15 @@ std::string WiresharkField::wiresharkValueFuncCodeInternal(const WiresharkField*
15861585 auto replaceFileName = relPath + strings::genReplaceFileSuffixStr ();
15871586 auto extendFileName = relPath + strings::genExtendFileSuffixStr ();
15881587
1589- bool replaced = false ;
15901588 bool extended = false ;
15911589 util::GenReplacementMap repl = {
15921590 {" NAME" , wiresharkValueFuncName (refField)},
1593- {" REPLACE" , wiresharkGenerator. genReadCodeInjectCode (replaceFileName, " Replace this function body " , &replaced) },
1591+ {" REPLACE" , m_customCode. m_value },
15941592 {" EXTEND" , wiresharkGenerator.genReadCodeInjectCode (extendFileName, " Extend function above" , &extended)},
15951593 {" FIELD" , wiresharkFieldStr ()},
15961594 };
15971595
1598- if (!replaced ) {
1596+ if (!m_customCode. m_hasValue ) {
15991597 repl[" BODY" ] = wiresharkValueFuncBodyImpl (refField);
16001598 }
16011599
0 commit comments