IncludePacked

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
mback2k
Enthusiast
Enthusiast
Posts: 257
Joined: Sun Dec 02, 2007 12:11 pm
Location: Germany

IncludePacked

Post 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!
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

+1 good idea.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post 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.
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Post by Seymour Clufley »

+1 good idea, I think so too.
Post Reply