-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the JCR6 for C++ wiki!
Over time this wiki will contain the references for getting to work with the JCR6 library for C++
The abbreviation stands for "Jeroen's Collected Resource", and the 6 just means it was the 6th time I wrote the setup entirely from scratch. No JCR6 is not compatible with JCR5 and before, although for some programming languages, drivers exist to load a JCR5 file in JCR6.
The system came to be in order to keep my games portable, and earlier versions of JCR did have some encryption to protect the data, but I was a kid, I was paranoid, I dropped that functionality over time (although it should still be possible to bring this functionality back, without much effort). With version 5 JCR went into the Open Source, originally under an Mozilla Public License. This C++ version is the first to be released under the zlib license, and for other languages, this may be followed.
JCR6 packs all files together into one big file. Think of it as a kind of zip file, however, where zip is most of all set up for backup and archiving purposes, JCR6 was set up from the start as game data files in mind, and that's why I focused on flexibility and quick access. JCR6 may not support everything zip supports, but in return the base format is by far more sophisticated. JCR6 is first of all a modular format, and this allows JCR6 to support an infinite number of compression algorithms, and with infinite I mean infinite. They say infinity doesn't exist in the world of computers, but in this particular statement it does. JCR6 easily allows to create drivers for any compression method and when properly installed and loaded, JCR6 will support this compression method, and if you want to use JCR6 with your own algorithms (also with the protection of your data in mind) you can do it, and the base tools won't be able to read it (unless you recompile them with your drivers). When this document was written the JCR6 management tools to be used on the cli (written in Go) supported "zlib", "flate", "lzw" and "lzma", but really anything is possible, as long as the drivers are present. Cool, huh? The fun doesn't end here, the modular setup also allows to put in as much data in the file table you wish, so yeah, JCR6 is very extendable. Then the patching possibilities allows you to be flexible. You can decide if you wanna use it to keep specific kinds of data together, or to allow your players to play modified versions of your game, without modifying the original data. JCR6 can also auto-call other JCR6 files (if they exist) to form a new resource. Perhaps if you wanna send patches with bugfixes? JCR6 also allows "aliasing" which means in JCR6 that two files refer to the same data block inside the JCR6 file. Yeah, this is functional, as I "abused" this feature in JCR6 a lot myself.
This repository came to be to bring you JCR6 in C++, and I guess that after Python, BlitzMax, Go, C# and even Lua, came first, we can think FINALLY :-P
I set up this library as much as possible to stand on its own without the need of dependencies, so to use the standard functionality of C++ only. The only exceptions are the compression drivers. Since Jean-loup Gailly and Mark Adler did a wonderful job with the zlib algorithm and Igor Pavlov did a good job on lzma, why reinvent the wheel, when I can attach their work into JCR6? So compiling those drivers will need their stuff to be installed or in anyway within reach of the compiler.
If JCR6 is of any use to you, by all means, use it.
JCR6 for C++
(Note: Basically all functions inside the JCR6 library are part of the "jcr6" namespace, meaning that you either need the "jcr6::" prefix before class and function names, unless you put in a "using namespace jcr6;" statement. It's up to you to decide what is the wisest thing to do).