diff --git a/cpp/.cproject b/cpp/.cproject new file mode 100644 index 0000000..b92e101 --- /dev/null +++ b/cpp/.cproject @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cpp/.project b/cpp/.project new file mode 100644 index 0000000..a229865 --- /dev/null +++ b/cpp/.project @@ -0,0 +1,27 @@ + + + cmdlineoptions-cpp14 + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt new file mode 100644 index 0000000..bbc536e --- /dev/null +++ b/cpp/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 2.6) +project(CmdLineOptions) + +set(CMAKE_CXX_FLAGS "--std=c++14 -g -Wall") +add_library(CmdLineOptions_static STATIC CmdLineOptions.cpp) +add_library(CmdLineOptions SHARED CmdLineOptions.cpp) diff --git a/cpp/CmdLineOptions.cpp b/cpp/CmdLineOptions.cpp new file mode 100644 index 0000000..5deb192 --- /dev/null +++ b/cpp/CmdLineOptions.cpp @@ -0,0 +1,15 @@ +/* + * cmdlineoptions.cpp + * + * Created on: 04. Okt. 2015 + * Author: qwc + */ + +#include "CmdLineOptions.h" + +namespace cmdlineoptions { + +CmdLineOptions::~CmdLineOptions() {} +CmdLineOptions::CmdLineOptions() {} + +} /* namespace cmdlineoptions */ diff --git a/cpp/CmdLineOptions.h b/cpp/CmdLineOptions.h new file mode 100644 index 0000000..a9d5379 --- /dev/null +++ b/cpp/CmdLineOptions.h @@ -0,0 +1,56 @@ +/* + * cmdlineoptions.h + * + * Created on: 04. Okt. 2015 + * Author: qwc + */ + +#ifndef CMDLINEOPTIONS_H_ +#define CMDLINEOPTIONS_H_ +#include +#include +#include + +namespace cmdlineoptions { + +// using namespace std; + +class CmdLineOptions; + +class Option { +private: + // important information + std::string name; + std::string description; + bool set; + // lists + std::unique_ptr> options; + std::unique_ptr> possibleParameters; + std::unique_ptr> defaultParameters; + std::unique_ptr> values; + +public: + Option(); + Option(std::string name); + virtual ~Option(); + + void setName(std::string name); + +}; + +class CmdLineOptions { + +public: + virtual ~CmdLineOptions(); + static std::unique_ptr i(); + std::shared_ptr