Salome HOME
untabify
[modules/kernel.git] / src / Utils / Utils_SALOME_Exception.cxx
index 6039476de8fe725ab4ca1eff0d1f627a2d1636b8..0e2b86e6e009f4e26e514561e173914a6347683d 100644 (file)
@@ -45,41 +45,41 @@ const char* duplicate( const char *const str ) ;
 
 SALOME_Exception::SALOME_Exception( void ): exception() , _text(0)
 {
-       MESSAGE( "You must use the standard builder: SALOME_Exception::SALOME_Exception( const char *text )" ) ;
-       INTERRUPTION(1) ;
+        MESSAGE( "You must use the standard builder: SALOME_Exception::SALOME_Exception( const char *text )" ) ;
+        INTERRUPTION(1) ;
 }
 
 
 
 const char *makeText( const char *text, const char *fileName, const unsigned int lineNumber )
 {
-       char *newText = 0 ;
-
-       ASSERT(text) ;
-       const size_t l1 = 1+strlen(text) ;
-       ASSERT(l1>1) ;
-
-       const char* prefix = "Salome Exception" ;
-       const size_t l0 = 2+strlen(prefix) ;
-
-       if ( fileName )
-       {
-               const size_t l2 = 4+strlen(fileName) ;
-               ASSERT(l2>4) ;
-
-               ASSERT(lineNumber>=1) ;
-               const size_t l3 = 4+int(log10(float(lineNumber))) ;
-               
-               newText = new char [ 1+l0+l1+l2+l3 ] ;
-               sprintf( newText , "%s in %s [%u] : %s" , prefix, fileName, lineNumber, text ) ;
-       }
-       else
-       {
-               newText = new char [ 1+l0+l1 ] ;
-               sprintf( newText , "%s : %s" , prefix, text ) ;
-       }
-       ASSERT(newText) ;
-       return newText ;
+        char *newText = 0 ;
+
+        ASSERT(text) ;
+        const size_t l1 = 1+strlen(text) ;
+        ASSERT(l1>1) ;
+
+        const char* prefix = "Salome Exception" ;
+        const size_t l0 = 2+strlen(prefix) ;
+
+        if ( fileName )
+        {
+                const size_t l2 = 4+strlen(fileName) ;
+                ASSERT(l2>4) ;
+
+                ASSERT(lineNumber>=1) ;
+                const size_t l3 = 4+int(log10(float(lineNumber))) ;
+                
+                newText = new char [ 1+l0+l1+l2+l3 ] ;
+                sprintf( newText , "%s in %s [%u] : %s" , prefix, fileName, lineNumber, text ) ;
+        }
+        else
+        {
+                newText = new char [ 1+l0+l1 ] ;
+                sprintf( newText , "%s : %s" , prefix, text ) ;
+        }
+        ASSERT(newText) ;
+        return newText ;
 }
 
 
@@ -90,32 +90,32 @@ SALOME_Exception::SALOME_Exception( const char *text, const char *fileName, cons
 
 SALOME_Exception::~SALOME_Exception() throw ()
 {
-       if ( _text )
-       {
-               delete [] ((char*)_text);
-               char** pRef = (char**)&_text;
-               *pRef = 0;
-       }
-       ASSERT(_text==NULL) ;
+        if ( _text )
+        {
+                delete [] ((char*)_text);
+                char** pRef = (char**)&_text;
+                *pRef = 0;
+        }
+        ASSERT(_text==NULL) ;
 }
 
 
 
 SALOME_Exception::SALOME_Exception( const SALOME_Exception &ex ): _text(duplicate(ex._text))
 {
-       ;
+        ;
 }
 
 
 std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex )
 {
-       os << ex._text ;
-       return os ;
+        os << ex._text ;
+        return os ;
 }
 
 
 
 const char* SALOME_Exception::what( void ) const throw ()
 {
-       return _text ;
+        return _text ;
 }