I have a very specific problem to solve but I cannot find a data
structure for it.
I don't know if I am posting on the good newsgroup but I cannot find
a software.design group.
I would like to declare a smart structure initialized via a XML file.
The goal of this structure is to store data from a smart card.
My XML file describes the file structure of my smart card. On a smart
card file are identified by number(sfid) and not by their name like on
PC. And each record are BYTE arrays
<CardMapping>
<CardFile sfid="Ox17">
<CardRecord index="1" size="29">
<CardData
offset="0"
size="20 bytes"
type="string"
name="Last Name1"
/>
<CardData
offset="20"
size="1 bytes"
type="numeric"
name="age1"/>
</CardRecord>
</CardFile>
<CardFile sfid="Ox18">
<CardRecord index="1" size="29">
<CardData
offset="0"
size="20 bytes"
type="string"
name="Last Name2"
/>
<CardData
offset="20"
size="2 bytes"
type="numeric"
name="age2"/>
</CardRecord>
</CardFile>
</CardMapping>
So basically a smart card can have 0 or n files (CardFile) with inside 0
or n records and each records is splitted into chunks of data.
After reading a file like this I should have :
File 0x17
----------------
| |
|Record1 xxxxx |
|Record2 xxxxx |
|... |
|Recordn xxxx |
| |
| |
----------------
File 0x18
----------------
| |
|Record1 xxxxx |
|Record2 xxxxx |
|... |
|Recordn xxxx |
| |
| |
----------------
And finally what I want to do is something like,
CString csName = m_Card.GetData("Last Name1") (it should extract data
from first record and convert it into string.
int nAge = m_Card.GetData("age2").