Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/11/03 18:14:52 $
- Version: $Revision: 1.115 $
+ Date: $Date: 2004/11/04 18:14:34 $
+ Version: $Revision: 1.116 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Fp->read ((char*)&g, (size_t)2);
if ( Fp->fail() )
{
- throw FormatError( "Document::ReadInt16()", " file error." );
+ throw FormatError( "Document::ReadInt16()", " file error." );
}
if( Fp->eof() )
{
//// Read the Item Tag group and element, and make
// sure they are what we expected:
- uint16_t itemTagGroup = ReadInt16();
- uint16_t itemTagElement = ReadInt16();
+ uint16_t itemTagGroup;
+ uint16_t itemTagElement;
+ try
+ {
+ itemTagGroup = ReadInt16();
+ itemTagElement = ReadInt16();
+ }
+ catch ( FormatError e )
+ {
+ //std::cerr << e << std::endl;
+ return false;
+ }
if ( itemTagGroup != testGroup || itemTagElement != testElement )
{
std::ostringstream s;
Program: gdcm
Module: $RCSfile: gdcmException.cxx,v $
Language: C++
- Date: $Date: 2004/10/28 19:58:05 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2004/11/04 18:14:34 $
+ Version: $Revision: 1.22 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
try
{
-#ifdef __GNUC__ // GNU C++ compiler class name demangling
+#if defined(__GNUC__) && 0 // GNU C++ compiler class name demangling
unsigned int nested = 1, i, nb;
int offset;
std::string one;
}
return name;
#else // no class name demangling
- //name = typeid(*this).name();
- return "Exception";
+ std::string name = typeid(*this).name();
+ return name;
#endif
}
catch(...) {
Program: gdcm
Module: $RCSfile: gdcmException.h,v $
Language: C++
- Date: $Date: 2004/10/12 04:35:46 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2004/11/04 18:14:34 $
+ Version: $Revision: 1.18 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// @param from name of the thrower
/// @param error error description string
explicit FormatUnexpected(const std::string &from,
- const std::string &error = "Unexpected file format")
+ const std::string &error = "Unexpected file format")
throw() : Exception( from, error ) { }
};
/// @param from name of the thrower
/// @param error error description string
explicit FormatError(const std::string &from,
- const std::string &error = "Invalid file format")
+ const std::string &error = "Invalid file format")
throw() : FormatUnexpected( from, error ) { }
};
Program: gdcm
Module: $RCSfile: gdcmPixelConvert.cxx,v $
Language: C++
- Date: $Date: 2004/10/28 22:21:57 $
- Version: $Revision: 1.22 $
+ Date: $Date: 2004/11/04 18:14:34 $
+ Version: $Revision: 1.23 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
// Just in case some access to a Header element requires disk access.
// Note: gdcmDocument::Fp is leaved open after OpenFile.
- std::ifstream* fp = header->OpenFile();
+ std::ifstream* fp = header->OpenFile();
// Number of Bits Allocated for storing a Pixel is defaulted to 16
// when absent from the header.
BitsAllocated = header->GetBitsAllocated();