Program: gdcm
Module: $RCSfile: TestAllReadCompareDicom.cxx,v $
Language: C++
- Date: $Date: 2005/04/15 21:46:06 $
- Version: $Revision: 1.36 $
+ Date: $Date: 2005/04/19 10:05:36 $
+ Version: $Revision: 1.39 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmFileHelper.h"
#include <iostream>
-#include <fstream>
//Generated file:
#include "gdcmDataImages.h"
bool WriteFileData(std::ofstream *fp);
uint8_t ReadInt8 (std::ifstream *fp)
-#ifndef __GNUC__
- throw( std::ofstream::failure );
+#if !(__GNUC__==2 && __GNUC_MINOR__<=96)
+ throw( std::ios::failure );
#else
;
#endif
uint16_t ReadInt16(std::ifstream *fp)
-#ifndef __GNUC__
+#if !(__GNUC__==2 && __GNUC_MINOR__<=96)
throw( std::ios::failure );
#else
;
#endif
uint32_t ReadInt32(std::ifstream *fp)
-#ifndef __GNUC__
+#if !(__GNUC__==2 && __GNUC_MINOR__<=96)
throw( std::ios::failure );
#else
;
int sizeX;
int sizeY;
int sizeZ;
- int scalarSize;
- int components;
+ uint16_t scalarSize;
+ uint16_t components;
uint8_t *data;
int swapCode;
sizeY = ReadInt32(fp); // Size Y
sizeZ = ReadInt32(fp); // Size Z
scalarSize = ReadInt16(fp)/8; // bits per scalar
- components = ReadInt16(fp); // Number of components
+ components = ReadInt16(fp); // Number of components
return(true);
}
WriteInt32(fp,sizeY); // Size Y
WriteInt32(fp,sizeZ); // Size Z
WriteInt16(fp,scalarSize*8); // bits per scalar
- WriteInt16(fp,components); // number of components
+ WriteInt16(fp,components); // number of components
return(true);
}
}
uint8_t TestFile::ReadInt8 (std::ifstream *fp)
-#ifndef __GNUC__
+#if !(__GNUC__==2 && __GNUC_MINOR__<=96)
throw( std::ios::failure )
#endif
{
uint8_t g;
fp->read ((char*)&g, (size_t)1);
-#ifndef __GNUC__
+#if !(__GNUC__==2 && __GNUC_MINOR__<=96)
if ( fp->fail() )
throw std::ios::failure( "TestFile::ReadInt8() - file error." );
if( fp->eof() )
}
uint16_t TestFile::ReadInt16(std::ifstream *fp)
-#ifndef __GNUC__
+#if !(__GNUC__==2 && __GNUC_MINOR__<=96)
throw( std::ios::failure )
#endif
{
uint16_t g;
fp->read ((char*)&g, (size_t)2);
-#ifndef __GNUC__
+#if !(__GNUC__==2 && __GNUC_MINOR__<=96)
if ( fp->fail() )
throw std::ios::failure( "TestFile::ReadInt16() - file error." );
if( fp->eof() )
}
uint32_t TestFile::ReadInt32(std::ifstream *fp)
-#ifndef __GNUC__
+#if !(__GNUC__==2 && __GNUC_MINOR__<=96)
throw( std::ios::failure )
#endif
{
uint32_t g;
fp->read ((char*)&g, (size_t)4);
-#ifndef __GNUC__
+#if !(__GNUC__==2 && __GNUC_MINOR__<=96)
if ( fp->fail() )
throw std::ios::failure( "TestFile::ReadInt32() - file error." );
if( fp->eof() )