+ // Deal with element 0x0000 (group length) of each group.
+ // First stage : get all the different Groups
+ /*
+ GroupHT grHT;
+ DocEntry *d = FileInternal->GetFirstEntry();
+ while(d)
+ {
+ grHT[d->GetGroup()] = 0;
+ d=FileInternal->GetNextEntry();
+ }
+ // Second stage : add the missing ones (if any)
+ for (GroupHT::iterator it = grHT.begin(); it != grHT.end(); ++it)
+ {
+ CheckMandatoryEntry(it->first, 0x0000, "0");
+ }
+ // Third stage : update all 'zero level' groups length
+*/
+}
+
+void FileHelper::CheckMandatoryEntry(uint16_t group,uint16_t elem,std::string value)
+{
+ DataEntry *entry = FileInternal->GetDataEntry(group,elem);
+ if ( !entry )
+ {
+ entry = DataEntry::New(Global::GetDicts()->GetDefaultPubDict()->GetEntry(group,elem));
+ entry->SetString(value);
+ Archive->Push(entry);
+ entry->Delete();
+ }
+}
+
+void FileHelper::SetMandatoryEntry(uint16_t group,uint16_t elem,std::string value)
+{
+ DataEntry *entry = DataEntry::New(Global::GetDicts()->GetDefaultPubDict()->GetEntry(group,elem));
+ entry->SetString(value);
+ Archive->Push(entry);
+ entry->Delete();
+}
+
+void FileHelper::CopyMandatoryEntry(uint16_t group,uint16_t elem,std::string value)
+{
+ DataEntry *entry = CopyDataEntry(group,elem);
+ entry->SetString(value);
+ Archive->Push(entry);
+ entry->Delete();
+}
+
+/**
+ * \brief Restore in the File the initial group 0002
+ */
+void FileHelper::RestoreWriteMandatory()
+{
+ // group 0002 may be pushed out for ACR-NEMA writting purposes
+ Archive->Restore(0x0002,0x0000);
+ Archive->Restore(0x0002,0x0001);
+ Archive->Restore(0x0002,0x0002);
+ Archive->Restore(0x0002,0x0003);
+ Archive->Restore(0x0002,0x0010);
+ Archive->Restore(0x0002,0x0012);
+ Archive->Restore(0x0002,0x0013);
+ Archive->Restore(0x0002,0x0016);
+ Archive->Restore(0x0002,0x0100);
+ Archive->Restore(0x0002,0x0102);
+
+ // FIXME : Check if none is missing !
+
+ Archive->Restore(0x0008,0x0012);
+ Archive->Restore(0x0008,0x0013);
+ Archive->Restore(0x0008,0x0016);
+ Archive->Restore(0x0008,0x0018);
+ Archive->Restore(0x0008,0x0060);
+ Archive->Restore(0x0008,0x0070);
+ Archive->Restore(0x0008,0x0080);
+ Archive->Restore(0x0008,0x0090);
+ Archive->Restore(0x0008,0x2112);
+
+ Archive->Restore(0x0010,0x0010);
+ Archive->Restore(0x0010,0x0030);
+ Archive->Restore(0x0010,0x0040);
+
+ Archive->Restore(0x0020,0x000d);
+ Archive->Restore(0x0020,0x000e);
+}
+
+
+/**
+ * \brief CallStartMethod
+ */
+void FileHelper::CallStartMethod()
+{
+ Progress = 0.0f;
+ Abort = false;
+ CommandManager::ExecuteCommand(this,CMD_STARTPROGRESS);
+}
+
+/**
+ * \brief CallProgressMethod
+ */
+void FileHelper::CallProgressMethod()
+{
+ CommandManager::ExecuteCommand(this,CMD_PROGRESS);
+}
+
+/**
+ * \brief CallEndMethod
+ */
+void FileHelper::CallEndMethod()
+{
+ Progress = 1.0f;
+ CommandManager::ExecuteCommand(this,CMD_ENDPROGRESS);
+}
+