Task #15

database class draft

Added by Fedor Gelfreich over 2 years ago.

Status:New Start date:09/04/2009
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:- Spent time: -
Target version:-

Description

Create a draft for the database class.
The class should provide the following:
Records
Mandatory data:

File: file ID, name, path and any other info such size and type
Tag: ID and name
FT_link: FileID, TagID -- simply linking files and tags

Extra data:

Type: links type to extra data tables
Metadata: ID3 tag like information
etc -- more can be be added

Methods

AddTag(name) -- creates a new tag entry in the database, also checks for duplicates
LinkTag(TagID, FileID)
FindTag(name) -- returns IDs of tags that contain a given string (the return value could a pointer to an array or the equivalent in Ada)
Tag(ID) -- returns the whole record
ScanFS(DirPath) -- get a list of files
ParseFiles(FileList) -- goes thought the list of files analysing them and inserting into the File table.
GenFileID(FilePath) -- Find some algorithm to quickly evaluate a hash like number that would uniquely identify a file even if it's name has changed. That might need some thinking as to what in the file should be allowed to be modified without it being treated as different file (e.g. editing of ID3).
FilterFilesByTag - do that and generate a list of FileID


"type conversion methods" such as .toString, .toInterger, e.g. db.tag(214918276).ID.toString. These could be left to some base class deal with if needed

Also available in: Atom PDF