From 02e24f0f533fe904c3a5275c4060c10c38d7c17a Mon Sep 17 00:00:00 2001 From: Ján Sučan Date: Wed, 10 May 2017 15:13:29 +0200 Subject: Uvodny commit, subory su rovnake ako na CD prilozenom k vytlacenemu texu bakalarskej prace, naviac je pridany len subor LICENCIA --- UserConfig.hpp | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 UserConfig.hpp (limited to 'UserConfig.hpp') diff --git a/UserConfig.hpp b/UserConfig.hpp new file mode 100755 index 0000000..4d3d6b3 --- /dev/null +++ b/UserConfig.hpp @@ -0,0 +1,67 @@ +#ifndef USER_CONFIG_HPP +#define USER_CONFIG_HPP 1 + +#include +#include +#include + +using std::string; +using std::list; +using std::vector; + +class CUserConfig { +private: + string mSerialPortName; + string mSerialSpeed; + bool mVerboseMode; + bool mHelp; + bool mVersion; + bool mIdent; + bool mSpeeds; + float mMcuFrequency; + bool mPrintProgress; + // Erase + bool mErase; + list mEraseBlockList; + // Read + bool mRead; + string mReadOutputFilename; + int mReadLength; + // Write + bool mWrite; + bool mWriteEraseWholeMemory; + string mWriteInputFilename; + bool mWriteCheckByRead; + + string getArgument(vector::const_iterator args, vector::const_iterator end); + void parseEraseArguments(vector::const_iterator args, vector::const_iterator end); + void parseReadArguments(vector::const_iterator args, vector::const_iterator end); + void parseWriteArguments(vector::const_iterator args, vector::const_iterator end); + void parseCommandLine(vector & args); + +public: + CUserConfig(int argc, char **argv); + + const string getHelpMessage(const string & execName) const; + + string & getSerialPortName(); + string & getSerialSpeed(); + bool isSpeedsSet(); + bool isVerboseModeSet(); + bool isPrintProgressSet(); + bool isHelpSet(); + bool isVersionSet(); + bool isIdentSet(); + bool isEraseSet(); + list getEraseBlockList(); + bool isReadSet(); + string & getReadOutputFname(); + bool isWriteSet(); + string & getWriteInputFname(); + int getReadLength(); + bool getWriteEraseWholeMemory(); + bool getWriteCheckByRead(); + float getMcuFrequency(); +}; + +#endif -- cgit v1.2.3