diff --git a/CMakeLists.txt b/CMakeLists.txt index 25de769..6f15e36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,9 +34,9 @@ file(GLOB sources src/*.cc) add_library(netlicensing ${headers} ${sources}) target_link_libraries(netlicensing ${LIBS}) -# demo client -file(GLOB client_demo_headers client_demo/${db2lp_component}/*h) -file(GLOB client_demo_sources client_demo/${db2lp_component}/*cc) +# client demo +file(GLOB client_demo_headers client_demo/*h) +file(GLOB client_demo_sources client_demo/*cc) add_executable(netlicensing-client-demo ${client_demo_headers} ${client_demo_sources}) target_link_libraries(netlicensing-client-demo netlicensing ${LIBS}) diff --git a/include/netlicensing/context.h b/include/netlicensing/context.h index 2c914d2..fd94f21 100644 --- a/include/netlicensing/context.h +++ b/include/netlicensing/context.h @@ -6,9 +6,9 @@ namespace netlicensing { /** -* @brief Configure your connection to rest server using this Context class -* -*/ + * @brief Configure your connection to rest server using this Context class + * + */ class Context { public: enum SecurityMode { @@ -16,7 +16,7 @@ class Context { APIKEY_IDENTIFICATION, ANONYMOUS_IDENTIFICATION }; - + Context(); ~Context(); @@ -58,7 +58,7 @@ extern std::string url_with_parameters(const std::string& url, const parameters_ /** * @brief returns url encoded string -*/ + */ extern std::string escape_string(const std::string& s); } diff --git a/include/netlicensing/service.h b/include/netlicensing/service.h index 8818401..d25c24e 100644 --- a/include/netlicensing/service.h +++ b/include/netlicensing/service.h @@ -82,7 +82,7 @@ void list(Context& ctx, M& mapper, const std::string& filter) { long http_code; std::string res = ctx.get(endpoint(), params, http_code); traverse(mapper, res); - + // TODO(a-pavlov) fix code checking if (http_code != 200) { throw RestException(mapper.getInfos(), http_code); diff --git a/include/netlicensing/validation_result.h b/include/netlicensing/validation_result.h index 84f3f49..e7092ea 100644 --- a/include/netlicensing/validation_result.h +++ b/include/netlicensing/validation_result.h @@ -17,7 +17,7 @@ class Composition { public: Composition() : value_i() { } Composition(const std::string& value) : value_i(std::make_shared(value)) { } - + std::shared_ptr getValue() const { return value_i; } const std::map& getProperties() { @@ -31,7 +31,7 @@ class Composition { void put(const std::string& name, const Composition& value) { properties_i.insert(std::make_pair(name, value)); } - + std::shared_ptr get(const std::string& name) const { auto prop = properties_i.find(name); if (prop == properties_i.end()) { @@ -53,7 +53,7 @@ class ValidationResult { public: ValidationResult() { } - + const std::map& getValidations() { return validations_i; @@ -75,7 +75,7 @@ class ValidationResult { } return validation->second; } - + void setProductModuleValidation(const std::string& productModuleNumber, const Composition& productModuleValidation) { validations_i.insert(std::make_pair(productModuleNumber, productModuleValidation));