Ok. What I've done for now is:
1. Created normal XmlData with XmlNodes
2. Saved XmlData to FileText memory with:
Code:
FileText file_text;
file_text.writeMem();
xml.save(file_text);
3. Buffered FileText to CPtr since FileText File is private with:
Code:
CPtr buffer = AllocZero(file_text.size());
file_text.readMem(buffer, file_text.size());
4. Created PakFileData for PakCreate() with:
Code:
Memb<PakFileData> files;
PakFileData &pfd=files.New();
pfd.name=p.x+" "+p.y+".profile";
pfd.file.writeMem();
pfd.file.put(buffer, file_text.size());
pfd.modify_time_utc.getUTC();
5. Freed the buffer of course
6. Created .pak file with PakCreate() method with Memb files and Secure object reference.
It worked. The pfd.file exemple size is 248.
Now it's time to load the data (xml). And here's the problem! In FREPA loop with the searched files I'm trying to load them with:
Code:
static C PakFile &fp = Program::players[i].pak.file(0);
static FileText ft;
if(ft.read(fp.name, Program::players[i].pak))
{
static XmlData xml;
if(xml.load(ft))
{
...
and the xml.load() method returns FALSE! When I check the size of 'fp' it returns 248. The size of 'ft' is also 248 but when i try to getAll() (with Log(...); ) from it it returns nothing..
What's the problem?!