logic: Test License

Test license for x days
License_generator flag -e <days>
This commit is contained in:
Andreas Stallinger
2016-03-29 15:37:58 +02:00
parent ac506622b4
commit a662424e2b
30 changed files with 695 additions and 247 deletions
+1
View File
@@ -41,6 +41,7 @@
.ycm_extra_conf.py
.ycm_extra_conf.pyc
compile_commands.json
Makefile
/deployment/windows/CoatiAppSetup/CoatiSetup/Debug
/deployment/windows/CoatiAppSetup/CoatiSetup/Release
+118 -169
View File
@@ -1,171 +1,22 @@
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
ConfigManager.cpp WARNING: value path/to/nowhere is not present in config.
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:1:20
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:1:20
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:1:11
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:1:13
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:7:15
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:5:20
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:48
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:7:20
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:3:20
CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20
Token.cpp ERROR: Location Id was not referenced by this Token.
Node.cpp WARNING: Cannot change NodeType after it was already set from namespace to class
Edge.cpp ERROR: Nodes are not plain copies.
@@ -214,8 +65,106 @@ Edge.cpp ERROR: Nodes are not plain copies.
NetworkProtocolHelper.cpp ERROR: Failed to parse message, invalid type token
NetworkProtocolHelper.cpp ERROR: Failed to parse setActiveToken message, invalid token count
Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml
ConfigManager.cpp WARNING: value Bool is not present in config.
ConfigManager.cpp WARNING: value Int is not present in config.
ConfigManager.cpp WARNING: value Float is not present in config.
ConfigManager.cpp WARNING: value String is not present in config.
Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml
TextAccess.cpp ERROR: Could not open file path/to/test.h
ConfigManager.cpp WARNING: value Bool is not present in config.
ConfigManager.cpp WARNING: value Int is not present in config.
ConfigManager.cpp WARNING: value Float is not present in config.
ConfigManager.cpp WARNING: value String is not present in config.
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: typedef: type <file.cpp 1:1 1:1>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: class: Class <file.cpp 1:1 1:1>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: struct: Struct <file.cpp 1:1 1:1>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: global: Global <file.cpp 1:42 1:42>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: field: m_field <file.cpp 1:3 1:3>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: field: Struct::m_field <file.cpp 1:11 1:11>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: function: bool isTrue(char) <file.cpp 1:14 1:14>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: method: void isMethod(bool) <file.cpp 1:9 1:9>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: method: void Class::isMethod(bool) <file.cpp 1:1 1:1>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: namespace: utility <file.cpp 1:1 1:1>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: enum: Category <file.cpp 1:17 1:17>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: enum: Class::Category <file.cpp 1:1 1:1>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: enum constant: VALUE <file.cpp 1:1 1:1>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: class: ClassA <file.cpp 1:0 1:0>
INFO: class: ClassB <file.cpp 1:0 1:0>
INFO: inheritance: ClassB : ClassA <file.cpp 1:5 1:5>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: struct: StructA <file.cpp 1:0 1:0>
INFO: struct: StructB <file.cpp 1:0 1:0>
INFO: inheritance: StructB : StructA <file.cpp 1:5 1:5>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: method: void A::isMethod(bool) <file.cpp 1:9 1:9>
INFO: method: void B::isMethod(bool) <file.cpp 1:7 1:7>
INFO: override: void A::isMethod(bool) -> void B::isMethod(bool) <file.cpp 1:4 1:4>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: function: bool isTrue(char) <file.cpp 1:0 1:0>
INFO: function: void func(bool) <file.cpp 1:0 1:0>
INFO: call: bool isTrue(char) -> void func(bool) <file.cpp 1:9 1:9>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: global: global <file.cpp 1:0 1:0>
INFO: function: bool isTrue(char) <file.cpp 1:0 1:0>
INFO: call: global -> bool isTrue(char) <file.cpp 1:7 1:7>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: function: bool isTrue(char) <file.cpp 1:0 1:0>
INFO: field: Foo::m_field <file.cpp 1:0 1:0>
INFO: field usage: bool isTrue(char) -> Foo::m_field <file.cpp 1:7 1:7>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: function: bool isTrue(char) <file.cpp 1:0 1:0>
INFO: global: global <file.cpp 1:0 1:0>
INFO: global usage: bool isTrue(char) -> global <file.cpp 1:7 1:7>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: function: Struct isTrue(char) <file.cpp 1:0 1:0>
INFO: struct: Struct <file.cpp 1:0 1:0>
INFO: type usage: Struct isTrue(char) -> Struct <file.cpp 1:7 1:7>
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: file: file.h < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.h
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: file: file.h < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.h
INFO: file: file.cpp < 0:0 0:0>
INFO: include: file.h <file.cpp 1:7 1:7>
INFO: file: file.cpp < 0:0 0:0>
INFO: file: file.h < 0:0 0:0>
TextAccess.cpp WARNING: Index 'firstLine' has to be lower or equal index 'lastLine', is 3 > 2
TextAccess.cpp WARNING: Tried to access index 10. Maximum index is 8
TextAccess.cpp WARNING: Tried to access index 10. Maximum index is 8
+10 -13
View File
@@ -3,6 +3,8 @@
# Determine path to script
MY_PATH=`dirname "$0"`
$MY_PATH/buildonly.sh $@
cd $MY_PATH/..
# Build and run target
@@ -12,40 +14,35 @@ then
if [ "$2" = "test" ]
then
#echo "release test"
cmake --build build/Release --target Coati_test && cd bin/test && Release/Coati_test
cd bin/test && Release/Coati_test
elif [ "$2" = "trial" ]
then
cmake --build build/Release --target Coati_trial && cd bin/app && Release/Coati_trial
cd bin/app && Release/Coati_trial
elif [ "$2" = "keygen" ]
then
#echo "release keygen"
cmake --build build/Release --target Coati_license_generator && cd bin/license_generator && Release/Coati_license_generator
cd bin/license_generator && Release/Coati_license_generator
else
#echo "release app"
cmake --build build/Release --target Coati && cd bin/app && Release/Coati
cd bin/app && Release/Coati
fi
elif [ "$1" = "debug" ] || [ "$1" = "d" ]
then
if [ "$2" = "test" ]
then
#echo "debug test"
cmake --build build/Debug --target Coati_test && cd bin/test && Debug/Coati_test
cd bin/test && Debug/Coati_test
elif [ "$2" = "trial" ]
then
cmake --build build/Debug --target Coati_trial && cd bin/app && Debug/Coati_trial
cd bin/app && Debug/Coati_trial
elif [ "$2" = "keygen" ]
then
#echo "debug keygen"
cmake --build build/Debug --target Coati_license_generator && cd bin/license_generator && Debug/Coati_license_generator_d
cd bin/license_generator && Debug/Coati_license_generator_d
else
#echo "debug app"
cmake --build build/Debug --target Coati && cd bin/app && Debug/Coati
cd bin/app && Debug/Coati
fi
elif [ "$1" = "package" ] || [ "$1" = "p" ]
then
cmake --build build/Release --target package
mkdir -p distr && cp build/Release/Coati*.tar.gz distr #&& cp build/Release/Coati*.deb distr
echo "Packages copied into the distr folder"
else
echo "no arguments: first argument 'release' or 'debug', second argument 'test' for tests"
fi
+17
View File
@@ -6,6 +6,23 @@ add_files(
utility/commandline/CommandLineParser.cpp
utility/commandline/CommandLineParser.h
utility/headerSearch/ClangDetector.cpp
utility/headerSearch/ClangDetector.h
utility/headerSearch/CompilerDetectorBase.cpp
utility/headerSearch/CompilerDetectorBase.h
utility/headerSearch/DetectorBase.cpp
utility/headerSearch/DetectorBase.h
utility/headerSearch/DetectorProxy.h
utility/headerSearch/GCCDetector.cpp
utility/headerSearch/GCCDetector.h
utility/headerSearch/StandardHeaderDetection.cpp
utility/headerSearch/StandardHeaderDetection.h
utility/headerSearch/VisualStudioDetector.cpp
utility/headerSearch/VisualStudioDetector.h
utility/utilityApp.cpp
utility/utilityApp.h
isTrial.cpp
LicenseChecker.h
main.cpp
+4
View File
@@ -127,6 +127,10 @@ private:
license.loadPublicKeyFromString(PublicKey);
valid = license.isValid();
if (license.isExpired())
{
valid = false;
}
}
while (false);
@@ -13,10 +13,10 @@
namespace po = boost::program_options;
CommandLineParser::CommandLineParser(int argc, char** argv, const std::string& version)
: m_withoutGUI(false)
: m_force(false)
, m_quit(false)
, m_withLicense(false)
, m_force(false)
, m_withoutGUI(false)
{
std::string projectfile;
std::string projectfile_db;
@@ -20,10 +20,12 @@ private:
void processProjectfile(const std::string& file);
void processLicense(const bool isLoaded);
std::string m_projectFile;
bool m_withoutGUI;
bool m_quit;
bool m_force;
bool m_quit;
bool m_withLicense;
bool m_withoutGUI;
License m_license;
};
@@ -0,0 +1,7 @@
#ifndef CLANG_DETECTOR_H
#define CLANG_DETECTOR_H
#endif /* end of include guard: CLANG_DETECTOR_H */
@@ -0,0 +1,23 @@
#include "utility/headerSearch/CompilerDetectorBase.h"
#include "utility/utilityApp.h"
#include "utility/utilityString.h"
std::vector<FilePath> CompilerDetectorBase::getStandardHeaderPaths()
{
std::string command = m_name + " -x c++ -v -E /dev/null";
std::string clangOutput = utility::executeProcess(command.c_str());
std::string standardHeaders = utility::substrBetween(clangOutput, "#include <...> search starts here:\n","\nEnd of search list");
std::vector<FilePath> paths;
if (!standardHeaders.empty())
{
for (std::string s : utility::splitToVector(standardHeaders, '\n'))
{
paths.push_back(s);
}
}
return paths;
}
@@ -0,0 +1,13 @@
#ifndef COMPILER_DETECTOR_BASE_H
#define COMPILER_DETECTOR_BASE_H
#include "utility/headerSearch/DetectorBase.h"
class CompilerDetectorBase : public DetectorBase
{
public:
virtual std::vector<FilePath> getStandardHeaderPaths();
private:
};
#endif // COMPILER_DETECTOR_BASE_H
@@ -0,0 +1,23 @@
#include "utility/headerSearch/DetectorBase.h"
#include <iostream>
bool DetectorBase::detect()
{
return !getStandardHeaderPaths().empty();
}
std::string DetectorBase::getName() const
{
return m_name;
}
void DetectorBase::setName(const std::string& name)
{
std::cout << "setName()" << std::endl;
if (!name.empty())
{
std::cout << "name set to " << name << std::endl;
m_name = name;
}
}
@@ -0,0 +1,28 @@
#ifndef DETECTOR_BASE_H
#define DETECTOR_BASE_H
#include <vector>
#include "utility/file/FilePath.h"
class DetectorBase
{
public:
virtual ~DetectorBase(){};
virtual bool detect();
virtual std::vector<FilePath> getStandardHeaderPaths() = 0;
virtual std::string getName() const;
virtual void setName(const std::string& name);
protected:
std::string m_name;
};
class Detector
{
public:
virtual ~Detector();
};
#endif // DETECTOR_BASE_H
@@ -0,0 +1,13 @@
#ifndef DETECTOR_PROXY_H
#define DETECTOR_PROXY_H
class DetectorProxyBase
{
public:
};
#endif // DETECTOR_PROXY_H
@@ -0,0 +1,16 @@
#include "utility/headerSearch/GCCDetector.h"
#include "utility/headerSearch/StandardHeaderDetection.h"
GCCDetector::GCCDetector()
{
}
GCCDetector::~GCCDetector()
{
}
static StandardHeaderDetection::Add<GCCDetector> gcc("gcc");
static StandardHeaderDetection::Add<GCCDetector> clang("clang");
static StandardHeaderDetection::Add<GCCDetector> fakecomplier("fakecompiler");
@@ -0,0 +1,15 @@
#ifndef GCC_DETECTOR_H
#define GCC_DETECTOR_H
#include "utility/headerSearch/CompilerDetectorBase.h"
class GCCDetector : public CompilerDetectorBase
{
public:
GCCDetector ();
virtual ~GCCDetector ();
private:
};
#endif // GCC_DETECTOR_H
@@ -0,0 +1,121 @@
#include "utility/headerSearch/StandardHeaderDetection.h"
#include <cstdlib>
#include <map>
#include <string>
#include <vector>
#include <utility>
#include <iostream>
#include "utility/file/FilePath.h"
#include "utility/logging/logging.h"
#include "utility/utilityApp.h"
#include "utility/utilityString.h"
DetectorMap* StandardHeaderDetection::s_availableDetectors;
StandardHeaderDetection::StandardHeaderDetection()
{
detectHeaders();
}
StandardHeaderDetection::~StandardHeaderDetection()
{
if ( s_availableDetectors != nullptr )
{
delete s_availableDetectors;
}
}
void StandardHeaderDetection::detectHeaders()
{
for ( std::pair<std::string, std::shared_ptr<DetectorBase>> detector : *s_availableDetectors)
{
if ( detector.second->detect() )
{
m_detectedCompilers.insert(detector);
}
}
}
std::vector<std::string> StandardHeaderDetection::getDetectedCompilers()
{
std::vector<std::string> v;
for ( std::pair<std::string, std::shared_ptr<DetectorBase>> detector : m_detectedCompilers)
{
v.push_back(detector.first);
}
return v;
}
std::vector<FilePath> StandardHeaderDetection::getStandardHeaderPaths(std::string compiler)
{
auto it = m_detectedCompilers.find(compiler);
if(it != m_detectedCompilers.end())
{
return it->second->getStandardHeaderPaths();
}
return std::vector<FilePath>();
}
void StandardHeaderDetection::printdetectedCompilers()
{
std::cout << "Detected Compilers: " << std::endl;
std::vector<std::string> compilers = getDetectedCompilers();
for ( std::string compiler : compilers)
{
std::cout << compiler << std::endl;
}
}
void StandardHeaderDetection::printAvailableDetectors()
{
std::cout << "printAvailableDetectors: " << std::endl;
for ( std::pair<std::string, std::shared_ptr<DetectorBase>> detector : *s_availableDetectors)
{
std::cout << detector.first << std::endl;
}
}
//bool StandardHeaderDetection::detectFromCompiler(const std::string& compiler)
//{
//LOG_INFO("Searching for " + compiler + " include paths");
//std::string command = compiler + " -x c++ -v -E /dev/null";
//std::string clangOutput = utility::executeProcess(command.c_str());
//std::string standardHeaders = utility::substrBetween(clangOutput, "#include <...> search starts here:\n","\nEnd of search list");
//if(standardHeaders.empty())
//{
//return false;
//}
//std::vector<FilePath> paths;
//for(std::string s : utility::splitToVector(standardHeaders, '\n'))
//{
//paths.push_back(s);
//}
//m_standardHeaderPaths.insert(std::make_pair(compiler, paths));
//LOG_INFO(compiler + " standard headers detected");
//return true;
//}
//bool StandardHeaderDetection::detectVisualStudioVersion(const std::string& version)
//{
//LOG_INFO_STREAM(<< "Searching for Visual Studio Includes from Version: " << version);
//std::string vstoolstring = version + "COMNTOOLS";
//if( const char* vs_env = std::getenv(vstoolstring.c_str()))
//{
//FilePath VSHeaderPath(vs_env);
//VSHeaderPath = VSHeaderPath.concat("../VC/include");
//if(VSHeaderPath.exists())
//{
//LOG_INFO_STREAM(<< "Visual Studio 20" << version.substr(2,version.length()-3) << " includes detected");
//std::vector<FilePath> path;
//path.push_back(VSHeaderPath.str());
//m_standardHeaderPaths.insert(std::make_pair(version, path));
//return true;
//}
//}
//return false;
//}
@@ -0,0 +1,56 @@
#ifndef STANDARDHEADER_DETECTION_H
#define STANDARDHEADER_DETECTION_H
#include <map>
#include <memory>
#include <string>
#include "utility/headerSearch/DetectorBase.h"
typedef std::map<std::string, std::shared_ptr<DetectorBase>> DetectorMap;
class FilePath;
class StandardHeaderDetection
{
public:
StandardHeaderDetection();
~StandardHeaderDetection();
/// Checks all availabe detectors and saves found Compilers
void detectHeaders();
/// Returns alls found compilers
std::vector<std::string> getDetectedCompilers();
/// Returns the headerpaths from a found compiler
std::vector<FilePath> getStandardHeaderPaths(std::string compiler);
/// Declare a instance of this class to add a detector
template <typename U>
class Add
{
public:
Add(const std::string& name)
{
std::shared_ptr<DetectorBase> detector = std::shared_ptr<U>(new U());
if (!name.empty())
{
detector->setName(name);
}
if (!s_availableDetectors)
{
s_availableDetectors = new DetectorMap();
}
s_availableDetectors->insert(std::make_pair(detector->getName(), detector));
}
};
void printAvailableDetectors();
void printdetectedCompilers();
private:
static DetectorMap* s_availableDetectors;
DetectorMap m_detectedCompilers;
};
#endif //STANDARDHEADER_DETECTION_H
@@ -0,0 +1,38 @@
#include "utility/headerSearch/VisualStudioDetector.h"
#include <QSettings>
#include <string>
#include "utility/file/FilePath.h"
#include "utility/logging/logging.h"
#include "utility/headerSearch/StandardHeaderDetection.h"
VisualStudioDetector::~VisualStudioDetector()
{
}
std::vector<FilePath> VisualStudioDetector::getStandardHeaderPaths()
{
QSettings registry;
std::string vstoolstring = m_name + "COMNTOOLS";
std::vector<FilePath> path;
if( const char* vs_env = std::getenv(vstoolstring.c_str()))
{
FilePath VSHeaderPath(vs_env);
VSHeaderPath = VSHeaderPath.concat("../VC/include");
if(VSHeaderPath.exists())
{
LOG_INFO_STREAM(<< "Visual Studio 20" << m_name.substr(2,m_name.length()-3) << " includes detected");
path.push_back(VSHeaderPath.str());
}
}
return path;
}
// Add Visual Studio Version to the available detectors
static StandardHeaderDetection::Add<VisualStudioDetector> vs2015("VS140");
static StandardHeaderDetection::Add<VisualStudioDetector> vs2013("VS120");
static StandardHeaderDetection::Add<VisualStudioDetector> vs2012("VS110");
static StandardHeaderDetection::Add<VisualStudioDetector> vs2010("VS90");
@@ -0,0 +1,16 @@
#ifndef VISUAL_STUDIO_DETECTOR_H
#define VISUAL_STUDIO_DETECTOR_H
#include <vector>
#include "utility/headerSearch/DetectorBase.h"
class FilePath;
class VisualStudioDetector : public DetectorBase
{
public:
virtual ~VisualStudioDetector();
virtual std::vector<FilePath> getStandardHeaderPaths();
};
#endif // VISUAL_STUDIO_DETECTOR_H
+15
View File
@@ -0,0 +1,15 @@
#include "utility/utilityApp.h"
#include <QProcess>
std::string utility::executeProcess(const char *cmd)
{
QProcess process;
process.setProcessChannelMode(QProcess::MergedChannels);
process.start(cmd);
process.waitForFinished();
std::string processoutput = process.readAll().toStdString();
process.close();
return processoutput;
}
+13
View File
@@ -0,0 +1,13 @@
#ifndef UTILITY_APP_H
#define UTILITY_APP_H
#include <QProcess>
namespace utility
{
std::string executeProcess(const char* cmd);
}
#endif // UTILITY_APP_H
+12
View File
@@ -182,4 +182,16 @@ namespace utility
auto wsback = std::find_if_not(str.rbegin(), str.rend(), [](int c){ return std::isspace(c); }).base();
return (wsback <= wsfront ? std::string() : std::string(wsfront, wsback));
}
std::string substrBetween(const std::string &str, const std::string &delimiter1, const std::string &delimiter2)
{
size_t found_delimiter1 = str.find(delimiter1);
found_delimiter1 += delimiter1.length();
size_t found_delimiter2 = str.find(delimiter2,found_delimiter1);
if(found_delimiter1 != str.npos && found_delimiter2 != str.npos)
{
return str.substr(found_delimiter1, found_delimiter2-found_delimiter1);
}
return "";
}
}
+2
View File
@@ -32,6 +32,8 @@ namespace utility
std::string substrBefore(const std::string& str, char delimiter);
std::string substrAfter(const std::string& str, char delimiter);
std::string substrBetween(const std::string& str, const std::string& delimiter1, const std::string& delimiter2);
bool isPrefix(const std::string& prefix, const std::string& text);
std::string toUpperCase(const std::string& in);
+6 -1
View File
@@ -151,7 +151,12 @@ void QtLicense::handleNext()
license.loadPublicKeyFromString(PublicKey);
license.print();
if (license.isValid())
if (license.isExpired())
{
m_errorLabel->setText("The entered license key is expired");
return;
}
else if (license.isValid())
{
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
std::string appLocation = AppPath::getAppPath();
+18 -7
View File
@@ -6,10 +6,11 @@
#include "botan_all.h"
#include "boost/filesystem.hpp"
#include "boost/date_time/gregorian/gregorian.hpp"
#include "License.h"
Generator::Generator(std::string version)
Generator::Generator(const std::string& version)
: m_version(version)
{
}
@@ -41,7 +42,7 @@ std::string Generator::getPublicKeyFilename()
return m_publicKeyFile;
}
void Generator::setVersion(std::string version)
void Generator::setVersion(const std::string& version)
{
if(!version.empty())
{
@@ -49,7 +50,17 @@ void Generator::setVersion(std::string version)
}
}
std::string Generator::encodeLicense(std::string user, std::string licenseType)
std::string Generator::encodeLicense(const std::string& user, const int days)
{
boost::gregorian::date today = boost::gregorian::day_clock::local_day();
boost::gregorian::days daysToTry(days);
boost::gregorian::date expireDate = today + daysToTry;
std::string testLicenseTypeString = "Test License - valid till " + boost::gregorian::to_simple_string(expireDate);
return encodeLicense(user, testLicenseTypeString);
}
std::string Generator::encodeLicense(const std::string& user, const std::string& licenseType)
{
License license;
@@ -69,7 +80,7 @@ std::string Generator::encodeLicense(std::string user, std::string licenseType)
return license.getLicenseString();
}
bool Generator::verifyLicense(std::string filename)
bool Generator::verifyLicense(const std::string& filename)
{
License license;
license.loadFromFile(filename);
@@ -78,7 +89,7 @@ bool Generator::verifyLicense(std::string filename)
return license.isValid();
}
void Generator::setCustomPrivateKeyFile(std::string file)
void Generator::setCustomPrivateKeyFile(const std::string& file)
{
if(!file.empty())
{
@@ -86,7 +97,7 @@ void Generator::setCustomPrivateKeyFile(std::string file)
}
}
void Generator::setCustomPublicKeyFile(std::string file)
void Generator::setCustomPublicKeyFile(const std::string& file)
{
if(!file.empty())
{
@@ -134,7 +145,7 @@ bool Generator::loadPrivateKeyFromFile()
return true;
}
bool Generator::loadPrivateKeyFromString(std::string key)
bool Generator::loadPrivateKeyFromString(const std::string& key)
{
Botan::DataSource_Memory in(key);
Botan::Private_Key* privateKey= Botan::PKCS8::load_key(in, m_rng, PRIVATE_KEY_PASSWORD);
+8 -7
View File
@@ -8,21 +8,22 @@
class Generator
{
public:
Generator(std::string version = "x");
Generator(const std::string& version = "x");
~Generator();
std::string encodeLicense(std::string message, std::string licenseType);
bool verifyLicense(std::string filename = "license.txt");
std::string encodeLicense(const std::string& message, const std::string& licenseType);
std::string encodeLicense(const std::string& message, const int days);
bool verifyLicense(const std::string& filename = "license.txt");
void generateKeys();
void writeKeysToFiles();
void setVersion(std::string version);
void setCustomPrivateKeyFile(std::string file);
void setCustomPublicKeyFile(std::string file);
void setVersion(const std::string& version);
void setCustomPrivateKeyFile(const std::string& file);
void setCustomPublicKeyFile(const std::string& file);
std::string getPublicKeyPEMFileAsString();
std::string getPrivateKeyPEMFileAsString();
bool loadPrivateKeyFromFile();
bool loadPrivateKeyFromString(std::string key);
bool loadPrivateKeyFromString(const std::string& key);
void PrintLicense();
+59 -24
View File
@@ -8,6 +8,7 @@
#include <istream>
#include "botan_all.h"
#include "boost/date_time.hpp"
#include "boost/filesystem.hpp"
namespace
@@ -69,7 +70,27 @@ std::string License::getLicenseTypeLine() const
return lines[2];
}
void License::create(std::string user, std::string version, Botan::RSA_PrivateKey* privateKey, std::string type)
int License::getTimeLeft() const
{
const std::string testText = "Test License - valid till ";
if(getLicenseTypeLine().substr(0, testText.length()) == testText)
{
boost::gregorian::date expireDate(
boost::gregorian::from_simple_string(getLicenseTypeLine().substr(testText.length(),11))
);
boost::gregorian::date today = boost::gregorian::day_clock::local_day();
boost::gregorian::days daysLeft = expireDate - today;
return (daysLeft.days() < 0 ? 0 : daysLeft.days());
}
else
{
return -1;
}
}
void License::create(
const std::string& user, const std::string& version,
Botan::RSA_PrivateKey* privateKey, const std::string& type)
{
m_version = version;
createMessage(user, version, type);
@@ -85,7 +106,7 @@ void License::create(std::string user, std::string version, Botan::RSA_PrivateKe
addSignature(signature);
}
void License::createMessage(std::string user, std::string version, std::string type)
void License::createMessage(const std::string& user, const std::string& version, const std::string& type)
{
lines.clear();
lines.push_back(BEGIN_LICENSE);
@@ -97,7 +118,7 @@ void License::createMessage(std::string user, std::string version, std::string t
lines.push_back(pass9);
}
void License::writeToFile(std::string filename)
void License::writeToFile(const std::string& filename)
{
std::ofstream licenseFile(filename);
for(std::string line : lines)
@@ -106,7 +127,7 @@ void License::writeToFile(std::string filename)
}
}
bool License::loadFromString(std::string licenseText)
bool License::loadFromString(const std::string& licenseText)
{
lines.clear();
std::istringstream license(licenseText);
@@ -147,7 +168,7 @@ bool License::load(std::istream& stream)
return true;
}
bool License::loadFromFile(std::string filename)
bool License::loadFromFile(const std::string& filename)
{
lines.clear();
std::ifstream sigfile(filename);
@@ -159,7 +180,7 @@ void License::print()
std::cout << getLicenseString();
}
void License::addSignature(std::string signature)
void License::addSignature(const std::string& signature)
{
if(lines.size() > 5)
{
@@ -190,24 +211,38 @@ bool License::isValid() const
std::cout << "No public key loaded" << std::endl;
return false;
}
if(Botan::check_passhash9("Coati "+ getVersion(), getHashLine()))
{
// std::cout << "Hash from Coati "+ getVersion() + " confirmed" << std::endl;
}
try
{
Botan::secure_vector<Botan::byte> sig = Botan::base64_decode(getSignature());
if(Botan::check_passhash9("Coati "+ getVersion(), getHashLine()))
{
// std::cout << "Hash from Coati "+ getVersion() + " confirmed" << std::endl;
}
Botan::PK_Verifier verifier(*m_publicKey.get(), "EMSA4(SHA-256)");
Botan::secure_vector<Botan::byte> sig = Botan::base64_decode(getSignature());
Botan::DataSource_Memory in(getMessage());
Botan::byte buf[4096] = {0};
while(size_t got = in.read(buf, sizeof(buf)))
{
verifier.update(buf, got);
}
Botan::PK_Verifier verifier(*m_publicKey.get(), "EMSA4(SHA-256)");
const bool ok = verifier.check_signature(sig);
return ok;
Botan::DataSource_Memory in(getMessage());
Botan::byte buf[4096] = {0};
while(size_t got = in.read(buf, sizeof(buf)))
{
verifier.update(buf, got);
}
const bool ok = verifier.check_signature(sig);
return ok;
}
catch(...)
{
std::cout << "Invalid character in Licensekey" << std::endl;
}
return false;
}
bool License::isExpired() const
{
return !getTimeLeft();
}
std::string License::getPublicKeyFilename() const
@@ -228,7 +263,7 @@ std::string License::getVersion() const
return m_version;
}
bool License::loadPublicKeyFromFile(std::string filename)
bool License::loadPublicKeyFromFile(const std::string& filename)
{
if (!filename.empty()) {
m_publicKeyFilename = filename;
@@ -246,7 +281,7 @@ bool License::loadPublicKeyFromFile(std::string filename)
return false;
}
bool License::loadPublicKeyFromString(std::string publicKey)
bool License::loadPublicKeyFromString(const std::string& publicKey)
{
Botan::DataSource_Memory in(publicKey);
Botan::RSA_PublicKey *rsaPublicKey = dynamic_cast<Botan::RSA_PublicKey *>(Botan::X509::load_key(in));
@@ -286,7 +321,7 @@ bool License::checkLocation(const std::string& location, const std::string& hash
return Botan::check_passhash9(location, hash);
}
std::string License::getLicenseEncodedString(std::string applicationLocation) const
std::string License::getLicenseEncodedString(const std::string& applicationLocation) const
{
Botan::AutoSeeded_RNG rng;
std::vector<Botan::byte> file_contents;
@@ -311,7 +346,7 @@ std::string License::getLicenseEncodedString(std::string applicationLocation) co
return ret;
}
bool License::loadFromEncodedString(std::string encodedLicense, std::string applicationLocation)
bool License::loadFromEncodedString(const std::string& encodedLicense, const std::string& applicationLocation)
{
try {
//add cryptobox begin and end to loaded string
+17 -10
View File
@@ -28,23 +28,30 @@ public:
std::string getPublicKeyFilename() const;
std::string getVersion() const;
void create(std::string user, std::string version, Botan::RSA_PrivateKey* privateKey, std::string type="Private License");
/// if Test License return >=0 else -1
int getTimeLeft() const;
void create(
const std::string& user, const std::string& version,
Botan::RSA_PrivateKey* privateKey, const std::string& type="Private License"
);
std::string getLicenseString() const;
std::string getLicenseEncodedString(std::string applicationLocation) const;
std::string getLicenseEncodedString(const std::string& applicationLocation) const;
void writeToFile(std::string filename);
void writeToFile(const std::string& filename);
bool load(std::istream& stream);
bool loadFromString(std::string licenseText);
bool loadFromFile(std::string filename);
bool loadFromEncodedString(std::string encodedLicense, std::string applicationLocation);
bool loadFromString(const std::string& licenseText);
bool loadFromFile(const std::string& filename);
bool loadFromEncodedString(const std::string& encodedLicense, const std::string& applicationLocation);
bool loadPublicKeyFromFile(std::string);
bool loadPublicKeyFromFile(const std::string&);
bool loadPublicKeyFromString(std::string);
bool loadPublicKeyFromString(const std::string&);
void setVersion(const std::string&);
bool isValid() const;
bool isExpired() const;
void print();
@@ -52,8 +59,8 @@ public:
static bool checkLocation(const std::string&, const std::string&);
private:
void createMessage(std::string user, std::string version, std::string type = 0);
void addSignature(std::string);
void createMessage(const std::string& user, const std::string& version, const std::string& type = 0);
void addSignature(const std::string&);
std::string getEncodeKey(const std::string applicationLocation) const;
std::string m_version;
+20 -12
View File
@@ -19,19 +19,21 @@ bool process_command_line(int argc, char** argv)
std::string publicKey;
std::string license = "";
std::string type = "";
int days = 0;
po::options_description desc("Coati Generator");
desc.add_options()
("help,h", "Print this help message")
("key,k", "Generate the private and public key")
("generate,g", po::value<std::string>(&user), "Generate a License, USERNAME as value")
("check,c", "Validate a License")
("version,v", po::value<std::string>(&version), "Versionnumber of Coati")
("licenseType,t", po::value<std::string>(&type), "License Type of ")
("public-file", po::value<std::string>(&publicKey), "Custom public key file")
("private-file", po::value<std::string>(&privateKey), "Custom private key file")
("license-file", po::value<std::string>(&license), "Custom license")
;
("help,h", "Print this help message")
("key,k", "Generate the private and public key")
("generate,g", po::value<std::string>(&user), "Generate a License, USERNAME as value")
("check,c", "Validate a License")
("version,v", po::value<std::string>(&version), "Versionnumber of Coati")
("licenseType,t", po::value<std::string>(&type), "License Type of ")
("testLicense,e", po::value<int>(&days), "Generates a test license for <value> days")
("public-file", po::value<std::string>(&publicKey), "Custom public key file")
("private-file", po::value<std::string>(&privateKey), "Custom private key file")
("license-file", po::value<std::string>(&license), "Custom license")
;
po::variables_map vm;
po::store(po::parse_command_line(argc,argv,desc), vm);
@@ -68,8 +70,14 @@ bool process_command_line(int argc, char** argv)
std::cout << "Version of Coati is needed to generate a License" << std::endl;
return false;
}
keygen.encodeLicense(user,type);
if(vm.count("testLicense"))
{
keygen.encodeLicense(user,days);
}
else
{
keygen.encodeLicense(user,type);
}
}
if(vm.count("check"))