Program: gdcm
Module: $RCSfile: gdcmArgMgr.cxx,v $
Language: C++
- Date: $Date: 2006/04/11 16:03:26 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2007/10/04 17:50:42 $
+ Version: $Revision: 1.26 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmArgMgr.h"
-namespace gdcm
+namespace GDCM_NAME_SPACE
{
//-------------------------------------------------------------------------
// Constructor / Destructor
* @param argv pointers array on the arguments passed to main()
*/
ArgMgr::ArgMgr(int argc, char **argv)
+ : ArgParamOut (NULL), ArgUsed(NULL), ArgLab(NULL), ArgStr(NULL), ArgCount(0), Appel(NULL)
{
int i;
- int nblettre;
- ArgUsed = NULL;
- Appel = NULL;
-
+ int nblettre;
+ ArgLab = new char *[ARGMAXCOUNT];
+ ArgStr = new char *[ARGMAXCOUNT];
+
/* Read the parameters of the command line *************************/
for ( ArgCount=0, nblettre=1 , i=0; i<argc; i++)
{
char * egaloufin = ArgLab[i] ;
while ( (*egaloufin != '\0') && (*egaloufin != '=') )
egaloufin ++ ;
- if ( *egaloufin ) *(egaloufin++) = '\0';
+ if ( *egaloufin )
+ *(egaloufin++) = '\0';
ArgStr[i]= egaloufin;
}
/* Set labels to upper-case (labels are not case sensitive ) *********/
- char *secu;
+ //char *secu;
for ( i=0; i<ArgCount; i++)
{
- secu = ArgLab[i];
+ //secu = ArgLab[i];
ArgLab[i] = Majuscule ( ArgLab[i] ) ;
//free (secu); //we still need it in the caller pgm.
}
for(int i=0;i<ArgCount;i++)
if ( ArgLab[i] )
free(ArgLab[i]);
+ delete ArgLab;
+ delete ArgStr;
if ( ArgUsed )
free(ArgUsed);
if ( Appel )
free(Appel);
+
}
/**