]> Creatis software - gdcm.git/commitdiff
Seems that ArgMgrWant... doesn't work on MacOS.
authorjpr <jpr>
Mon, 17 Mar 2008 13:16:10 +0000 (13:16 +0000)
committerjpr <jpr>
Mon, 17 Mar 2008 13:16:10 +0000 (13:16 +0000)
Protect prgram against user with ArgMgrDefined

Example/Dense2007ToDicom.cxx

index e8c30c4dd40bb88ba7886d1700137362a2c51ef9..afeb9b5be2aa02558dd7745e2e13df7749a990e7 100755 (executable)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: Dense2007ToDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/10/29 17:13:59 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2008/03/17 13:16:10 $
+  Version:   $Revision: 1.6 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -67,7 +67,18 @@ int main(int argc, char *argv[])
       delete am;
       return 0;
    }
-
+   // Seems that ArgMgrWantString doesn't work on MacOS   
+   if(!am->ArgMgrDefined("strain"))
+   {
+      std::cout << "strain is mandatory" << std::endl;
+      exit(0);   
+   }
+   if(!am->ArgMgrDefined("peak_strain"))
+   {
+      std::cout << "peak_strain is mandatory" << std::endl;
+      exit(0);   
+   }
+      
    const char *strain      = am->ArgMgrWantString("strain",usage);
    const char *peak_strain = am->ArgMgrWantString("peak_strain",usage);