Code archives/File Utilities/Data buffer system for loading/saving data files

This code has been declared by its author to be Public Domain code.

Download source code

Data buffer system for loading/saving data files by Zethrax2015
*** Blitz3D Code ***

This library allows you to create buffers to simplify write and read operations for data files.

Check the function descriptions and usage example for more info on how to use this library.


NOTES:-

The pointer to the current data buffer is stored in the 'G_current_data_buffer' global.

;-

You can have multiple data buffers in use at the same time, but you need to switch between them as they will all use the 'G_current_data_buffer' global to store a pointer to the current buffer.

As an example, to switch between already created buffers named 'data_buffer_1' and 'data_buffer_2' (both need to be 'T_data_buffer' types) use:-
data_buffer_1 = G_current_data_buffer : G_current_data_buffer = data_buffer_2

This can be handy where you need to read header data from one DB, use that header data to load a second DB, and then switch back to reading from the first DB to grab the data you need to configure the results of the second DB (eg. Using header data from a save file to load a map file, and then using the remaining data in the save file to configure the world created with the map file.).

The code can be found at: http://www.blitzbasic.com/codearcs/codearcs.php?code=3186

Comments

virtlands2015
That''s interesting code you've got there,

.. " Data buffer system for loading/saving data files " is similar to some FreeImage functions

such as these :



;;------------------
Some FreeImage Code *(ver 3131) ::
http://uploadingit.com/file/ooo85ksrythyh6nk/freeimage3131_BLOB.rar

;; ...related topic ::
FreeImage Module for B3D/B+
http://www.blitzbasic.com/codearcs/codearcs.php?code=1732



Guy Fawkes2015
Cool code! =D Hi, Virtlands! :D


Guy Fawkes2015
Does this allow for one to store entire files inside a memory bank?! That would be SO awesome! =D


Code Archives Forum