iRoCS Toolbox  1.1.0
CmdArgs.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2005-2015 Olaf Ronneberger, Jörg Mechnich, Florian Pigorsch,
4  * Mario Emmenlauer, Thorsten Schmidt
5  *
6  * Image Analysis Lab, University of Freiburg, Germany
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  **************************************************************************/
23 
24 /**************************************************************************
25 ** Title: template command line arguments
26 ** $RCSfile$
27 ** $Revision: 3319 $$Name$
28 ** $Date: 2010-01-23 17:10:43 +0100 (Sat, 23 Jan 2010) $
29 ** Copyright: GPL $Author: emmenlau $
30 ** Description:
31 **
32 **
33 **
34 **-------------------------------------------------------------------------
35 **
36 ** $Log$
37 ** Revision 1.11 2008/06/08 15:53:52 emmenlau
38 ** - removed arguments from (dummy) functions not using them to avoid gcc warning
39 **
40 ** Revision 1.10 2005/06/15 14:05:30 emmenlau
41 ** - added this->pointers to function-calls for gcc-4.0 compliance
42 **
43 ** Revision 1.9 2003/01/31 02:52:28 mechnich
44 ** added XML output of all CmdLine arguments
45 **
46 ** Revision 1.8 2002/10/28 13:11:33 mechnich
47 ** made everything compile with gcc 3.2
48 ** removed promptUser() from CmdLine.*
49 **
50 ** Revision 1.7 2002/05/14 08:14:50 pigorsch
51 ** -added documentation
52 **
53 ** Revision 1.6 2002/04/22 15:57:46 pigorsch
54 ** - added functions hasDefaultValue(), setDefaultValue(), getDefaultValueString()
55 **
56 ** Revision 1.5 2002/04/18 13:59:53 pigorsch
57 ** CmdArgs.hh
58 ** - splitted CmdArgTypeVector into CmdArgTypeVector and new class CmdArgTypeFixedVector
59 ** - adjust/verify syntax flags in all constructors
60 ** - added some documentation
61 **
62 ** Revision 1.4 2002/04/11 15:03:11 ronneber
63 ** - now ensures that in every Constructor of CmdArgTypeVector, the
64 ** CmdArg::isLIST flag is set
65 **
66 ** Revision 1.3 2002/04/10 09:54:55 pigorsch
67 ** - function parse(...) of arguments now sets the modified flag of the argument
68 **
69 ** Revision 1.2 2002/04/04 12:02:08 pigorsch
70 ** - added CmdArgThrow
71 ** - removed CmdArgUsage
72 ** - removed "dummy" stuff
73 **
74 ** Revision 1.1 2002/03/26 07:36:28 ronneber
75 ** restructuring for autoconf
76 **
77 ** Revision 1.1.1.1 2002/03/22 13:45:07 pigorsch
78 ** moved from polsoft repository
79 **
80 **
81 **
82 **************************************************************************/
83 
84 #ifndef CMDARGS_HH
85 #define CMDARGS_HH
86 
87 #ifdef HAVE_CONFIG_H
88 #include <config.hh>
89 #endif
90 
91 #include <sstream>
92 #include <string>
93 #include <vector>
94 
95 #include "CmdArg.hh"
96 #include "Compiler.hh"
97 #include "Errors.hh"
98 
99 
100 /*-------------------------------------------------------------------------
101  * Conversion functions for XML output
102  *-------------------------------------------------------------------------*/
103 inline
104 std::string
105 typeToString( const std::string&)
106 {
107  return "string";
108 }
109 
110 inline
111 std::string
113 {
114  return "int";
115 }
116 
117 inline
118 std::string
120 {
121  return "float";
122 }
123 
124 inline
125 std::string
126 typeToString( double)
127 {
128  return "double";
129 }
130 
131 /*======================================================================*/
168 /*======================================================================*/
169 template<typename T>
170 class CmdArgType: public CmdArg
171 {
172 public:
173  /*====================================================================*/
187  /*====================================================================*/
189  char aShortName,
190  const std::string aLongName,
191  const std::string aValueName,
192  const std::string aDescription,
193  Syntax aSyntax=isOPTVALREQ)
194  :CmdArg(aShortName, aLongName, aValueName, aDescription,
195  Syntax(aSyntax & ~isLIST & ~isFIXEDLIST & ~isPOS)),
196  pHasDefault(false)
197  {};
198 
199  /*====================================================================*/
211  /*====================================================================*/
213  const std::string aValueName,
214  const std::string aDescription,
215  Syntax aSyntax=isPOSVALREQ)
216  :CmdArg(aValueName, aDescription,
217  Syntax((aSyntax|isPOS) & ~isLIST & ~isFIXEDLIST)),
218  pHasDefault(false)
219  {};
220 
221  /*====================================================================*/
225  /*====================================================================*/
226  virtual ~CmdArgType()
227  {};
228 
229  /*====================================================================*/
244  /*====================================================================*/
245  virtual bool
247  const char* arg,
248  const char*& endptr,
249  CmdLine& )
250  {
251  bool temp=pCompiler.compile(arg, endptr, pValue);
252  if (temp==false)
253  {
255  se << "parsing error: " << pCompiler.errorMsg();
256  throw(se);
257  }
258  modified(true);
259  return temp;
260  };
261 
262  /*====================================================================*/
268  /*====================================================================*/
269  virtual T&
271  {
272  return pValue;
273  };
274 
275  /*====================================================================*/
281  /*====================================================================*/
282  virtual
283  void
284  setDefaultValue(const T& v)
285  {
286  pHasDefault=true;
287  pDefaultValue=v;
288  pValue=v;
289  };
290 
291  /*====================================================================*/
297  /*====================================================================*/
298  virtual
299  bool
301  {
302  return pHasDefault;
303  };
304 
305  /*====================================================================*/
311  /*====================================================================*/
312  virtual
313  std::string
315  {
316  std::ostringstream os;
317  os << pDefaultValue;
318  return os.str();
319  };
320 
321  /*====================================================================*/
327  /*====================================================================*/
328  virtual const T&
329  value() const
330  {
331  return pValue;
332  };
333 
334  /*====================================================================*/
340  /*====================================================================*/
341  virtual std::string
343  {
344  return typeToString( T());
345  }
346 
347  /*====================================================================*/
353  /*====================================================================*/
354  virtual std::string
356  {
357  std::stringstream ret;
358  ret << value();
359  return ret.str();
360  }
361 
362 private:
363  Compiler<T> pCompiler;
364  T pValue, pDefaultValue;
365  bool pHasDefault;
366 };
367 
368 
369 /*======================================================================*/
411 /*======================================================================*/
412 template<typename T>
413 class CmdArgTypeVector: public CmdArg, public std::vector<T>
414 {
415 public:
416 
418 
419  /*====================================================================*/
433  /*====================================================================*/
435  char aShortName,
436  const std::string aLongName,
437  const std::string aValueName,
438  const std::string aDescription,
439  Syntax aSyntax=Syntax(isOPTVALREQ|isLIST))
440  :CmdArg(aShortName, aLongName, aValueName,
441  aDescription,
442  Syntax((aSyntax|isLIST) & ~isFIXEDLIST & ~isPOS)),
443  pHasDefault(false)
444  {};
445 
446  /*====================================================================*/
458  /*====================================================================*/
460  const std::string aValueName,
461  const std::string aDescription,
462  Syntax aSyntax=Syntax(isPOSVALREQ|isLIST))
463  :CmdArg(aValueName, aDescription,
464  Syntax((aSyntax|isLIST|isPOS) & ~isFIXEDLIST)),
465  pHasDefault(false)
466  {};
467 
468  /*====================================================================*/
472  /*====================================================================*/
474  {};
475 
476  /*====================================================================*/
482  /*====================================================================*/
483  virtual
484  void
485  setDefaultValue(const std::vector<T>& v)
486  {
487  pHasDefault=true;
488  pDefaultValue=v;
489  std::vector<T>::operator=(v);
490  };
491 
492  /*====================================================================*/
498  /*====================================================================*/
499  virtual
500  bool
502  {
503  return pHasDefault;
504  };
505 
506  /*====================================================================*/
512  /*====================================================================*/
513  virtual
514  std::string
516  {
517  std::ostringstream os;
518  os << "[ ";
519  for (typename std::vector<T>::const_iterator p=pDefaultValue.begin();
520  p!=pDefaultValue.end();
521  ++p)
522  {
523  os << (*p) << " ";
524  }
525  os << "]";
526 
527  return os.str();
528  };
529 
530  /*====================================================================*/
545  /*====================================================================*/
546  virtual bool
548  const char* arg,
549  const char*& endptr,
550  CmdLine& )
551  {
552  T value;
553  bool temp=pCompiler.compile(arg, endptr, value);
554  if (temp==false)
555  {
557  se << "parsing error: " << pCompiler.errorMsg();
558  throw(se);
559  }
560  else
561  {
562  if (!modified() && hasDefaultValue() && *this==pDefaultValue)
563  {
564  std::vector<T>::clear();
565  }
566  this->push_back(value);
567  }
568  modified(true);
569  return temp;
570  };
571 
572  /*====================================================================*/
578  /*====================================================================*/
579  virtual std::string
581  {
582  return "vector_" + typeToString( T());
583  }
584 
585  /*====================================================================*/
591  /*====================================================================*/
592  virtual std::string
594  {
595  std::stringstream ret;
596 
597  const_iterator it = this->begin();
598  if( it != this->end())
599  {
600  ret << *it;;
601  ++it;
602  }
603 
604  for( ; it != this->end(); ++it)
605  {
606  ret << " " << *it;
607  }
608 
609  return ret.str();
610  }
611 
612 private:
613  Compiler<T> pCompiler;
614  std::vector<T> pDefaultValue;
615  bool pHasDefault;
616 };
617 
618 /*======================================================================*/
625 /*======================================================================*/
626 template<typename T>
627 class CmdArgTypeFixedVector: public CmdArg, public std::vector<T>
628 {
629 public:
630 
632 
633  /*====================================================================*/
648  /*====================================================================*/
650  char aShortName,
651  const std::string aLongName,
652  const std::string aValueName,
653  const std::string aDescription,
654  unsigned int aFixedSize,
656  :CmdArg(aShortName, aLongName, aValueName,
657  aDescription,
658  Syntax((aSyntax|isFIXEDLIST) & ~isLIST & ~isPOS)),
659  pFixedSize(aFixedSize),
660  pHasDefault(false)
661  {
662  if (aFixedSize==0)
663  {
665  se << "syntax error: size of fixed vector is 0";
666  throw(se);
667  }
668 
669  adjustSyntax();
670  };
671 
672  /*====================================================================*/
685  /*====================================================================*/
687  const std::string aValueName,
688  const std::string aDescription,
689  unsigned int aFixedSize,
691  :CmdArg(aValueName, aDescription,
692  Syntax((aSyntax|isFIXEDLIST|isPOS) & ~isLIST)),
693  pFixedSize(aFixedSize),
694  pHasDefault(false)
695  {
696  if (aFixedSize==0)
697  {
699  se << "syntax error: size of fixed vector is 0";
700  throw(se);
701  }
702 
703  adjustSyntax();
704  };
705 
706  /*====================================================================*/
710  /*====================================================================*/
712  {};
713 
714  /*====================================================================*/
720  /*====================================================================*/
721  virtual
722  void
723  setDefaultValue(const std::vector<T>& v)
724  {
725  if (pFixedSize!=v.size())
726  {
728  se << "syntax error: size of default vector does not match fixed size";
729  throw(se);
730  }
731  pHasDefault=true;
732  pDefaultValue=v;
733  std::vector<T>::operator=(v);
734  };
735 
736  /*====================================================================*/
742  /*====================================================================*/
743  virtual
744  bool
746  {
747  return pHasDefault;
748  };
749 
750  /*====================================================================*/
756  /*====================================================================*/
757  virtual
758  std::string
760  {
761  std::ostringstream os;
762  os << "[ ";
763  for (typename std::vector<T>::const_iterator p=pDefaultValue.begin();
764  p!=pDefaultValue.end();
765  ++p)
766  {
767  os << (*p) << " ";
768  }
769  os << "]";
770 
771  return os.str();
772  };
773 
774  /*====================================================================*/
789  /*====================================================================*/
790  virtual bool
792  const char* arg,
793  const char*& endptr,
794  CmdLine& )
795  {
796  T value;
797  bool temp=pCompiler.compile(arg, endptr, value);
798  if (temp==false)
799  {
801  se << "parsing error: " << pCompiler.errorMsg();
802  throw(se);
803  }
804  else
805  {
806 /*
807  // erase given default list
808  if (!modified())
809  {
810  std::vector<T>::clear();
811  }
812 */
813  // check remaining size
814  if (remainingSize()==0)
815  {
816  //clear();
818  se << "syntax error: too many values for fixed vector";
819  throw(se);
820  }
821 
822  this->push_back(value);
823  }
824  modified(true);
825  return temp;
826  };
827 
828  /*====================================================================*/
834  /*====================================================================*/
835  virtual
836  unsigned int
837  fixedSize() const
838  {
839  return pFixedSize;
840  };
841 
842  /*====================================================================*/
848  /*====================================================================*/
849  virtual
850  unsigned int
852  {
853  return fixedSize() - this->size();
854  };
855 
856  /*====================================================================*/
860  /*====================================================================*/
861  virtual
862  void
864  {
865  this->clear();
866  };
867 
868  /*====================================================================*/
874  /*====================================================================*/
875  virtual std::string
877  {
878  return "vector_" + typeToString( T());
879  }
880 
881  /*====================================================================*/
887  /*====================================================================*/
888  virtual std::string
890  {
891  std::stringstream ret;
892 
893  const_iterator it = this->begin();
894  if( it != this->end())
895  {
896  ret << *it;;
897  ++it;
898  }
899 
900  for( ; it != this->end(); ++it)
901  {
902  ret << " " << *it;
903  }
904 
905  return ret.str();
906  }
907 
908 private:
909  Compiler<T> pCompiler;
910  unsigned int pFixedSize;
911  std::vector<T> pDefaultValue;
912  bool pHasDefault;
913 };
914 
915 /*======================================================================*/
922 /*======================================================================*/
923 class CmdArgSwitch: public CmdArg
924 {
925 public:
926  /*====================================================================*/
939  /*====================================================================*/
941  char aShortName,
942  const std::string aLongName,
943  const std::string aDescription,
944  Syntax aSyntax=Syntax(isOPT))
945  :CmdArg(aShortName, aLongName, aDescription,
946  Syntax(aSyntax & ~isVALTAKEN & ~isLIST & ~isFIXEDLIST & ~isPOS)),
947  pValue(false)
948  {};
949 
950  /*====================================================================*/
954  /*====================================================================*/
955  virtual ~CmdArgSwitch()
956  {};
957 
958  /*====================================================================*/
969  /*====================================================================*/
970  virtual bool
972  const char* ,
973  const char*& ,
974  CmdLine& )
975  {
976  pValue=true;
977  modified(true);
978  return true;
979  };
980 
981  /*====================================================================*/
987  /*====================================================================*/
988  bool&
990  {
991  return pValue;
992  };
993 
994  /*====================================================================*/
1000  /*====================================================================*/
1001  const bool&
1002  value() const
1003  {
1004  return pValue;
1005  };
1006 
1007  /*====================================================================*/
1013  /*====================================================================*/
1014  bool
1015  toggled() const
1016  {
1017  return pValue;
1018  };
1019 
1020  /*====================================================================*/
1024  /*====================================================================*/
1025  void
1027  {
1028  pValue=false;
1029  };
1030 
1031 
1032  /*====================================================================*/
1038  /*====================================================================*/
1039  virtual std::string
1041  {
1042  return "bool";
1043  }
1044 
1045  /*====================================================================*/
1051  /*====================================================================*/
1052  virtual std::string
1054  {
1055  if( pValue)
1056  return "1";
1057  else
1058  return "0";
1059  }
1060 
1061 private:
1062  bool pValue;
1063 };
1064 
1065 
1066 /*======================================================================*/
1072 /*======================================================================*/
1073 template<typename E>
1074 class CmdArgThrow: public CmdArg
1075 {
1076 public:
1077  /*====================================================================*/
1090  /*====================================================================*/
1092  char aShortName,
1093  const std::string aLongName,
1094  const std::string aDescription,
1095  Syntax aSyntax=isOPT)
1096  :CmdArg(aShortName, aLongName, aDescription,
1097  Syntax((aSyntax|isOPT) & ~isVALTAKEN & ~isLIST & ~isFIXEDLIST & ~isPOS))
1098  {};
1099 
1100  /*====================================================================*/
1104  /*====================================================================*/
1105  virtual ~CmdArgThrow()
1106  {};
1107 
1108 
1109  /*====================================================================*/
1122  /*====================================================================*/
1123  virtual bool
1125  const char* ,
1126  const char*& ,
1127  CmdLine& )
1128  {
1129  E e;
1130  throw(e);
1131  return true;
1132  };
1133 
1134  /*====================================================================*/
1140  /*====================================================================*/
1141  virtual std::string
1143  {
1144  return "throw";
1145  }
1146 
1147  /*====================================================================*/
1153  /*====================================================================*/
1154  virtual std::string
1156  {
1157  return "";
1158  }
1159 
1160 };
1161 
1162 #endif
virtual std::string valueTypeAsString() const
Return the value type as a std::string.
Definition: CmdArgs.hh:580
virtual bool parse(const char *arg, const char *&endptr, CmdLine &)
Parse value string.
Definition: CmdArgs.hh:246
virtual bool parse(const char *, const char *&, CmdLine &)
Set the value to true.
Definition: CmdArgs.hh:971
CmdArgTypeVector< T >::const_iterator const_iterator
Definition: CmdArgs.hh:417
virtual void setDefaultValue(const std::vector< T > &v)
Specify default value.
Definition: CmdArgs.hh:485
CmdArgTypeVector(char aShortName, const std::string aLongName, const std::string aValueName, const std::string aDescription, Syntax aSyntax=Syntax(isOPTVALREQ|isLIST))
Constructor.
Definition: CmdArgs.hh:434
virtual void setDefaultValue(const T &v)
Specify default value.
Definition: CmdArgs.hh:284
virtual std::string valueTypeAsString() const
Return the value type as a std::string.
Definition: CmdArgs.hh:1142
virtual std::string getDefaultValueString() const
Returns the default value as a string.
Definition: CmdArgs.hh:759
virtual unsigned int fixedSize() const
Return the fixed size of the vector.
Definition: CmdArgs.hh:837
The CmdArgTypeFixedVector<T> class is a CmdArg that takes a fixed size list of values of type T...
Definition: CmdArgs.hh:627
virtual std::string valueTypeAsString() const
Return the value type as a std::string.
Definition: CmdArgs.hh:342
virtual ~CmdArgType()
Destructor.
Definition: CmdArgs.hh:226
virtual T & value()
Return the reference to the value of the argument.
Definition: CmdArgs.hh:270
virtual std::string valueAsString() const
Return the value as a std::string.
Definition: CmdArgs.hh:889
Syntax
Flags that define the argument syntax.
Definition: CmdArg.hh:112
bool modified() const
Returns true if the argument was parsed at the last parsing run.
std::string typeToString(const std::string &)
Definition: CmdArgs.hh:105
The CmdArgSwitch class is a CmdArg that behaves like a switch: if it was specified on the command lin...
Definition: CmdArgs.hh:923
The CmdArg class is the abstract base class for all command line arguments.
Definition: CmdArg.hh:102
virtual unsigned int fixedSize() const
Return fixed size if this CmdArg is a fixed list, return 0 otherwise.
virtual void clearFixedList()
Clear all values.
Definition: CmdArgs.hh:863
virtual std::string getDefaultValueString() const
Returns the default value as a string.
Definition: CmdArgs.hh:515
virtual std::string valueTypeAsString() const
Return the value type as a std::string.
Definition: CmdArgs.hh:876
virtual const T & value() const
Return the const reference to the value of the argument.
Definition: CmdArgs.hh:329
void adjustSyntax()
Adjust and correct specified syntax flags.
virtual ~CmdArgSwitch()
Destructor.
Definition: CmdArgs.hh:955
virtual std::string valueTypeAsString() const
Return the value type as a std::string.
Definition: CmdArgs.hh:1040
CmdArgType(char aShortName, const std::string aLongName, const std::string aValueName, const std::string aDescription, Syntax aSyntax=isOPTVALREQ)
Constructor.
Definition: CmdArgs.hh:188
CmdArgTypeFixedVector< T >::const_iterator const_iterator
Definition: CmdArgs.hh:631
virtual bool hasDefaultValue() const
Returns true if a default value was specified.
Definition: CmdArgs.hh:501
argument value is a list of fixed size
Definition: CmdArg.hh:123
bool & value()
Return the reference to the value of the argument.
Definition: CmdArgs.hh:989
bool toggled() const
Returns true if the argument was specified on the command line.
Definition: CmdArgs.hh:1015
virtual bool hasDefaultValue() const
Returns true if a default value was specified.
Definition: CmdArgs.hh:300
CmdArgTypeVector(const std::string aValueName, const std::string aDescription, Syntax aSyntax=Syntax(isPOSVALREQ|isLIST))
Constructor.
Definition: CmdArgs.hh:459
Syntax Error. Is thrown when an syntax error occurs.
Definition: Errors.hh:65
The CmdLine class is a parser for command line arguments.
Definition: CmdLine.hh:137
argument takes a value
Definition: CmdArg.hh:124
virtual bool parse(const char *, const char *&, CmdLine &)
Throw exception E.
Definition: CmdArgs.hh:1124
CmdArgTypeFixedVector(char aShortName, const std::string aLongName, const std::string aValueName, const std::string aDescription, unsigned int aFixedSize, Syntax aSyntax=Syntax(isOPTVALREQ|isFIXEDLIST))
Constructor.
Definition: CmdArgs.hh:649
virtual ~CmdArgTypeVector()
Destructor.
Definition: CmdArgs.hh:473
virtual std::string valueAsString() const
Return the value as a std::string.
Definition: CmdArgs.hh:1155
virtual std::string getDefaultValueString() const
Returns the default value as a string.
Definition: CmdArgs.hh:314
argument is positional
Definition: CmdArg.hh:121
CmdArgType(const std::string aValueName, const std::string aDescription, Syntax aSyntax=isPOSVALREQ)
Constructor.
Definition: CmdArgs.hh:212
virtual bool hasDefaultValue() const
Returns true if a default value was specified.
Definition: CmdArgs.hh:745
virtual std::string valueAsString() const
Return the value as a std::string.
Definition: CmdArgs.hh:355
virtual bool parse(const char *arg, const char *&endptr, CmdLine &)
Parse value string and append it to the vector.
Definition: CmdArgs.hh:791
void reset()
Reset status (set value to false).
Definition: CmdArgs.hh:1026
argument is a list
Definition: CmdArg.hh:120
virtual std::string valueAsString() const
Return the value as a std::string.
Definition: CmdArgs.hh:1053
virtual unsigned int remainingSize() const
Return number of remaining values if this CmdArg is a fixed list, return 0 otherwise.
CmdArgThrow(char aShortName, const std::string aLongName, const std::string aDescription, Syntax aSyntax=isOPT)
Constructor.
Definition: CmdArgs.hh:1091
The CmdArgType<T> class is a CmdArg that takes one value of type T.
Definition: CmdArgs.hh:170
CmdArgTypeFixedVector(const std::string aValueName, const std::string aDescription, unsigned int aFixedSize, Syntax aSyntax=Syntax(isPOSVALREQ|isFIXEDLIST))
Constructor.
Definition: CmdArgs.hh:686
The Compiler class is used by CmdArg classes to convert strings into desired datatypes.
Definition: Compiler.hh:64
virtual unsigned int remainingSize() const
Return the number of remaining values.
Definition: CmdArgs.hh:851
The CmdArgTypeVector<T> class is a CmdArg that takes a list of values of type T.
Definition: CmdArgs.hh:413
const bool & value() const
Return the const reference to the value of the argument.
Definition: CmdArgs.hh:1002
virtual std::string valueAsString() const
Return the value as a std::string.
Definition: CmdArgs.hh:593
CmdArgSwitch(char aShortName, const std::string aLongName, const std::string aDescription, Syntax aSyntax=Syntax(isOPT))
Constructor.
Definition: CmdArgs.hh:940
virtual void setDefaultValue(const std::vector< T > &v)
Specify default value.
Definition: CmdArgs.hh:723
argument is optional
Definition: CmdArg.hh:114
virtual ~CmdArgTypeFixedVector()
Destructor.
Definition: CmdArgs.hh:711
The CmdArgThrow<E> class is a CmdArg that throws an exception of type E when specified on the command...
Definition: CmdArgs.hh:1074
virtual bool parse(const char *arg, const char *&endptr, CmdLine &)
Parse value string and append it to the vector.
Definition: CmdArgs.hh:547
virtual ~CmdArgThrow()
Destructor.
Definition: CmdArgs.hh:1105