Menu

Changes in the code generetor

Help
2008-12-10
2013-04-11
  • Fernando Boucquez

    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.

     
    • Rafal Rusin

      Rafal Rusin - 2009-05-30

      Sounds good, could you provide patch for generator?

      Regards,
      Rafal Rusin

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.