1 #ifndef _GETOPT_H_INCLUDED_ 2 #define _GETOPT_H_INCLUDED_ 3 /////////////////////////////////////////////////////////////////////////////// 4 // 5 // GetOpt.h 6 // -------- 7 // GetOpt class definition 8 // 9 // Design and Implementation by Bjoern Lemke 10 // 11 // (C)opyright 2000-2016 Bjoern Lemke 12 // 13 // INTERFACE MODULE 14 // 15 // Class: GetOpt 16 // 17 // Description: Handling arguments from the command line 18 // 19 // Status: CLEAN 20 // 21 /////////////////////////////////////////////////////////////////////////////// 22 23 class GetOpt { 24 25 public: 26 27 GetOpt(int argc, char** argv, char *f); 28 ~GetOpt(); 29 30 int firstOpt(); 31 int nextOpt(); 32 char* getArg(); 33 34 private: 35 36 int parseOpt(); 37 bool isValidOption(int c); 38 39 int _optPos; 40 int _argc; 41 char **_argv; 42 char *_pF; 43 char *_optArg; 44 }; 45 #endif 46