Hi, i made two minor changes but very useful to me in the xmlbeansxx c++ generator
1) Default values of the properties:
When i get the value of a property that was never assigned, i will like that the default value was retrived and not a BeansException.
I Change the method genGetAttr in ClassGen to generate something like this:
bool CEventHandlerProfile::getRequiredForPlay() { xmlbeansxx::XmlBoolean c; if (isSetRequiredForPlay()) c = xmlbeansxx::Contents::Walker::getAttr(*this,CEventHandlerProfile::Names::RequiredForPlay); else c = xmlbeansxx::XmlBoolean("false"); return c.getBooleanValue(); }
Something similir with the xget method.
What do you thing about this change?
2) I change the following methods in ClassGen to genereate both const and no-const c++ methods
public void genIsSetAttr() public void genSizeOf() public void genIsSet()
What about generate only cost method ?
I hope that it will be you useful.
Sounds good, could you provide patch for generator?
Regards, Rafal Rusin
Log in to post a comment.
Hi, i made two minor changes but very useful to me in the xmlbeansxx c++ generator
1) Default values of the properties:
When i get the value of a property that was never assigned, i will like that the default value was retrived and not a BeansException.
I Change the method genGetAttr in ClassGen to generate something like this:
bool CEventHandlerProfile::getRequiredForPlay() {
xmlbeansxx::XmlBoolean c;
if (isSetRequiredForPlay())
c = xmlbeansxx::Contents::Walker::getAttr(*this,CEventHandlerProfile::Names::RequiredForPlay);
else
c = xmlbeansxx::XmlBoolean("false");
return c.getBooleanValue();
}
Something similir with the xget method.
What do you thing about this change?
2) I change the following methods in ClassGen to genereate both const and no-const c++ methods
public void genIsSetAttr()
public void genSizeOf()
public void genIsSet()
What about generate only cost method ?
I hope that it will be you useful.
Sounds good, could you provide patch for generator?
Regards,
Rafal Rusin