Page 1 of 1

IncludePacked

Posted: Sat Nov 15, 2008 1:00 pm
by mback2k
I would like to have an easy way to pack files on compile time and catch them in the executable.

For example:

Code: Select all

CatchImage(#TestFileA, PackedInclude(?TestFileA))
CatchXML(#TestFileB, PackedInclude(?TestFileB), PackedIncludeLength(?TestFileB), 0, #PB_UTF8)

DataSection
  TestFileA: IncludePacked "testA.bmp"
  TestFileB: IncludePacked "testB.xml"
EndDataSection
or with existing commands + new MemoryPack:

Code: Select all

MemoryPack(?TestFiles) 
  CatchImage(#TestFileA, NextPackFile())
  CatchXML(#TestFileB, NextPackFile(), PackFileSize(), 0, #PB_UTF8)
ClosePack() 

DataSection
  TestFiles: 
  IncludePacked "testA.bmp"
  IncludePacked "testB.xml"
EndDataSection
The important thing is that the compiler packs the files. It should use the internal Packer commands to be cross platform.

Currently I am using an optimized version of the PackPlus Include, but it's annoying to pack the files again and again.

At least MemoryPack() should be added, because that would allow me to create a pre-compiler on my own.

Thanks in advance!

Posted: Sat Nov 15, 2008 5:38 pm
by DoubleDutch
+1 good idea.

Posted: Sat Nov 15, 2008 9:01 pm
by Mistrel
We would need a separate set of functions for this in my opinion. The exe data section is not the proper place to pack information. It should be appended to the exe instead otherwise it gets loaded into memory.

Posted: Mon Nov 17, 2008 3:17 am
by Seymour Clufley
+1 good idea, I think so too.