You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.2 KiB
C++

// License: AGPLv3 or later. https://www.gnu.org/licenses/licenses.html
#ifndef _AUXILIARY_H_
#define _AUXILIARY_H_
#include <string>
class processArguments
{
public:
processArguments(int theArgc, const char* const theArgv[]);
std::string codewordType() const;
short codewordInt() const;
int randomGeneratorSeed() const;
int codewordLength() const;
int codebookSize() const;
int modulus() const;
private:
short mint = 0;
short melt = 1;
short mintOrMelt;
int seed;
int length;
int size;
int mod;
int argc;
const char* const *argv;
// if any of the checks fail, program exits immediately w/
// error code 1
void checkIfArgcWithinRange();
void checkIfArg2Is0Or1Only();
void checkIfArg2Is0Or1OnlyAndSetMintOrMelt();
void checkIfCorrectNumberOfArgumentsForMintOrMelt();
void checkIf3rdOnwardArgsAreNotPositveInt();
void checkIfArgumentIsNotPositiveInt(
const char* argument, std::string itsIndex);
void setRemainingDataMemberValues();
void printProcessedArguments() const;
};
#endif