X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmArgMgr.h;h=3bf350c963078c7bcfd36145c6fc54033a1afad6;hb=35ee8ee8af32946514713d271177df8bb2298eb2;hp=28304016b460e5e2fea7c27871c65c72b25ff6b5;hpb=dc9e22215d010c85822ee4cf6c89af586e1e5134;p=gdcm.git diff --git a/src/gdcmArgMgr.h b/src/gdcmArgMgr.h index 28304016..3bf350c9 100644 --- a/src/gdcmArgMgr.h +++ b/src/gdcmArgMgr.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmArgMgr.h,v $ Language: C++ - Date: $Date: 2005/06/08 09:24:17 $ - Version: $Revision: 1.4 $ + Date: $Date: 2008/04/10 12:03:46 $ + Version: $Revision: 1.15 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -20,22 +20,22 @@ #define ___ARG_MGR__ #include "gdcmCommon.h" -#include // for FILE +#include // for FILE #include // For atof -namespace gdcm +namespace GDCM_NAME_SPACE { -#define ID_RFILE_TEXT "rt" -#define ARGMAXCOUNT 100 // Maximum number of arguments -#define ARG_LONG_MAX 1000 +#define ID_RFILE_TEXT "rt" +#define ARGMAXCOUNT 100 // Maximum number of arguments +#define ARG_LONG_MAX 1000 // default file name -#define ARG_DEFAULT_PARAMOUT "fileout.par" -#define ARG_DEFAULT_LOGFILE "gdcm.log" +#define ARG_DEFAULT_PARAMOUT "fileout.par" +#define ARG_DEFAULT_LOGFILE "gdcm.log" -#define ARG_LABEL_LOGFILE "LOG" -#define ARG_LABEL_PARAMOUT "paramout" +#define ARG_LABEL_LOGFILE "LOG" +#define ARG_LABEL_PARAMOUT "paramout" #define START_USAGE(usage) const char *usage[] = { #define FINISH_USAGE 0}; @@ -54,55 +54,61 @@ public: ArgMgr(int argc, char **argv); ~ArgMgr(); - int ArgMgrDefined (char *); /* Checks if Param is defined*/ - char *ArgMgrValue (char *); /* Returns Param value */ - char *ArgMgrUnused (void); /* Returns a never used arg. */ - int ArgMgrSave (char *); /* Save of parameters out */ - int ArgMgrUsage (const char **);/* Display program usage */ - int ArgMgrPrintUnusedLabels (void); /* Prints unused labels */ - - int ArgMgrGetInt (char*, int); /* Gets an int (with default value) */ - float ArgMgrGetFloat (char*, float);/* Gets a float (with default value) */ - char *ArgMgrGetString(char*, char*);/* Gets a string (with default value) */ - int ArgMgrGetLabel (char *, char *, int); + int ArgMgrDefined (const char *param); // Checks if Param is defined + char *ArgMgrValue (const char *param); // Returns Param value + const char *ArgMgrUnused (void); // Returns a never used arg. + int ArgMgrSave (const char *); // Save of parameters out + int ArgMgrUsage (const char **usage); // Display program usage + int ArgMgrPrintUnusedLabels (void); // Prints unused labels + + int ArgMgrGetInt (const char *param, int); // Gets an int (with default value) + float ArgMgrGetFloat (const char *param, float);// Gets a float (with default value) + const char *ArgMgrGetString(const char *param, const char* ext = 0);// Gets a string (with default value) + int ArgMgrGetLabel (const char *param, const char *, int); - int ArgMgrWantInt (char*, const char**); /* Demands an int */ - float ArgMgrWantFloat (char*, const char**); /* Demands a float */ - char *ArgMgrWantString(char*, const char**); /* Demands a string */ - int ArgMgrWantLabel (char*, char *, const char **); + int ArgMgrWantInt (const char *param, const char **usage); // Demands an int + float ArgMgrWantFloat (const char *param, const char **usage); // Demands a float + char *ArgMgrWantString(const char *param, const char **usage); // Demands a string + int ArgMgrWantLabel (const char *param, char *, const char **usage); - int *ArgMgrGetListOfInt (char *, int *); /* Gets a list of int */ - float *ArgMgrGetListOfFloat (char *, int *); /* Gets a list of float */ - char **ArgMgrGetListOfString(char *, int *); /* Gets a list of string */ + int *ArgMgrGetListOfInt (const char *param, int *); // Gets a list of int + float *ArgMgrGetListOfFloat (const char *param, int *); // Gets a list of float + char **ArgMgrGetListOfString(const char *param, int *); // Gets a list of string - int * ArgMgrGetIntEnum (char *, int *); /* Gets a list of int intervals */ - float * ArgMgrGetFloatEnum (char *, int *); /* Gets a list of float intervals*/ + int *ArgMgrGetIntEnum (const char *param, int *); // Gets a list of int pairs + uint16_t *ArgMgrGetXInt16Enum (const char *param, int *); // Gets a list of int16 pairs + float *ArgMgrGetFloatEnum (const char *param, int *); // Gets a list of float pairs private : - int FiltreLong (char *); - char *LoadedParam (char *, FILE *); - int ArgLoadFromFile (char *); - void ArgStdArgs (void); + int FiltreLong (const char *); + const char *LoadedParam(const char *, FILE *); + int ArgLoadFromFile (const char *); + void ArgStdArgs (void); // These ones are 'general purpose methods' - char *maj (char *); - char *Majuscule (char *); - int IdStrCountChar (char *chaine, int caract); - int *IdStrIntEnum (char* value, int *number); - float *IdStrFloatEnum (char* value, int *number); + char *maj (char *); + char *Majuscule (const char *); + + int IdStrCountChar (char *chaine,int caract); + int *IdStrIntEnum (char *value, int *number); + uint16_t *IdStrXInt16Enum (char *value, int *number); + float *IdStrFloatEnum (char *value, int *number); // --------------- Attributes ------------------------------ private : - char *ArgParamOut; /* Output File Name for param */ + const char *ArgParamOut; // Output File Name for param - char *ArgUsed; /* Used Arguments */ - char *ArgLab[ARGMAXCOUNT]; /* Arguments Labels */ - char *ArgStr[ARGMAXCOUNT]; /* Arguments 'strings' */ - int ArgCount; /* Number of arguments passed */ + char *ArgUsed; // Used Arguments + char **ArgLab; //[ARGMAXCOUNT]; // Arguments Labels + char **ArgStr; //[ARGMAXCOUNT]; // Arguments 'strings' + int ArgCount; // Number of arguments passed char *Appel; + + ArgMgr(const ArgMgr&); // Not implemented + void operator=(const ArgMgr&); // Not implemented }; } // end namespace gdcm