BTag is data storage in binary file C# library (+ server for other languages soon!). It is developed to store your data in tree, using tags children and parents.
You can easiely store your users logins, passwords and emaild using tree like this (not a real tree, just indicative).
- users
- someUser
- password=somePassword
- email=test@example.com
- otherUser
- password=otherPassword
- email=otherUser@example.com
- someUser
Every tag end is independent from name, so it's faster to read and easier to change.
Testing phase.
Do not forget about using directive!
var writer = new Writer();
writer.OpenStream("filename.btag");
var parser = new Parser();
parser.OpenStream("filename.btag");
writer.WriteAll(new Tag("main"));
var main = new Tag("main");
main.AddChild(new Tag("child"));
or
var manager = new TagManager();
manager.AddChildToLast(new Tag("first"));
manager.AddChildToLast(new Tag("child"));
(Deactivate tag before adding to tag manager if you don't want to add new childes to it using AddChildToLast)
writer.WriteAll(main);
var tagsList = new List<Tag>(){ main, new Tag("secondMain") };
writer.WriteAllList(tagsList);
parser.Parse();
var main = parser.FindTagLayerRoot("main");
var child = parser.FindTagLayer(main, "child");
Tag
class is created for storing tag data in memory. So you can create file in memory and then write to file. Contains value variable that can store tag value and Childes
for accessing children list.
Parser
- just use OpenStream
and Parse
to parse entire file. FindTagLayerRoot
and FindTagLayer
can be useful for finding tags on layers.
Writer
- use OpenStream
and WriteAll
or WriteAllList
to write to file.
TagManager
- easy tags management. AddChildToLast
is very useful to save memory.
32767 (Int16) bytes tag value length.
255 bytes tag title length.
- Server for easy using with other languages
- TryFind methods (perhaps)