Jump to content
  • Advertisement
Sign in to follow this  
raptorstrike

Xml to C++ translater in Perl

This topic is 4071 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

recently I have taken up perl and as a project for myself I have decided to write a script that translates XML files into C++ class files (I find myself writing XML file loaders way too often) The script is progressing fairly well (it successfully generates a header file for the class) but before I move onto the source code of loading each item I wanted to ask how nested items in the XML file should be handled. Right now the nested node is simply listed as a nested class but I was wondering weather I should instead create a separate header header file and just give the class an appropriate member variable to represent the nested object. EX:
class A
{
    public:
           A(){};
           class B
           {
               public:
                   B(){};
           };
};

as opposed to

#include <B.h>
class A
{
    public:
           A(){};
           std::vector< B > v_B;
};
NOTE that the vector is there because child nodes do not have any name in XML so they would all be put anonymously in a vector for later use. thanks for your time [smile]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!