| ␉this->checkreq = true;␍␊ |
| ␉// Assumptions:␍␊ |
| ␉// *) options will not start with -␍␊ |
| ␉// *) parameters will not be repeated\␍␊ |
| ␉// *) Parameters are in order␍␊ |
| ␉// *) parameters will not be repeated␍␊ |
| ␉int z = 0;␍␊ |
| ␉for(int i = 1; i < argc - 1; i++)␍␊ |
| ␉tpodlist<int> parasused;␍␊ |
| ␉bool docontinue = false;␍␊ |
| ␉for(int i = 1; i < argc; i++)␍␊ |
| ␉{␍␊ |
| ␍␊ |
| ␉␉if (argv[i][0] == '-')␍␊ |
| ␉␉{␍␊ |
| ␉␉␉if (z != parameters.get_count())␍␊ |
| ␉␉␉{␍␊ |
| ␉␉␉␉for (int zz = z; zz < parameters.get_count(); zz++)␍␊ |
| ␉␉␉␉␍␊ |
| ␉␉␉␉for (int zz = 0; zz < parameters.get_count(); zz++)␍␊ |
| ␉␉␉␉{␍␊ |
| ␉␉␉␉␉docontinue = false;␍␊ |
| ␉␉␉␉␉for (int pu = 0; pu < parasused.get_count(); pu++)␍␊ |
| ␉␉␉␉␉{␉␍␊ |
| ␉␉␉␉␉␉if (parasused[pu] == zz)␍␊ |
| ␉␉␉␉␉␉{␍␊ |
| ␉␉␉␉␉␉␉docontinue = true;␍␊ |
| ␉␉␉␉␉␉␉break;␍␊ |
| ␉␉␉␉␉␉}␍␊ |
| ␉␉␉␉␉}␍␊ |
| ␉␉␉␉␉if (docontinue)␍␊ |
| ␉␉␉␉␉␉continue;␍␊ |
| ␉␉␉␉␉␍␊ |
| ␉␉␉␉␉if (argv[i] == ("-" + parameters[zz]->longparameter) || argv[i] == ("-" + parameters[zz]->shortparameter))␍␊ |
| ␉␉␉␉␉{␍␊ |
| ␉␉␉␉␉␉if (parameters[zz]->numberofparameters == 0)␍␊ |
|
| ␉␉␉␉␉␉␉}␍␊ |
| ␉␉␉␉␉␉}␍␊ |
| ␉␉␉␉␉␉z++;␍␊ |
| ␉␉␉␉␉␉parasused.add(zz);␍␊ |
| ␉␉␉␉␉␉break;␍␊ |
| ␉␉␉␉␉}␍␊ |
| ␉␉␉␉}␍␊ |
| ␉␉␉␉␍␊ |
|
| ␉␉for(int zz = z; zz < parameters.get_count(); zz++)␍␊ |
| ␉␉{␍␊ |
| ␉␉␉if (parameters[zz]->required)␍␊ |
| ␉␉␉{␍␊ |
| ␉␉␉␉this->checkreq = false;␍␊ |
| ␉␉␉this->missingparas.add(const_cast <char *>((const char *)parameters[zz]->shortparameter));␍␊ |
| ␉␉␉␉this->missingparas.add(const_cast <char *>((const char *)parameters[zz]->shortparameter));␍␊ |
| ␉␉␉}␍␊ |
| ␉␉}␍␊ |
| ␉}␍␊ |
| ␉this->paras = const_cast <tobjlist<Parameter> *>(¶meters);␍␊ |