Salome HOME
Merge branch 'master' of salome:modules/med
[tools/medcoupling.git] / src / MEDLoader / MEDFileUtilities.cxx
index 3d2cbe48dbdfd38637b9504b2fd72cbc25e16cae..a402c36cdc4be711c69d547772ff263d1746b775 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -26,7 +26,7 @@
 med_access_mode MEDFileUtilities::TraduceWriteMode(int medloaderwritemode)
 {
   switch(medloaderwritemode)
-    {
+  {
     case 2:
       return MED_ACC_CREAT;
     case 1:
@@ -35,7 +35,7 @@ med_access_mode MEDFileUtilities::TraduceWriteMode(int medloaderwritemode)
       return MED_ACC_RDWR;
     default:
       throw INTERP_KERNEL::Exception("Invalid write mode specified ! must be 0(write with no question), 1(append) or 2(creation)");
-    }
+  }
 }
 
 const char *MEDFileUtilities::GetReadableMEDFieldType(med_field_type ft)
@@ -44,7 +44,7 @@ const char *MEDFileUtilities::GetReadableMEDFieldType(med_field_type ft)
   static const char medInt32[]="MED_INT32";
   static const char medInt64[]="MED_INT64";
   switch(ft)
-    {
+  {
     case MED_FLOAT64:
       return medFloat64;
     case MED_INT32:
@@ -53,7 +53,7 @@ const char *MEDFileUtilities::GetReadableMEDFieldType(med_field_type ft)
       return medInt64;
     default:
       throw INTERP_KERNEL::Exception("Non supported field type ! Should be FLOAT64, INT32 or INT64 !");
-    }
+  }
 }
 
 void MEDFileUtilities::CheckMEDCode(int code, med_idt fid, const std::string& msg)
@@ -72,7 +72,7 @@ void MEDFileUtilities::CheckFileForRead(const std::string& fileName)
   std::ostringstream oss;
   oss << " File : \"" << fileName << "\"";
   switch(status)
-    {
+  {
     case MEDLoaderBase::DIR_LOCKED:
       {
         oss << " has been detected as unreadable : impossible to read anything !";
@@ -88,7 +88,7 @@ void MEDFileUtilities::CheckFileForRead(const std::string& fileName)
         oss << " has been detected as WRITE ONLY : impossible to read anything !";
         throw INTERP_KERNEL::Exception(oss.str().c_str());
       }
-    }
+  }
   AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
   if(fid<0)
     {
@@ -109,11 +109,6 @@ MEDFileUtilities::AutoFid::AutoFid(med_idt fid):_fid(fid)
 {
 }
 
-MEDFileUtilities::AutoFid::operator med_idt() const
-{
-  return _fid;
-}
-
 MEDFileUtilities::AutoFid::~AutoFid()
 {
   MEDfileClose(_fid);