Use tags to store supplementary information about the file
Often you need to store some relatively small amount of supplementary information about the file. This can be author name, keywords or something similar. To store this information, SolFS supports file tags.
Each tag is identified by it's integer ID which must be in range between 0x8000 (32768 decimal) and 0xCFFF (53247 decimal). The size of the tag can be from 0 bytes (empty tag) to PageSize - 48 bytes, where PageSize is the size of the page of the storage.
To manipulate tags use the following methods of SolFSStorage class:
- to check tag presense and size of it's data, use GetFileTagInfo() method;
- to add a tag to the file, use SetFileTag() method;
- to read tag data, use GetFileTag() method;
- to remove the tag use DeleteFileTag() method
Besides ID-based operations with tags SolFS 4.0 and later supports name-based operations. You add tag name, type and corresponding numeric tag ID using AddFileTag() method. Then you can access tags by name using query language or using one of GetTagAs*() methods.