Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/11/30 16:59:32 $
- Version: $Revision: 1.144 $
+ Date: $Date: 2004/12/02 15:14:17 $
+ Version: $Revision: 1.145 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
std::ifstream* Document::OpenFile()
{
- if (Filename.length() == 0) return 0;
+ if (Filename.length() == 0)
+ {
+ return 0;
+ }
+
if(Fp)
{
dbg.Verbose( 0,
}
Fp = new std::ifstream(Filename.c_str(), std::ios::in | std::ios::binary);
-
- if(!Fp)
+ if( ! *Fp )
{
dbg.Verbose( 0,
"Document::OpenFile cannot open file: ",
Filename.c_str());
+ delete Fp;
+ Fp = 0;
return 0;
}
dbg.Verbose(0, "Document::ReplaceOrCreateByNumber: AddEntry"
" failed allthough this is a creation.");
}
+ delete currentEntry;
}
else
{
// within an explicit VR file. Hence we make sure the present tag
// is in explicit VR and try to fix things if it happens not to be
// the case.
-
+ vr[0] = 0x00;
+ vr[1] = 0x00;
Fp->read (vr, (size_t)2);
vr[2] = 0;
RefShaDict = NULL;
RLEInfo = new RLEFramesInfo;
JPEGInfo = new JPEGFragmentsInfo;
+ Filetype = Unknown;
}
/**