+ command = "CREATE TABLE ";
+ command += GetTree().GetLevelDescriptor(l).GetName();
+ command += "_Attributes\n(\n";
+ command += "Key text,\n";
+ command += "Name text,\n";
+ command += "DicomGroup int,\n";
+ command += "DicomElement int,\n";
+ command += "Flags int\n";
+ command += "\n)";
+ UPDATEDB(command);
+
+ // Fill the table *_ATTRIBUTES
+ LevelDescriptor::AttributeDescriptorListType::const_iterator i;
+ for (i = GetTree().GetAttributeDescriptorList(l).begin();
+ i != GetTree().GetAttributeDescriptorList(l).end();
+ ++i)
+ {
+
+ std::stringstream insert;
+ insert << "INSERT INTO "
+ << GetTree().GetLevelDescriptor(l).GetName()
+ << "_Attributes (Key,Name,DicomGroup,DicomElement,Flags) "
+ << "VALUES ('"
+ << i->GetKey() << "','"
+ << i->GetName() << "',"
+ << i->GetGroup() << ","
+ << i->GetElement() << ","
+ << i->GetFlags() << ");";
+ UPDATEDB(insert.str());
+ }
+
+ } // For l=0...
+
+ // Initialize the root attributes
+ GetTree().InitializeAttributeMap();
+ // Insert the root in the level 0 table
+ DBInsert(GetTree().GetTree());
+
+
+ GetTree().SetChildrenLoaded(true);
+ GimmickMessage(1,"Creating SQLite database '"<<GetFileName()
+ <<"' ... OK"<<std::endl);
+ return true;