text: /**
  	* \file DlgWdbeCprNew.cpp
  	* API code for job DlgWdbeCprNew (implementation)
  	* \copyright (C) 2016-2020 MPSI Technologies GmbH
  	* \author Alexander Wirthmueller (auto-generation)
  	* \date created: 5 Dec 2020
  	*/
  // IP header --- ABOVE
  
  #include "DlgWdbeCprNew.h"
  
  using namespace std;
  using namespace Sbecore;
  using namespace Xmlio;
  
  /******************************************************************************
   class DlgWdbeCprNew::VecVDo
   ******************************************************************************/
  
  uint DlgWdbeCprNew::VecVDo::getIx(
  			const string& sref
  		) {
  	string s = StrMod::lc(sref);
  
  	if (s == "butcncclick") return BUTCNCCLICK;
  	if (s == "butcreclick") return BUTCRECLICK;
  
  	return(0);
  };
  
  string DlgWdbeCprNew::VecVDo::getSref(
  			const uint ix
  		) {
  	if (ix == BUTCNCCLICK) return("ButCncClick");
  	if (ix == BUTCRECLICK) return("ButCreClick");
  
  	return("");
  };
  
  /******************************************************************************
   class DlgWdbeCprNew::VecVSge
   ******************************************************************************/
  
  uint DlgWdbeCprNew::VecVSge::getIx(
  			const string& sref
  		) {
  	string s = StrMod::lc(sref);
  
  	if (s == "idle") return IDLE;
  	if (s == "create") return CREATE;
  	if (s == "done") return DONE;
  
  	return(0);
  };
  
  string DlgWdbeCprNew::VecVSge::getSref(
  			const uint ix
  		) {
  	if (ix == IDLE) return("idle");
  	if (ix == CREATE) return("create");
  	if (ix == DONE) return("done");
  
  	return("");
  };
  
  /******************************************************************************
   class DlgWdbeCprNew::ContIac
   ******************************************************************************/
  
  DlgWdbeCprNew::ContIac::ContIac(
  			const uint numFDetPupTyp
  			, const string& DetTxfSrf
  			, const string& DetTxfTit
  		) :
  			Block()
  		{
  	this->numFDetPupTyp = numFDetPupTyp;
  	this->DetTxfSrf = DetTxfSrf;
  	this->DetTxfTit = DetTxfTit;
  
  	mask = {NUMFDETPUPTYP, DETTXFSRF, DETTXFTIT};
  };
  
  bool DlgWdbeCprNew::ContIac::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "ContIacDlgWdbeCprNew");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "ContitemIacDlgWdbeCprNew";
  
  	if (basefound) {
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "numFDetPupTyp", numFDetPupTyp)) add(NUMFDETPUPTYP);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "DetTxfSrf", DetTxfSrf)) add(DETTXFSRF);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "DetTxfTit", DetTxfTit)) add(DETTXFTIT);
  	};
  
  	return basefound;
  };
  
  void DlgWdbeCprNew::ContIac::writeXML(
  			xmlTextWriter* wr
  			, string difftag
  			, bool shorttags
  		) {
  	if (difftag.length() == 0) difftag = "ContIacDlgWdbeCprNew";
  
  	string itemtag;
  	if (shorttags) itemtag = "Ci";
  	else itemtag = "ContitemIacDlgWdbeCprNew";
  
  	xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str());
  		writeUintAttr(wr, itemtag, "sref", "numFDetPupTyp", numFDetPupTyp);
  		writeStringAttr(wr, itemtag, "sref", "DetTxfSrf", DetTxfSrf);
  		writeStringAttr(wr, itemtag, "sref", "DetTxfTit", DetTxfTit);
  	xmlTextWriterEndElement(wr);
  };
  
  set<uint> DlgWdbeCprNew::ContIac::comm(
  			const ContIac* comp
  		) {
  	set<uint> items;
  
  	if (numFDetPupTyp == comp->numFDetPupTyp) insert(items, NUMFDETPUPTYP);
  	if (DetTxfSrf == comp->DetTxfSrf) insert(items, DETTXFSRF);
  	if (DetTxfTit == comp->DetTxfTit) insert(items, DETTXFTIT);
  
  	return(items);
  };
  
  set<uint> DlgWdbeCprNew::ContIac::diff(
  			const ContIac* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {NUMFDETPUPTYP, DETTXFSRF, DETTXFTIT};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class DlgWdbeCprNew::ContInf
   ******************************************************************************/
  
  DlgWdbeCprNew::ContInf::ContInf(
  			const uint numFSge
  		) :
  			Block()
  		{
  	this->numFSge = numFSge;
  
  	mask = {NUMFSGE};
  };
  
  bool DlgWdbeCprNew::ContInf::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "ContInfDlgWdbeCprNew");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "ContitemInfDlgWdbeCprNew";
  
  	if (basefound) {
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "numFSge", numFSge)) add(NUMFSGE);
  	};
  
  	return basefound;
  };
  
  set<uint> DlgWdbeCprNew::ContInf::comm(
  			const ContInf* comp
  		) {
  	set<uint> items;
  
  	if (numFSge == comp->numFSge) insert(items, NUMFSGE);
  
  	return(items);
  };
  
  set<uint> DlgWdbeCprNew::ContInf::diff(
  			const ContInf* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {NUMFSGE};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class DlgWdbeCprNew::StatApp
   ******************************************************************************/
  
  DlgWdbeCprNew::StatApp::StatApp(
  			const string& shortMenu
  		) :
  			Block()
  		{
  	this->shortMenu = shortMenu;
  
  	mask = {SHORTMENU};
  };
  
  bool DlgWdbeCprNew::StatApp::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StatAppDlgWdbeCprNew");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "StatitemAppDlgWdbeCprNew";
  
  	if (basefound) {
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "shortMenu", shortMenu)) add(SHORTMENU);
  	};
  
  	return basefound;
  };
  
  set<uint> DlgWdbeCprNew::StatApp::comm(
  			const StatApp* comp
  		) {
  	set<uint> items;
  
  	if (shortMenu == comp->shortMenu) insert(items, SHORTMENU);
  
  	return(items);
  };
  
  set<uint> DlgWdbeCprNew::StatApp::diff(
  			const StatApp* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {SHORTMENU};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class DlgWdbeCprNew::StatShr
   ******************************************************************************/
  
  DlgWdbeCprNew::StatShr::StatShr(
  			const bool ButCncActive
  			, const bool ButCreActive
  		) :
  			Block()
  		{
  	this->ButCncActive = ButCncActive;
  	this->ButCreActive = ButCreActive;
  
  	mask = {BUTCNCACTIVE, BUTCREACTIVE};
  };
  
  bool DlgWdbeCprNew::StatShr::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StatShrDlgWdbeCprNew");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "StatitemShrDlgWdbeCprNew";
  
  	if (basefound) {
  		if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ButCncActive", ButCncActive)) add(BUTCNCACTIVE);
  		if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ButCreActive", ButCreActive)) add(BUTCREACTIVE);
  	};
  
  	return basefound;
  };
  
  set<uint> DlgWdbeCprNew::StatShr::comm(
  			const StatShr* comp
  		) {
  	set<uint> items;
  
  	if (ButCncActive == comp->ButCncActive) insert(items, BUTCNCACTIVE);
  	if (ButCreActive == comp->ButCreActive) insert(items, BUTCREACTIVE);
  
  	return(items);
  };
  
  set<uint> DlgWdbeCprNew::StatShr::diff(
  			const StatShr* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {BUTCNCACTIVE, BUTCREACTIVE};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class DlgWdbeCprNew::Tag
   ******************************************************************************/
  
  DlgWdbeCprNew::Tag::Tag(
  			const string& Cpt
  			, const string& DetCptTyp
  			, const string& DetCptSrf
  			, const string& DetCptTit
  			, const string& ButCnc
  			, const string& ButCre
  		) :
  			Block()
  		{
  	this->Cpt = Cpt;
  	this->DetCptTyp = DetCptTyp;
  	this->DetCptSrf = DetCptSrf;
  	this->DetCptTit = DetCptTit;
  	this->ButCnc = ButCnc;
  	this->ButCre = ButCre;
  
  	mask = {CPT, DETCPTTYP, DETCPTSRF, DETCPTTIT, BUTCNC, BUTCRE};
  };
  
  bool DlgWdbeCprNew::Tag::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "TagDlgWdbeCprNew");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "TagitemDlgWdbeCprNew";
  
  	if (basefound) {
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "Cpt", Cpt)) add(CPT);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "DetCptTyp", DetCptTyp)) add(DETCPTTYP);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "DetCptSrf", DetCptSrf)) add(DETCPTSRF);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "DetCptTit", DetCptTit)) add(DETCPTTIT);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "ButCnc", ButCnc)) add(BUTCNC);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "ButCre", ButCre)) add(BUTCRE);
  	};
  
  	return basefound;
  };
  
  /******************************************************************************
   class DlgWdbeCprNew::DpchAppData
   ******************************************************************************/
  
  DlgWdbeCprNew::DpchAppData::DpchAppData(
  			const string& scrJref
  			, ContIac* contiac
  			, const set<uint>& mask
  		) :
  			DpchAppWdbe(VecWdbeVDpch::DPCHAPPDLGWDBECPRNEWDATA, scrJref)
  		{
  	if (find(mask, ALL)) this->mask = {SCRJREF, CONTIAC};
  	else this->mask = mask;
  
  		if (find(this->mask, CONTIAC) && contiac) this->contiac = *contiac;
  };
  
  string DlgWdbeCprNew::DpchAppData::getSrefsMask() {
  	vector<string> ss;
  	string srefs;
  
  	if (has(SCRJREF)) ss.push_back("scrJref");
  	if (has(CONTIAC)) ss.push_back("contiac");
  
  	StrMod::vectorToString(ss, srefs);
  
  	return(srefs);
  };
  
  void DlgWdbeCprNew::DpchAppData::writeXML(
  			xmlTextWriter* wr
  		) {
  	xmlTextWriterStartElement(wr, BAD_CAST "DpchAppDlgWdbeCprNewData");
  	xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wdbe");
  		if (has(SCRJREF)) writeString(wr, "scrJref", scrJref);
  		if (has(CONTIAC)) contiac.writeXML(wr);
  	xmlTextWriterEndElement(wr);
  };
  
  /******************************************************************************
   class DlgWdbeCprNew::DpchAppDo
   ******************************************************************************/
  
  DlgWdbeCprNew::DpchAppDo::DpchAppDo(
  			const string& scrJref
  			, const uint ixVDo
  			, const set<uint>& mask
  		) :
  			DpchAppWdbe(VecWdbeVDpch::DPCHAPPDLGWDBECPRNEWDO, scrJref)
  		{
  	if (find(mask, ALL)) this->mask = {SCRJREF, IXVDO};
  	else this->mask = mask;
  
  	this->ixVDo = ixVDo;
  };
  
  string DlgWdbeCprNew::DpchAppDo::getSrefsMask() {
  	vector<string> ss;
  	string srefs;
  
  	if (has(SCRJREF)) ss.push_back("scrJref");
  	if (has(IXVDO)) ss.push_back("ixVDo");
  
  	StrMod::vectorToString(ss, srefs);
  
  	return(srefs);
  };
  
  void DlgWdbeCprNew::DpchAppDo::writeXML(
  			xmlTextWriter* wr
  		) {
  	xmlTextWriterStartElement(wr, BAD_CAST "DpchAppDlgWdbeCprNewDo");
  	xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wdbe");
  		if (has(SCRJREF)) writeString(wr, "scrJref", scrJref);
  		if (has(IXVDO)) writeString(wr, "srefIxVDo", VecVDo::getSref(ixVDo));
  	xmlTextWriterEndElement(wr);
  };
  
  /******************************************************************************
   class DlgWdbeCprNew::DpchEngData
   ******************************************************************************/
  
  DlgWdbeCprNew::DpchEngData::DpchEngData() :
  			DpchEngWdbe(VecWdbeVDpch::DPCHENGDLGWDBECPRNEWDATA)
  		{
  	feedFDetPupTyp.tag = "FeedFDetPupTyp";
  	feedFSge.tag = "FeedFSge";
  };
  
  string DlgWdbeCprNew::DpchEngData::getSrefsMask() {
  	vector<string> ss;
  	string srefs;
  
  	if (has(SCRJREF)) ss.push_back("scrJref");
  	if (has(CONTIAC)) ss.push_back("contiac");
  	if (has(CONTINF)) ss.push_back("continf");
  	if (has(FEEDFDETPUPTYP)) ss.push_back("feedFDetPupTyp");
  	if (has(FEEDFSGE)) ss.push_back("feedFSge");
  	if (has(STATAPP)) ss.push_back("statapp");
  	if (has(STATSHR)) ss.push_back("statshr");
  	if (has(TAG)) ss.push_back("tag");
  
  	StrMod::vectorToString(ss, srefs);
  
  	return(srefs);
  };
  
  void DlgWdbeCprNew::DpchEngData::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "DpchEngDlgWdbeCprNewData");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	if (basefound) {
  		if (extractStringUclc(docctx, basexpath, "scrJref", "", scrJref)) add(SCRJREF);
  		if (contiac.readXML(docctx, basexpath, true)) add(CONTIAC);
  		if (continf.readXML(docctx, basexpath, true)) add(CONTINF);
  		if (feedFDetPupTyp.readXML(docctx, basexpath, true)) add(FEEDFDETPUPTYP);
  		if (feedFSge.readXML(docctx, basexpath, true)) add(FEEDFSGE);
  		if (statapp.readXML(docctx, basexpath, true)) add(STATAPP);
  		if (statshr.readXML(docctx, basexpath, true)) add(STATSHR);
  		if (tag.readXML(docctx, basexpath, true)) add(TAG);
  	} else {
  		contiac = ContIac();
  		continf = ContInf();
  		feedFDetPupTyp.clear();
  		feedFSge.clear();
  		statapp = StatApp();
  		statshr = StatShr();
  		tag = Tag();
  	};
  };
  