Component for embedding multiple files into a single storage file, preserving their original format. A storage file is an object that has a familiar tree structure similar to a file system in which files and variables of various types can be placed. No archiving. Work with embed files could be done directly without unpacking them. No need to save and load dozens of separate files. With PBFileStorage you can create your own professional file format, similar to Excel, Word, PowerPoint, which is easy to work with.
|7 SP2 x64|
RAD Studio compatibility
Free components in a bundle
Buy a bundle now and enjoy all new component releases for free during the update period.
Keep track of multiple versions
You will get access to all older versions and a detailed changelog.
Free new features
Get all new component features for free during the free update period.
Install once use forever
Our products are not time limited.
Source code promise
In case our component will become obsolete and we no longer support it, we will provide you its source code. So you don’t have to worry about a replacement.
> QSG code example provided with the installer
After installation, a group PyBridge will appear in the Tool Palette of Delphi, where you can find the new component TPBFileStorage
New component TPBFileStorage can be found in the Tool Palette under PyBridge group
Place TPBFileStorage on the form and set up its main properties:
- FileName – full path to the storage file
- Name – name of the storage file
Now PBFileStorage is ready to be used. A file storage file is an object that has a familiar tree structure similar to a file system in which files and variables of various types can be placed. To demonstrate how it works, let’s create a very simple application with main component functions. Add buttons as displayed below. Add one Memo field for displaying status messages about the execution of the called functions. Add another Memo field for displaying the tree structure of the storage file.
Application layout to demonstrate basic PBFileStorage functions
First, it is necessary to initialize the work with FileStorage with the OPEN command. In this case, we either create a new file or open an existing file:
To display the result of initializing the storage file, create an OnOpen event handler:
Events list of PBFileStorage object
Press “Open” to open a storage file and display it’s tree structure
In the “Create dir” button click event handler, create two directories:
To display the result of creating directories, create an OnCreateDirectory event handler:
Press “Create dir” to create two directories and update a tree structure
In the “Write” button click event handler, create a variable and save its value in the file space of our storage file in the form of the file “test” in the “d\e” directory created earlier:
To display the result of writing a value to a variable, create an OnWrite event handler.
Press “Write” to write a “test” file and update a tree structure
In “Read” button click event handler, we will try to read the value of the previously created variable from the file “test” from the directory “a\b\c” (the file “test” is in the directory “d\e”):
To display the reading result, create an OnRead event handler:
When you press the “Read” button, a message appears stating that it was not possible to read the value
Let’s use the “Move” function to move the file “test” from the directory “d\e” to the directory “a\b\c”:
To display the result of the move, create an OnMove event handler:
Press “Move” to move “test” file to the “a\b\c” folder . Press “Read” to display the stored value “Hello World”
Let’s use the “Copy” function to copy the file “test” from the directory “a\b\c” to the directory “d\e”:
To represent the move results, create an OnCopy event handler:
Press “Copy” to copy “test” file to the folder «d\e\»
In the “Find” button click event handler, create a search procedure by the name of the file “test”:
Press “Find” to find “TestString” file in the folders: «a\b\c» and «d\e\»
In the “Delete” button click event handler, create a procedure for deleting the subdirectory “b” from the directory “a” and the subdirectory “e” from the directory “d”:
To display the result of deletion, create an OnDelete event handler:
Press “Delete” to delete subdirectories
In the “Save” button click event handler, create a procedure for saving the storage file:
To present the results of the save, create an OnSave event handler:
Press “Save” to save the storage file
When the “Close” command is executed, the current state of the storage file is saved and access to it is closed. To resume work with the file, you need to open it again.
Press “Close” to close the storage file
This example demonstrates how you can easily and quickly create and modify a tree-structured storage file with a help of PBFileStorage component. Now you can also enjoy the full power of PBFileStorage in your applications!