[chessx-developer] Added first implementation for support of basic tags in native chessx format
Chess Database and PGN viewer
Brought to you by:
hognose
From: Rico Z. <ri...@gm...> - 2007-10-25 20:42:05
|
Dear chessx-developers and testers, I just commited some code to the repository for handling basic tags in the native chessx database format. Some comments on the commit. Now it should be possible to add new games to a native chessx database (short cxd database) by using Game->Save... (you first have to create a cxd database with File->New database...). The currently supported tags are basically the ones which are listed in the Game List window. At the moment it is not possible to do the following (among other less basic operations) : - remove games - using a non-standard start position - using non-standard tags. There are also no special search-boosters used at the moment. I promised Michal that I will shortly discuss some design decisions I took for the current cxd database such that developers can get a first impression, propose improvement or simple criticize the current design. Currently a database consists of 14 (!) files. So it is probably wise to create databases in a separate folder. The database contains one xml file with file extension .cxd describing which files are part of the database and giving versioning information. There is one file with extension .cxg containing all the moves, comments and nags of the games in encoded form. A file with extension .cxa contains information where to find the games in the .cxg file. The .cxg as well as the .cxa file are not loaded into memory (probably I will load the .cxa file into memory in a later version to speed up searches). Then there is a bunch of files for handling tags. There is a file (with extension .cxv) for every standard tag containing all the values the respective tag takes in the database. Currently all tags are handled as strings but this can be changed in a later stage. A file with the extension .cxi contains for each game 27 bits describing the values of the standard tags for the corresponding game (for further information see index.cpp). All these files are loaded into memory to enable fast header search. I plan to add two further files, one containing all the information for non-standard tags and another one describing where to find which information in the first file (similar to the design chosen for the .cxg/.cxa files). It was a difficult decision whether to use as few files as possible (which makes it somehow easier to handle databases on the disk) or use lots of files (In this case some operations should be faster to realize when using multiple files and the whole design is a bit more modular. Furthermore I have the hope that this design is easier to maintain.). As it is not difficult to see I went for the second option. @Bruno and other testers: I think that now is already a good point for reporting possible misbehaviors of the current cxd database functionalities. I would greatly appreciate any feedback from your side. Regards, Rico |