Hi, I am new in programming and I would like to know if it is possible to convert an XML node to a C++ Structure. For instance I have a file with the following XML:
<?xml version="1.0" encoding="utf-8"?>
<StrucDescription>
<StrucName>
<unStrucNameMember1 type="uint16">0</unStrucNameMember1>
<unStrucNameMember2 type="uint8">0</unStrucNameMember2>
<ulStrucNameMember3 type="int32">0</ulStrucNameMember3>
<bStrucNameMember4 type="bool">true</bStrucNameMember4>
<szStrucNameMember5 type="char" size="32"></szStrucNameMember5>
</StrucName>
</StrucDescription>
Is it possible to create the bellow structure for future data storing from the above XML?
struct StrucName
{
uint16 unStrucNameMember1;
uint8 unStrucNameMember2;
int32 ulStrucNameMember3;
bool bStrucNameMember4;
char szStrucNameMember5[32];
StrucName ()
: unStrucNameMember1(0)
, unStrucNameMember2(0)
, ulStrucNameMember3(0)
, bStrucNameMember4(true)
, szStrucNameMember5()
};
I thank you all for the answers.