]> Creatis software - gdcm.git/commitdiff
Bug fix in command line argument manager
authorjpr <jpr>
Sun, 28 Aug 2005 16:56:05 +0000 (16:56 +0000)
committerjpr <jpr>
Sun, 28 Aug 2005 16:56:05 +0000 (16:56 +0000)
src/gdcmArgMgr.cxx
src/gdcmArgMgr.h

index 6564bce4e1639cbef20976329de5250f21baf225..79ef553c6ee482dc23064859eebe2a71dd9ae98f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmArgMgr.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/07/30 18:18:44 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2005/08/28 16:56:05 $
+  Version:   $Revision: 1.13 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -117,10 +117,10 @@ ArgMgr::~ArgMgr()
 /**
  * \brief  checks if a parameter exists in the command line
  * @param param  label name
- * @return   false if label is not found
- *           true  if label is not found
+ * @return   0 if label is not found
+ *           else, returns the number of the spot it was found last time.
  */
-bool ArgMgr::ArgMgrDefined( const char *param )
+int ArgMgr::ArgMgrDefined( const char *param )
 {
   int i, trouve ;
   char *temp;
@@ -134,12 +134,12 @@ bool ArgMgr::ArgMgrDefined( const char *param )
       for ( int j=1; j<i; j++)
       {                     
          if ( (!ArgUsed[j])&&(!strcmp(ArgLab[i],ArgLab[j])) )
-            ArgUsed[j] = true ;
+            ArgUsed[j] = i ;
       }
-      return true ;
+      return i ;
     }
   }
-  return false ;
+  return 0 ;
 }
 
 /**
index fa24597f2b073a60032d6995fa295d9bccfe0433..18b6454cd8ac8eaa86951b35d99cc14b2c18de55 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmArgMgr.h,v $
   Language:  C++
-  Date:      $Date: 2005/07/30 18:18:44 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2005/08/28 16:56:05 $
+  Version:   $Revision: 1.10 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -54,7 +54,7 @@ public:
    ArgMgr(int argc, char **argv);
    ~ArgMgr();
 
-   bool   ArgMgrDefined           (const char *param);  // Checks if Param is defined
+   int    ArgMgrDefined           (const char *param);  // Checks if Param is defined
    char  *ArgMgrValue             (const char *param);  // Returns Param value 
    char  *ArgMgrUnused            (void);               // Returns a never used arg.
    int    ArgMgrSave              (char *);             // Save of parameters out