-/* size_t o =(size_t)docElement->GetOffset();
- Fp->seekg( o, std::ios_base::beg);
- size_t l = docElement->GetLength();
- uint8_t* a = new uint8_t[l];
- if(!a)
- {
- dbg.Verbose(0, "Document::LoadEntryBinArea cannot allocate a");
- return;
- }
-
- // Read the value
- Fp->read((char*)a, l);
- if( Fp->fail() || Fp->eof() )//Fp->gcount() == 1
- {
- delete[] a;
- return;
- }
-
- // Set the value to the DocEntry
- if( !SetEntryBinAreaByNumber( a, group, elem ) )
- {
- delete[] a;
- dbg.Verbose(0, "Document::LoadEntryBinArea setting failed.");
- }*/
-}
-
-/**
- * \brief Loads (from disk) the element content
- * when a string is not suitable
- * @param element Entry whose binArea is going to be loaded
- */
-void Document::LoadEntryBinArea(BinEntry* element)
-{
- bool openFile = !Fp;
- if(openFile)
- OpenFile();
-
- size_t o =(size_t)element->GetOffset();
- Fp->seekg(o, std::ios_base::beg);
-
- size_t l = element->GetLength();
- uint8_t* a = new uint8_t[l];
- if( !a )
- {
- dbg.Verbose(0, "Document::LoadEntryBinArea cannot allocate a");
- return;
- }
-
- /// \todo check the result
- Fp->read((char*)a, l);
- if( Fp->fail() || Fp->eof()) //Fp->gcount() == 1
- {
- delete[] a;
- return;
- }
-
- element->SetBinArea(a);
-
- if(openFile)
- CloseFile();
-}
-
-/**
- * \brief Sets a 'non string' value to a given Dicom Element
- * @param area area containing the 'non string' value
- * @param group Group number of the searched Dicom Element
- * @param element Element number of the searched Dicom Element
- * @return
- */
-bool Document::SetEntryBinAreaByNumber(uint8_t* area,
- uint16_t group, uint16_t element)
-{
- DocEntry* currentEntry = GetDocEntryByNumber(group, element);
- if ( !currentEntry )
- {
- return false;
- }
-
- if ( BinEntry* binEntry = dynamic_cast<BinEntry*>(currentEntry) )
- {
- binEntry->SetBinArea( area );
- return true;
- }
-
- return false;
-}
-
-/**
- * \brief Update the entries with the shadow dictionary.
- * Only non even entries are analyzed
- */
-void Document::UpdateShaEntries()
-{
- //DictEntry *entry;
- std::string vr;
-
- /// \todo TODO : still any use to explore recursively the whole structure?
-/*
- for(ListTag::iterator it=listEntries.begin();
- it!=listEntries.end();
- ++it)
- {
- // Odd group => from public dictionary
- if((*it)->GetGroup()%2==0)
- continue;
-
- // Peer group => search the corresponding dict entry
- if(RefShaDict)
- entry=RefShaDict->GetDictEntryByNumber((*it)->GetGroup(),(*it)->GetElement());
- else
- entry=NULL;
-
- if((*it)->IsImplicitVR())
- vr="Implicit";
- else
- vr=(*it)->GetVR();
-
- (*it)->SetValue(GetDocEntryUnvalue(*it)); // to go on compiling
- if(entry){
- // Set the new entry and the new value
- (*it)->SetDictEntry(entry);
- CheckDocEntryVR(*it,vr);
-
- (*it)->SetValue(GetDocEntryValue(*it)); // to go on compiling
-
- }
- else
- {
- // Remove precedent value transformation
- (*it)->SetDictEntry(NewVirtualDictEntry((*it)->GetGroup(),(*it)->GetElement(),vr));
- }
- }
-*/