Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/med.git] / src / MEDMEM / MEDMEM_Exception.cxx
index 473aba560675ea2c18132a7abc408a589e725a33..89613a343ee87da3523826248303c72803ef1525 100644 (file)
@@ -1,21 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// 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.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  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.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 /*
  File MedException.cxx
@@ -42,11 +44,11 @@ extern "C"
 char* duplicate( const char *const str ) ;
 char* duplicate( const char *const str )
 {
-       ASSERT(str!=NULL) ;
+       ASSERT_MED(str!=NULL) ;
        const size_t length = strlen( str ) ;
-       ASSERT(length>0) ;
+       ASSERT_MED(length>0) ;
        char *new_str = new char[ 1+length ] ;
-       ASSERT(new_str) ;
+       ASSERT_MED(new_str) ;
        strcpy( new_str , str ) ;
        return new_str ;
 }
@@ -58,8 +60,8 @@ char* duplicate( const char *const str )
 MEDEXCEPTION::MEDEXCEPTION( void ): exception() , _text(0)
 // ------------------------------------------------------ //
 {
-  MESSAGE( "You must user the standard builder : MEDEXCEPTION::MEDEXCEPTION( const char *text )" ) ;
-  INTERRUPTION(1) ;
+  MESSAGE_MED( "You must user the standard builder : MEDEXCEPTION::MEDEXCEPTION( const char *text )" ) ;
+  INTERRUPTION_MED(1) ;
 }
 
 
@@ -73,7 +75,7 @@ char *makeText( const char *text, const char *fileName, const unsigned int lineN
 {
   char *newText = 0 ;
 
-  ASSERT(text) ;
+  ASSERT_MED(text) ;
   const size_t l1 = strlen(text) ;
 
   const char* prefix = "MED Exception" ;
@@ -83,13 +85,13 @@ char *makeText( const char *text, const char *fileName, const unsigned int lineN
   {
       const size_t l2 = strlen(fileName) ;
 
-      ASSERT(lineNumber>=1) ;
+      ASSERT_MED(lineNumber>=1) ;
       const size_t l3 = 1+int(log10(float(lineNumber))) ;
        
       const size_t l4 =  l0+l1+l2+l3+10+1 ;
       newText = new char [ l4 ] ;
       sprintf( newText , "%s in %s [%u] : %s" , prefix, fileName, lineNumber, text ) ;
-      ASSERT(newText[l4-1] == '\0' );
+      ASSERT_MED(newText[l4-1] == '\0' );
 
   }
   else
@@ -97,7 +99,7 @@ char *makeText( const char *text, const char *fileName, const unsigned int lineN
       newText = new char [ l0+l1+3+1 ] ;
       sprintf( newText , "%s : %s" , prefix, text ) ;
    }
-  ASSERT(newText) ;
+  ASSERT_MED(newText) ;
   return newText ;
 }
 
@@ -112,7 +114,7 @@ MEDEXCEPTION::MEDEXCEPTION( const char *text, const char *fileName, const unsign
              exception(), _text( makeText( text , fileName , lineNumber ) )
 // ------------------------------------------------------------------------------------------------ //
 {
-  MESSAGE(_text);
+  MESSAGE_MED(_text);
 }
 
 /*!
@@ -129,7 +131,7 @@ MEDEXCEPTION::~MEDEXCEPTION() throw ()
       delete [] _text ;
       _text = 0 ;
     }
-  ASSERT(_text==NULL) ;
+  ASSERT_MED(_text==NULL) ;
 }