started working on cpp14 variant for fun

This commit is contained in:
Marcel M. Otte 2015-10-04 14:42:45 +02:00
parent f3de284690
commit 3d44d607c8
6 changed files with 181 additions and 0 deletions

65
cpp/.cproject Normal file
View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.699532643">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.699532643" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.699532643" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.base.699532643.1432349006" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.base.341272418" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1552200135" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
<builder buildPath="${workspace_loc:/cmdlineoptions-cpp14}/build/" id="cdt.managedbuild.target.gnu.builder.base.293242228" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1684517010" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1355826114" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.264121642" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.303603515" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1380864361" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.1397129313" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.1893852981" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.86080325" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.assembler.base.443312719" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.364677531" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="de.marw.cdt.cmake.core.settings">
<options/>
<linux command="cmake" generator="UnixMakefiles" use-default="true">
<defs/>
<undefs/>
</linux>
</storageModule>
</cconfiguration>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="cmdlineoptions-cpp14.null.982853788" name="cmdlineoptions-cpp14"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Default">
<resource resourceType="PROJECT" workspacePath="/cmdlineoptions-cpp14"/>
</configuration>
</storageModule>
</cproject>

27
cpp/.project Normal file
View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>cmdlineoptions-cpp14</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>

6
cpp/CMakeLists.txt Normal file
View File

@ -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)

15
cpp/CmdLineOptions.cpp Normal file
View File

@ -0,0 +1,15 @@
/*
* cmdlineoptions.cpp
*
* Created on: 04. Okt. 2015
* Author: qwc
*/
#include "CmdLineOptions.h"
namespace cmdlineoptions {
CmdLineOptions::~CmdLineOptions() {}
CmdLineOptions::CmdLineOptions() {}
} /* namespace cmdlineoptions */

56
cpp/CmdLineOptions.h Normal file
View File

@ -0,0 +1,56 @@
/*
* cmdlineoptions.h
*
* Created on: 04. Okt. 2015
* Author: qwc
*/
#ifndef CMDLINEOPTIONS_H_
#define CMDLINEOPTIONS_H_
#include <memory>
#include <string>
#include <list>
namespace cmdlineoptions {
// using namespace std;
class CmdLineOptions;
class Option {
private:
// important information
std::string name;
std::string description;
bool set;
// lists
std::unique_ptr<std::list<std::string>> options;
std::unique_ptr<std::list<std::string>> possibleParameters;
std::unique_ptr<std::list<std::string>> defaultParameters;
std::unique_ptr<std::list<std::string>> values;
public:
Option();
Option(std::string name);
virtual ~Option();
void setName(std::string name);
};
class CmdLineOptions {
public:
virtual ~CmdLineOptions();
static std::unique_ptr<CmdLineOptions> i();
std::shared_ptr<Option> create(std::string name);
std::shared_ptr<Option> getOption(std::string name);
private:
CmdLineOptions();
static std::unique_ptr<CmdLineOptions> instance;
};
} /* namespace cmdlineoptions */
#endif /* CMDLINEOPTIONS_H_ */

View File

@ -0,0 +1,12 @@
/*
* cmdlineoptions_test.cpp
*
* Created on: 04. Okt. 2015
* Author: qwc
*/
#include "CmdLineOptions.h"
namespace cmdlineoptions {
} /* namespace cmdlineoptions */